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

@ -121,9 +121,9 @@ update_keycodes_iter(struct xkb_keymap *keymap, xkb_keycode_t key, void *data)
}
void
keybind_update_keycodes(struct server *server)
keybind_update_keycodes(void)
{
struct xkb_state *state = server->seat.keyboard_group->keyboard.xkb_state;
struct xkb_state *state = g_server.seat.keyboard_group->keyboard.xkb_state;
struct xkb_keymap *keymap = xkb_state_get_keymap(state);
struct keybind *keybind;

View file

@ -185,7 +185,7 @@ backend_check_drm(struct wlr_backend *backend, void *is_drm)
}
static bool
should_update_activation(struct server *server)
should_update_activation(void)
{
static const char *act_env = "LABWC_UPDATE_ACTIVATION_ENV";
char *env = getenv(act_env);
@ -204,14 +204,14 @@ should_update_activation(struct server *server)
/* With no valid preference, update when a DRM backend is in use */
bool have_drm = false;
wlr_multi_for_each_backend(server->backend, backend_check_drm, &have_drm);
wlr_multi_for_each_backend(g_server.backend, backend_check_drm, &have_drm);
return have_drm;
}
static void
update_activation_env(struct server *server, bool initialize)
update_activation_env(bool initialize)
{
if (!should_update_activation(server)) {
if (!should_update_activation()) {
return;
}
@ -312,18 +312,18 @@ session_run_script(const char *script)
}
void
session_autostart_init(struct server *server)
session_autostart_init(void)
{
/* Update dbus and systemd user environment, each may fail gracefully */
update_activation_env(server, /* initialize */ true);
update_activation_env(/* initialize */ true);
session_run_script("autostart");
}
void
session_shutdown(struct server *server)
session_shutdown(void)
{
session_run_script("shutdown");
/* Clear the dbus and systemd user environment, each may fail gracefully */
update_activation_env(server, /* initialize */ false);
update_activation_env(/* initialize */ false);
}