From d53c0eb3392ee3ca2576e817891ec76af20a3cee Mon Sep 17 00:00:00 2001 From: Dmitry Simonenko Date: Tue, 29 Nov 2016 16:18:16 +0300 Subject: [PATCH] odissey: new naming scheme: od_routeid_t --- core/od_route.h | 2 +- core/od_route_id.h | 12 ++++++------ core/od_route_pool.c | 4 ++-- core/od_route_pool.h | 4 ++-- core/od_router.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/od_route.h b/core/od_route.h index f256e731..3d0c4d0c 100644 --- a/core/od_route.h +++ b/core/od_route.h @@ -11,7 +11,7 @@ typedef struct odroute_t odroute_t; struct odroute_t { od_schemeroute_t *scheme; - odroute_id_t id; + od_routeid_t id; od_serverpool_t server_pool; od_list_t link; }; diff --git a/core/od_route_id.h b/core/od_route_id.h index 3d14cdc7..ddccf94a 100644 --- a/core/od_route_id.h +++ b/core/od_route_id.h @@ -7,9 +7,9 @@ * PostgreSQL connection pooler and request router. */ -typedef struct odroute_id_t odroute_id_t; +typedef struct od_routeid_t od_routeid_t; -struct odroute_id_t { +struct od_routeid_t { char *user; int user_len; char *database; @@ -17,7 +17,7 @@ struct odroute_id_t { }; static inline void -od_routeid_init(odroute_id_t *id) +od_routeid_init(od_routeid_t *id) { id->user = NULL; id->user_len = 0; @@ -26,7 +26,7 @@ od_routeid_init(odroute_id_t *id) } static inline void -od_routeid_free(odroute_id_t *id) +od_routeid_free(od_routeid_t *id) { if (id->database) free(id->database); @@ -35,7 +35,7 @@ od_routeid_free(odroute_id_t *id) } static inline int -od_routeid_copy(odroute_id_t *dest, odroute_id_t *id) +od_routeid_copy(od_routeid_t *dest, od_routeid_t *id) { dest->database = malloc(id->database_len); if (dest->database == NULL) @@ -54,7 +54,7 @@ od_routeid_copy(odroute_id_t *dest, odroute_id_t *id) } static inline int -od_routeid_compare(odroute_id_t *a, odroute_id_t *b) +od_routeid_compare(od_routeid_t *a, od_routeid_t *b) { if (a->database_len == b->database_len && a->user_len == b->user_len) { diff --git a/core/od_route_pool.c b/core/od_route_pool.c index c217f255..11172944 100644 --- a/core/od_route_pool.c +++ b/core/od_route_pool.c @@ -47,7 +47,7 @@ void od_routepool_free(odroute_pool_t *pool) odroute_t* od_routepool_new(odroute_pool_t *pool, od_schemeroute_t *scheme, - odroute_id_t *id) + od_routeid_t *id) { odroute_t *route = od_routealloc(); if (route == NULL) @@ -73,7 +73,7 @@ void od_routepool_unlink(odroute_pool_t *pool, odroute_t *route) } odroute_t* -od_routepool_match(odroute_pool_t *pool, odroute_id_t *key) +od_routepool_match(odroute_pool_t *pool, od_routeid_t *key) { odroute_t *route; od_list_t *i; diff --git a/core/od_route_pool.h b/core/od_route_pool.h index 67c806f1..26e748fe 100644 --- a/core/od_route_pool.h +++ b/core/od_route_pool.h @@ -19,12 +19,12 @@ void od_routepool_free(odroute_pool_t*); odroute_t* od_routepool_new(odroute_pool_t*, od_schemeroute_t*, - odroute_id_t*); + od_routeid_t*); void od_routepool_unlink(odroute_pool_t*, odroute_t*); odroute_t* -od_routepool_match(odroute_pool_t*, odroute_id_t*); +od_routepool_match(odroute_pool_t*, od_routeid_t*); od_server_t* od_routepool_pop(odroute_pool_t*, od_serverstate_t); diff --git a/core/od_router.c b/core/od_router.c index 6147a118..037868f1 100644 --- a/core/od_router.c +++ b/core/od_router.c @@ -54,7 +54,7 @@ od_route(odpooler_t *pooler, so_bestartup_t *startup) if (route_scheme == NULL) return NULL; } - odroute_id_t id = { + od_routeid_t id = { .database = startup->database, .database_len = startup->database_len, .user = startup->user,