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

@ -11,7 +11,6 @@ struct wlr_output;
struct wlr_output_layout;
struct xwayland_unmanaged {
struct server *server;
struct wlr_xwayland_surface *xwayland_surface;
struct wlr_scene_node *node;
struct wl_list link;
@ -67,25 +66,22 @@ struct xwayland_view {
};
void xwayland_unmanaged_create(struct server *server,
struct wlr_xwayland_surface *xsurface, bool mapped);
void xwayland_unmanaged_create(struct wlr_xwayland_surface *xsurface, bool mapped);
void xwayland_view_create(struct server *server,
struct wlr_xwayland_surface *xsurface, bool mapped);
void xwayland_view_create(struct wlr_xwayland_surface *xsurface, bool mapped);
void xwayland_server_init(struct server *server,
struct wlr_compositor *compositor);
void xwayland_server_finish(struct server *server);
void xwayland_server_init(struct wlr_compositor *compositor);
void xwayland_server_finish(void);
void xwayland_adjust_usable_area(struct view *view,
struct wlr_output_layout *layout, struct wlr_output *output,
struct wlr_box *usable);
void xwayland_update_workarea(struct server *server);
void xwayland_update_workarea(void);
void xwayland_reset_cursor(struct server *server);
void xwayland_reset_cursor(void);
void xwayland_flush(struct server *server);
void xwayland_flush(void);
#endif /* HAVE_XWAYLAND */
#endif /* LABWC_XWAYLAND_H */