tree-wide: auto-replace of (struct server *)

#!/bin/bash
    read -r -d '' EXPRS << EOF
    s/xwayland->server/xwayland->svr/g;

    s/\t*struct server \*server;\n//g;
    s/\t*struct server \*server =.*?;\n//gs;
    s/\t*.* = ([a-z_]*->)*server[;,]\n//g;
    s/\{\n\n/\{\n/g;
    s/\n\n+/\n\n/g;

    s/\(\s*struct server \*server\)/(void)/g;
    s/\(\s*struct server \*server,\s*/(/g;
    s/,\s*struct server \*server\)/)/g;
    s/,\s*struct server \*server,\s*/, /g;

    s/\(\s*([a-z_]*->)*server\)/()/g;
    s/\(\s*([a-z_]*->)*server,\s*/(/g;
    s/,\s*([a-z_]*->)*server\)/)/g;
    s/,\s*([a-z_]*->)*server,\s*/, /g;

    s/([a-z_]*->)*server->/g_server./g;

    s/xwayland->svr/xwayland->server/g;
    EOF

    find src include \( -name \*.c -o -name \*.h \) -exec \
        perl -0777 -i -pe "$EXPRS" \{\} \;
This commit is contained in:
John Lindgren 2026-02-23 11:56:39 -05:00 committed by Johan Malm
parent 60ac8f07bb
commit cb49bddf63
81 changed files with 1522 additions and 1682 deletions

View file

@ -62,7 +62,7 @@ struct cursor_context_saved {
*
* If no node is found at cursor, ctx.type is set to ROOT.
*/
struct cursor_context get_cursor_context(struct server *server);
struct cursor_context get_cursor_context(void);
/**
* cursor_set - set cursor icon
@ -82,7 +82,7 @@ void cursor_context_save(struct cursor_context_saved *saved_ctx,
/**
* cursor_get_resize_edges - calculate resize edge based on cursor position
* @cursor - the current cursor (usually server->seat.cursor)
* @cursor - the current cursor (usually g_server.seat.cursor)
* @cursor_context - result of get_cursor_context()
*
* Calculates the resize edge combination that is most appropriate based
@ -113,7 +113,7 @@ enum lab_cursors cursor_get_from_edge(enum lab_edge resize_edges);
* or to force an update of the cursor icon by sending an exit and enter
* event to an already focused surface.
*/
void cursor_update_focus(struct server *server);
void cursor_update_focus(void);
/**
* cursor_update_image - re-set the labwc cursor image
@ -130,7 +130,7 @@ void cursor_update_image(struct seat *seat);
* should be notified. Parameters sx, sy holds the surface coordinates
* in that case.
*/
bool cursor_process_motion(struct server *server, uint32_t time, double *sx, double *sy);
bool cursor_process_motion(uint32_t time, double *sx, double *sy);
/**
* Processes cursor button press. The return value indicates if a client