From: Lennart Poettering Date: Tue, 3 May 2005 18:30:10 +0000 (+0000) Subject: * s/status/state/g X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=72e2daefd371691e385bcd61741ee696391941d8;p=catta * s/status/state/g * s/Status/State/g git-svn-id: file:///home/lennart/svn/public/avahi/trunk@36 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/announce.c b/announce.c index b0960b1..1dae473 100644 --- a/announce.c +++ b/announce.c @@ -46,10 +46,10 @@ void flx_entry_group_check_probed(flxEntryGroup *g, gboolean immediately) { /* Check whether all group members have been probed */ - if (g->status != FLX_ENTRY_GROUP_REGISTERING || g->n_probing > 0) + if (g->state != FLX_ENTRY_GROUP_REGISTERING || g->n_probing > 0) return; - flx_entry_group_run_callback(g, g->status = FLX_ENTRY_GROUP_ESTABLISHED); + flx_entry_group_run_callback(g, g->state = FLX_ENTRY_GROUP_ESTABLISHED); if (g->dead) return; @@ -105,7 +105,7 @@ static void next_state(flxAnnouncement *a) { a->entry->group->n_probing--; } - if (a->entry->group && a->entry->group->status == FLX_ENTRY_GROUP_REGISTERING) + if (a->entry->group && a->entry->group->state == FLX_ENTRY_GROUP_REGISTERING) a->state = FLX_WAITING; else { a->state = FLX_ANNOUNCING; @@ -200,7 +200,7 @@ static void new_announcement(flxServer *s, flxInterface *i, flxEntry *e) { a->state = FLX_PROBING; else if (!(e->flags & FLX_ENTRY_NOANNOUNCE)) { - if (!e->group || e->group->status == FLX_ENTRY_GROUP_ESTABLISHED) + if (!e->group || e->group->state == FLX_ENTRY_GROUP_ESTABLISHED) a->state = FLX_ANNOUNCING; else a->state = FLX_WAITING; diff --git a/flx.h b/flx.h index e641a85..fd65784 100644 --- a/flx.h +++ b/flx.h @@ -23,9 +23,9 @@ typedef enum { FLX_ENTRY_GROUP_REGISTERING, FLX_ENTRY_GROUP_ESTABLISHED, FLX_ENTRY_GROUP_COLLISION -} flxEntryGroupStatus; +} flxEntryGroupState; -typedef void (*flxEntryGroupCallback) (flxServer *s, flxEntryGroup *g, flxEntryGroupStatus status, gpointer userdata); +typedef void (*flxEntryGroupCallback) (flxServer *s, flxEntryGroup *g, flxEntryGroupState state, gpointer userdata); flxServer *flx_server_new(GMainContext *c); void flx_server_free(flxServer* s); @@ -36,7 +36,7 @@ void flx_server_dump(flxServer *s, FILE *f); flxEntryGroup *flx_entry_group_new(flxServer *s, flxEntryGroupCallback callback, gpointer userdata); void flx_entry_group_free(flxEntryGroup *g); void flx_entry_group_commit(flxEntryGroup *g); -flxEntryGroupStatus flx_entry_group_get_status(flxEntryGroup *g); +flxEntryGroupState flx_entry_group_get_state(flxEntryGroup *g); void flx_server_add( flxServer *s, diff --git a/main.c b/main.c index 48d69bd..82e7090 100644 --- a/main.c +++ b/main.c @@ -30,8 +30,8 @@ static void subscription(flxSubscription *s, flxRecord *r, gint interface, gucha g_free(t); } -static void entry_group_callback(flxServer *s, flxEntryGroup *g, flxEntryGroupStatus status, gpointer userdata) { - g_message("entry group state: %i", status); +static void entry_group_callback(flxServer *s, flxEntryGroup *g, flxEntryGroupState state, gpointer userdata) { + g_message("entry group state: %i", state); } int main(int argc, char *argv[]) { diff --git a/server.c b/server.c index b02fdad..55776a0 100644 --- a/server.c +++ b/server.c @@ -862,15 +862,15 @@ void flx_server_post_response(flxServer *s, gint interface, guchar protocol, flx flx_interface_monitor_walk(s->monitor, interface, protocol, post_response_callback, &tmpdata); } -void flx_entry_group_run_callback(flxEntryGroup *g, flxEntryGroupStatus status) { +void flx_entry_group_run_callback(flxEntryGroup *g, flxEntryGroupState state) { g_assert(g); if (g->callback) { - g->callback(g->server, g, status, g->userdata); + g->callback(g->server, g, state, g->userdata); return; } - if (status == FLX_ENTRY_GROUP_COLLISION) + if (state == FLX_ENTRY_GROUP_COLLISION) flx_entry_group_free(g); /* Ignore the rest */ @@ -886,7 +886,7 @@ flxEntryGroup *flx_entry_group_new(flxServer *s, flxEntryGroupCallback callback, g->callback = callback; g->userdata = userdata; g->dead = FALSE; - g->status = FLX_ENTRY_GROUP_UNCOMMITED; + g->state = FLX_ENTRY_GROUP_UNCOMMITED; g->n_probing = 0; FLX_LLIST_HEAD_INIT(flxEntry, g->entries); @@ -908,10 +908,10 @@ void flx_entry_group_commit(flxEntryGroup *g) { g_assert(g); g_assert(!g->dead); - if (g->status != FLX_ENTRY_GROUP_UNCOMMITED) + if (g->state != FLX_ENTRY_GROUP_UNCOMMITED) return; - flx_entry_group_run_callback(g, g->status = FLX_ENTRY_GROUP_REGISTERING); + flx_entry_group_run_callback(g, g->state = FLX_ENTRY_GROUP_REGISTERING); flx_announce_group(g->server, g); flx_entry_group_check_probed(g, FALSE); } @@ -921,13 +921,13 @@ gboolean flx_entry_commited(flxEntry *e) { g_assert(!e->dead); return !e->group || - e->group->status == FLX_ENTRY_GROUP_REGISTERING || - e->group->status == FLX_ENTRY_GROUP_ESTABLISHED; + e->group->state == FLX_ENTRY_GROUP_REGISTERING || + e->group->state == FLX_ENTRY_GROUP_ESTABLISHED; } -flxEntryGroupStatus flx_entry_group_get_status(flxEntryGroup *g) { +flxEntryGroupState flx_entry_group_get_state(flxEntryGroup *g) { g_assert(g); g_assert(!g->dead); - return g->status; + return g->state; } diff --git a/server.h b/server.h index 97b2d6b..810fd53 100644 --- a/server.h +++ b/server.h @@ -31,7 +31,7 @@ struct _flxEntryGroup { flxServer *server; gboolean dead; - flxEntryGroupStatus status; + flxEntryGroupState state; gpointer userdata; flxEntryGroupCallback callback; @@ -72,7 +72,7 @@ gboolean flx_server_entry_match_interface(flxEntry *e, flxInterface *i); void flx_server_post_query(flxServer *s, gint interface, guchar protocol, flxKey *key); void flx_server_post_response(flxServer *s, gint interface, guchar protocol, flxRecord *record, gboolean flush_cache); -void flx_entry_group_run_callback(flxEntryGroup *g, flxEntryGroupStatus state); +void flx_entry_group_run_callback(flxEntryGroup *g, flxEntryGroupState state); gboolean flx_entry_commited(flxEntry *e);