[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/27] slirp: add callbacks for timer
From: |
Samuel Thibault |
Subject: |
Re: [Qemu-devel] [PATCH 05/27] slirp: add callbacks for timer |
Date: |
Sun, 27 Jan 2019 12:48:40 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
Marc-André Lureau, le dim. 27 janv. 2019 15:42:41 +0400, a ecrit:
> On Sun, Jan 27, 2019 at 4:17 AM Samuel Thibault <address@hidden> wrote:
> > Marc-André Lureau, le jeu. 17 janv. 2019 15:43:37 +0400, a ecrit:
> > > + /* Create a new timer with the given callback and opaque data */
> > > + void *(*timer_new)(SlirpTimerCb cb, void *opaque);
> > > + /* Remove and free a timer */
> > > + void (*timer_free)(void *timer);
> > > + /* Modify a timer to expire at @expire_time */
> > > + void (*timer_mod)(void *timer, int64_t expire_time);
> >
> > I'd say we will want to make the API use an opaque type for timers, for
> > typechecking.
>
> You mean declaring a typedef struct SlirpTimer in libslirp.h?
>
> I am not sure it's a good idea, since the type is defined by the API
> client, it's an opaque type for the library.
Ah, right, C doesn't permit to declare a type without defining it.
Too bad, then.
Samuel