Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #384258

Re: Help requested with P99-based macro to create Wayland listeners

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: Help requested with P99-based macro to create Wayland listeners
Date 2024-04-10 09:03 -0700
Organization A noiseless patient Spider
Message-ID <86plux19y8.fsf@linuxsc.com> (permalink)
References <pan$3770d$7f0531e6$76520fa1$2c09330e@invalid.invalid> <86ttka1p61.fsf@linuxsc.com> <pan$325a1$29dc1a44$271afe6a$307a257b@invalid.invalid> <uv46mg$e1e0$1@dont-email.me> <pan$57aa8$bcee1756$62f53bf3$9223a50a@invalid.invalid>

Show all headers | View raw


Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> writes:

[request for example]

> MAKE_LISTENER(wl_registry, global, global_remove);
>
> ?
>
> static const struct wl_registry_listener wl_registry_listener = { 
> .global = callback_wl_registry_global,
> .global_remove = callback_wl_registry_global_remove
> };
>
> ?
>
> MAKE_LISTENER(xdg_wm_base, configure, close, configure_bounds,
> wm_capabilities);
>
> ?
>
> static const struct xdg_wm_base_listener xdg_wm_base_listener = {
>  .configure = callback_xdg_wm_base_configure,
>  .close = callback_xdg_wm_base_close,
>  .configure_bounds = callback_xdg_wm_base_configure_bounds,
>  .wm_capabilities = callback_xdg_wm_base_wm_capabilities
> };

I think it isn't too hard to write a macro to do what you
want.  I'm pretty sure it's possible to define such a macro
using the P99 macros to do the iteration, but I don't see
an easy way to do it.  If I were in need of such a macro,
probably I would ignore the P99 macros and just build a
simpler solution that works for the task at hand.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Help requested with P99-based macro to create Wayland listeners Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-04-09 00:36 +0000
  Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-09 09:22 -0700
    Re: Help requested with P99-based macro to create Wayland listeners Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-04-09 18:17 +0000
      Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-09 21:59 +0200
        Re: Help requested with P99-based macro to create Wayland listeners Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-04-09 20:20 +0000
          Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-10 11:05 +0200
            Re: Help requested with P99-based macro to create Wayland listeners scott@slp53.sl.home (Scott Lurndal) - 2024-04-10 14:26 +0000
              Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-10 16:54 +0200
                Re: Help requested with P99-based macro to create Wayland listeners "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-04-10 11:44 -0700
                Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-10 21:29 +0200
                Re: Help requested with P99-based macro to create Wayland listeners bart <bc@freeuk.com> - 2024-04-10 20:39 +0100
                Re: Help requested with P99-based macro to create Wayland listeners "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-04-10 13:55 -0700
                Re: Help requested with P99-based macro to create Wayland listeners "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-04-10 13:40 -0700
                Re: Help requested with P99-based macro to create Wayland listeners "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-04-10 13:48 -0700
            Re: Help requested with P99-based macro to create Wayland listeners Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-04-10 15:49 +0100
              Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-10 09:08 -0700
                Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-10 18:40 +0200
          Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-10 09:03 -0700
  Re: Help requested with P99-based macro to create Wayland listeners James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-04-10 02:49 -0400
    Re: Help requested with P99-based macro to create Wayland listeners Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-04-10 13:57 +0000
    Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-10 09:05 -0700
    Re: Help requested with P99-based macro to create Wayland listeners Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-04-11 00:57 +0000
  Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-10 19:56 -0700

csiph-web