X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ffrontend%2Fconnection-private.h;h=042091a997044a712c4de1d4c45fe734b1406348;hb=f994d636e70cff807afc456de5401bdfbfc63f42;hp=ef445d36bbbeb636bcf0a26d1355c0975b316ddb;hpb=265c305ba8a591217a2c54673c40a3e28665a5b9;p=sysdb.git diff --git a/src/frontend/connection-private.h b/src/frontend/connection-private.h index ef445d3..042091a 100644 --- a/src/frontend/connection-private.h +++ b/src/frontend/connection-private.h @@ -73,6 +73,7 @@ struct sdb_conn { /* user information */ char *username; /* NULL if the user has not been authenticated */ + _Bool ready; /* indicates that startup finished successfully */ }; #define CONN(obj) ((sdb_conn_t *)(obj)) @@ -80,6 +81,12 @@ struct sdb_conn { * node types */ +typedef struct { + sdb_conn_node_t super; + sdb_store_expr_t *expr; +} conn_expr_t; +#define CONN_EXPR(obj) ((conn_expr_t *)(obj)) + typedef struct { sdb_conn_node_t super; sdb_store_matcher_t *matcher; @@ -88,19 +95,23 @@ typedef struct { typedef struct { sdb_conn_node_t super; + int type; conn_matcher_t *filter; } conn_list_t; #define CONN_LIST(obj) ((conn_list_t *)(obj)) typedef struct { sdb_conn_node_t super; - char *name; + int type; + char *host; + char *name; /* NULL for type == SDB_HOST */ conn_matcher_t *filter; } conn_fetch_t; #define CONN_FETCH(obj) ((conn_fetch_t *)(obj)) typedef struct { sdb_conn_node_t super; + int type; conn_matcher_t *matcher; conn_matcher_t *filter; } conn_lookup_t; @@ -118,6 +129,12 @@ typedef struct { * type helper functions */ +static void __attribute__((unused)) +conn_expr_destroy(sdb_object_t *obj) +{ + sdb_object_deref(SDB_OBJ(CONN_EXPR(obj)->expr)); +} /* conn_expr_destroy */ + static void __attribute__((unused)) conn_matcher_destroy(sdb_object_t *obj) { @@ -133,6 +150,8 @@ conn_list_destroy(sdb_object_t *obj) static void __attribute__((unused)) conn_fetch_destroy(sdb_object_t *obj) { + if (CONN_FETCH(obj)->host) + free(CONN_FETCH(obj)->host); if (CONN_FETCH(obj)->name) free(CONN_FETCH(obj)->name); sdb_object_deref(SDB_OBJ(CONN_FETCH(obj)->filter));