瀏覽代碼

xhttp_pi: clang-format for coherent indentation and coding style

Victor Seva 2 年之前
父節點
當前提交
0bc9de0dcd

+ 16 - 15
src/modules/xhttp_pi/http_db_handler.c

@@ -32,17 +32,17 @@
 #include "xhttp_pi_fnc.h"
 
 
-
 int connect_http_db(ph_framework_t *framework_data, int index)
 {
 	ph_db_url_t *ph_db_urls = framework_data->ph_db_urls;
 
-	if (ph_db_urls[index].http_db_handle) {
+	if(ph_db_urls[index].http_db_handle) {
 		LM_CRIT("BUG - db connection found already open\n");
 		return -1;
 	}
-	if ((ph_db_urls[index].http_db_handle =
-		ph_db_urls[index].http_dbf.init(&ph_db_urls[index].db_url)) == NULL) {
+	if((ph_db_urls[index].http_db_handle = ph_db_urls[index].http_dbf.init(
+				&ph_db_urls[index].db_url))
+			== NULL) {
 		return -1;
 	}
 	return 0;
@@ -52,21 +52,21 @@ int use_table(ph_db_table_t *db_table)
 {
 	ph_db_url_t *db_url;
 
-	if(db_table==NULL){
+	if(db_table == NULL) {
 		LM_ERR("null db_table handler\n");
 		return -1;
 	}
-	if(db_table->db_url==NULL){
+	if(db_table->db_url == NULL) {
 		LM_ERR("null db_url for table [%s]\n", db_table->name.s);
 		return -1;
 	}
 	db_url = db_table->db_url;
-	if(db_url->http_db_handle==NULL){
+	if(db_url->http_db_handle == NULL) {
 		LM_ERR("null db handle for table [%s]\n", db_table->name.s);
 		return -1;
 	}
-	db_table->db_url->http_dbf.use_table(db_table->db_url->http_db_handle,
-						&db_table->name);
+	db_table->db_url->http_dbf.use_table(
+			db_table->db_url->http_db_handle, &db_table->name);
 	return 0;
 }
 
@@ -74,12 +74,12 @@ int init_http_db(ph_framework_t *framework_data, int index)
 {
 	ph_db_url_t *ph_db_urls = framework_data->ph_db_urls;
 
-	if (db_bind_mod(&ph_db_urls[index].db_url,
-		&ph_db_urls[index].http_dbf) < 0) {
+	if(db_bind_mod(&ph_db_urls[index].db_url, &ph_db_urls[index].http_dbf)
+			< 0) {
 		LM_ERR("Unable to bind to a database driver\n");
 		return -1;
 	}
-	if (connect_http_db(framework_data, index)!=0){
+	if(connect_http_db(framework_data, index) != 0) {
 		LM_ERR("unable to connect to the database\n");
 		return -1;
 	}
@@ -96,12 +96,13 @@ void destroy_http_db(ph_framework_t *framework_data)
 	int i;
 	ph_db_url_t *ph_db_urls;
 
-	if (framework_data == NULL) return;
+	if(framework_data == NULL)
+		return;
 
 	ph_db_urls = framework_data->ph_db_urls;
 	/* close the DB connections */
-	for(i=0;i<framework_data->ph_db_urls_size;i++){
-		if (ph_db_urls[i].http_db_handle) {
+	for(i = 0; i < framework_data->ph_db_urls_size; i++) {
+		if(ph_db_urls[i].http_db_handle) {
 			ph_db_urls[i].http_dbf.close(ph_db_urls[i].http_db_handle);
 			ph_db_urls[i].http_db_handle = NULL;
 		}

+ 99 - 100
src/modules/xhttp_pi/xhttp_pi.c

@@ -65,7 +65,7 @@ extern ph_framework_t *ph_framework_data;
 
 static int mod_init(void);
 static void destroy(void);
-static int xhttp_pi_dispatch(sip_msg_t* msg, char* s1, char* s2);
+static int xhttp_pi_dispatch(sip_msg_t *msg, char *s1, char *s2);
 
 
 /** The context of the xhttp_pi request being processed.
@@ -78,7 +78,7 @@ static pi_ctx_t ctx;
 
 static xhttp_api_t xhttp_api;
 
-gen_lock_t* ph_lock;
+gen_lock_t *ph_lock;
 
 
 str xhttp_pi_root = str_init("pi");
@@ -88,32 +88,28 @@ int buf_size = 0;
 char error_buf[ERROR_REASON_BUF_LEN];
 
 static cmd_export_t cmds[] = {
-	{"dispatch_xhttp_pi",(cmd_function)xhttp_pi_dispatch,0,0,0,
-			REQUEST_ROUTE|EVENT_ROUTE},
-	{0, 0, 0, 0, 0, 0}
-};
+		{"dispatch_xhttp_pi", (cmd_function)xhttp_pi_dispatch, 0, 0, 0,
+				REQUEST_ROUTE | EVENT_ROUTE},
+		{0, 0, 0, 0, 0, 0}};
 
-static param_export_t params[] = {
-	{"xhttp_pi_root",	PARAM_STR,	&xhttp_pi_root},
-	{"xhttp_pi_buf_size",	INT_PARAM,	&buf_size},
-	{"framework",	PARAM_STR,	&filename},
-	{0, 0, 0}
-};
+static param_export_t params[] = {{"xhttp_pi_root", PARAM_STR, &xhttp_pi_root},
+		{"xhttp_pi_buf_size", INT_PARAM, &buf_size},
+		{"framework", PARAM_STR, &filename}, {0, 0, 0}};
 
 static rpc_export_t rpc_methods[];
 
 /** module exports */
-struct module_exports exports= {
-	"xhttp_pi",			/* module name */
-	DEFAULT_DLFLAGS,	/* dlopen flags */
-	cmds,				/* cmd (cfg function) exports */
-	params,				/* param exports */
-	0,					/* RPC method exports */
-	0,					/* pv exports */
-	0,					/* response handling function */
-	mod_init,			/* module init function */
-	0,					/* per-child init function */
-	destroy					/* module destroy function */
+struct module_exports exports = {
+		"xhttp_pi",		 /* module name */
+		DEFAULT_DLFLAGS, /* dlopen flags */
+		cmds,			 /* cmd (cfg function) exports */
+		params,			 /* param exports */
+		0,				 /* RPC method exports */
+		0,				 /* pv exports */
+		0,				 /* response handling function */
+		mod_init,		 /* module init function */
+		0,				 /* per-child init function */
+		destroy			 /* module destroy function */
 };
 
 
@@ -129,7 +125,7 @@ struct module_exports exports= {
  * @param code Reason code.
  * @param fmt Formatting string used to build the reason phrase.
  */
-static void pi_fault(pi_ctx_t* ctx, int code, char* fmt, ...)
+static void pi_fault(pi_ctx_t *ctx, int code, char *fmt, ...)
 {
 	va_list ap;
 	struct xhttp_pi_reply *reply = &ctx->reply;
@@ -147,45 +143,44 @@ static void pi_fault(pi_ctx_t* ctx, int code, char* fmt, ...)
 }
 
 
-static int pi_send(pi_ctx_t* ctx)
+static int pi_send(pi_ctx_t *ctx)
 {
-	struct xhttp_pi_reply* reply;
+	struct xhttp_pi_reply *reply;
 
-	if (ctx->reply_sent) return 1;
+	if(ctx->reply_sent)
+		return 1;
 
 	reply = &ctx->reply;
 
-	if (0!=ph_run_pi_cmd(ctx)){
+	if(0 != ph_run_pi_cmd(ctx)) {
 		LM_DBG("pi_fault(500,\"Internal Server Error\"\n");
 		pi_fault(ctx, 500, "Internal Server Error");
 	}
 
 	ctx->reply_sent = 1;
-	if (reply->body.len) {
+	if(reply->body.len) {
 		xhttp_api.reply(ctx->msg, reply->code, &reply->reason,
-			&XHTTP_PI_CONTENT_TYPE_TEXT_HTML, &reply->body);
-	}
-	else {
-		LM_DBG("xhttp_api.reply(%p, %d, %.*s, %.*s, %.*s)\n",
-			ctx->msg, reply->code,
-			(&reply->reason)->len, (&reply->reason)->s,
-			(&XHTTP_PI_CONTENT_TYPE_TEXT_HTML)->len,
-			(&XHTTP_PI_CONTENT_TYPE_TEXT_HTML)->s,
-			(&reply->reason)->len, (&reply->reason)->s);
+				&XHTTP_PI_CONTENT_TYPE_TEXT_HTML, &reply->body);
+	} else {
+		LM_DBG("xhttp_api.reply(%p, %d, %.*s, %.*s, %.*s)\n", ctx->msg,
+				reply->code, (&reply->reason)->len, (&reply->reason)->s,
+				(&XHTTP_PI_CONTENT_TYPE_TEXT_HTML)->len,
+				(&XHTTP_PI_CONTENT_TYPE_TEXT_HTML)->s, (&reply->reason)->len,
+				(&reply->reason)->s);
 		xhttp_api.reply(ctx->msg, reply->code, &reply->reason,
-			&XHTTP_PI_CONTENT_TYPE_TEXT_HTML, &reply->reason);
+				&XHTTP_PI_CONTENT_TYPE_TEXT_HTML, &reply->reason);
 	}
 
-	if (reply->buf.s) {
+	if(reply->buf.s) {
 		pkg_free(reply->buf.s);
 		reply->buf.s = NULL;
 		reply->buf.len = 0;
 	}
-	if (ctx->arg.s) {
-        pkg_free(ctx->arg.s);
-        ctx->arg.s = NULL;
-        ctx->arg.len = 0;
-    }
+	if(ctx->arg.s) {
+		pkg_free(ctx->arg.s);
+		ctx->arg.s = NULL;
+		ctx->arg.len = 0;
+	}
 
 	return 0;
 }
@@ -205,7 +200,7 @@ static int init_xhttp_pi_reply(pi_ctx_t *ctx)
 	reply->code = 200;
 	reply->reason = XHTTP_PI_REASON_OK;
 	reply->buf.s = pkg_malloc(buf_size);
-	if (!reply->buf.s) {
+	if(!reply->buf.s) {
 		PKG_MEM_ERROR;
 		pi_fault(ctx, 500, "Internal Server Error (No memory left)");
 		return -1;
@@ -217,15 +212,14 @@ static int init_xhttp_pi_reply(pi_ctx_t *ctx)
 }
 
 
-
 int ph_init_async_lock(void)
 {
 	ph_lock = lock_alloc();
-		if (ph_lock==NULL) {
+	if(ph_lock == NULL) {
 		LM_ERR("failed to create lock\n");
 		return -1;
 	}
-	if (lock_init(ph_lock)==NULL) {
+	if(lock_init(ph_lock) == NULL) {
 		LM_ERR("failed to init lock\n");
 		return -1;
 	}
@@ -235,7 +229,7 @@ int ph_init_async_lock(void)
 
 void ph_destroy_async_lock(void)
 {
-	if (ph_lock) {
+	if(ph_lock) {
 		lock_destroy(ph_lock);
 		lock_dealloc(ph_lock);
 	}
@@ -245,56 +239,56 @@ static int mod_init(void)
 {
 	int i;
 
-	if (rpc_register_array(rpc_methods)!=0) {
+	if(rpc_register_array(rpc_methods) != 0) {
 		LM_ERR("failed to register RPC commands\n");
 		return -1;
 	}
 
 	/* bind the XHTTP API */
-	if (xhttp_load_api(&xhttp_api) < 0) {
+	if(xhttp_load_api(&xhttp_api) < 0) {
 		LM_ERR("cannot bind to XHTTP API\n");
 		return -1;
 	}
 
 	/* Check xhttp_pi_buf_size param */
-	if (buf_size == 0)
-		buf_size = pkg_mem_size/3;
+	if(buf_size == 0)
+		buf_size = pkg_mem_size / 3;
 
 	/* Check xhttp_pi_root param */
-	for(i=0;i<xhttp_pi_root.len;i++){
-		if ( !isalnum(xhttp_pi_root.s[i]) && xhttp_pi_root.s[i]!='_') {
+	for(i = 0; i < xhttp_pi_root.len; i++) {
+		if(!isalnum(xhttp_pi_root.s[i]) && xhttp_pi_root.s[i] != '_') {
 			LM_ERR("bad xhttp_pi_root param [%.*s], char [%c] "
-				"- use only alphanumerical chars\n",
-				xhttp_pi_root.len, xhttp_pi_root.s,
-				xhttp_pi_root.s[i]);
+				   "- use only alphanumerical chars\n",
+					xhttp_pi_root.len, xhttp_pi_root.s, xhttp_pi_root.s[i]);
 			return -1;
 		}
 	}
 
 	/* Check framework param */
-	if (!filename.s || filename.len<=0) {
+	if(!filename.s || filename.len <= 0) {
 		LM_ERR("missing framework\n");
 		return -1;
 	}
 
-		/* building a cache of pi module commands */
-		if (0!=ph_init_cmds(&ph_framework_data, filename.s))
+	/* building a cache of pi module commands */
+	if(0 != ph_init_cmds(&ph_framework_data, filename.s))
+		return -1;
+	for(i = 0; i < ph_framework_data->ph_db_urls_size; i++) {
+		LM_DBG("initializing db[%d] [%s]\n", i,
+				ph_framework_data->ph_db_urls[i].db_url.s);
+		if(init_http_db(ph_framework_data, i) != 0) {
+			LM_ERR("failed to initialize the DB support\n");
 			return -1;
-		for(i=0;i<ph_framework_data->ph_db_urls_size;i++){
-			LM_DBG("initializing db[%d] [%s]\n",
-				i, ph_framework_data->ph_db_urls[i].db_url.s);
-			if (init_http_db(ph_framework_data, i)!=0) {
-				LM_ERR("failed to initialize the DB support\n");
-				return -1;
-			}
-			if (connect_http_db(ph_framework_data, i)) {
-				LM_ERR("failed to connect to database\n");
-				return -1;
-			}
 		}
+		if(connect_http_db(ph_framework_data, i)) {
+			LM_ERR("failed to connect to database\n");
+			return -1;
+		}
+	}
 
 	/* Build async lock */
-	if (ph_init_async_lock() != 0) return -1;
+	if(ph_init_async_lock() != 0)
+		return -1;
 
 	return 0;
 }
@@ -307,7 +301,7 @@ void destroy(void)
 }
 
 
-static int ki_xhttp_pi_dispatch(sip_msg_t* msg)
+static int ki_xhttp_pi_dispatch(sip_msg_t *msg)
 {
 	str arg = {NULL, 0};
 	int ret = 0;
@@ -319,33 +313,39 @@ static int ki_xhttp_pi_dispatch(sip_msg_t* msg)
 	}
 
 	/* Init xhttp_pi context */
-	if (ctx.reply.buf.s) LM_ERR("Unexpected buf value [%p][%d]\n",
-				ctx.reply.buf.s, ctx.reply.buf.len);
+	if(ctx.reply.buf.s)
+		LM_ERR("Unexpected buf value [%p][%d]\n", ctx.reply.buf.s,
+				ctx.reply.buf.len);
 	memset(&ctx, 0, sizeof(pi_ctx_t));
 	ctx.msg = msg;
 	ctx.mod = ctx.cmd = -1;
-	if (init_xhttp_pi_reply(&ctx) < 0) goto send_reply;
+	if(init_xhttp_pi_reply(&ctx) < 0)
+		goto send_reply;
 
 	lock_get(ph_lock);
-	LM_DBG("ph_framework_data: [%p]->[%p]\n", &ph_framework_data, ph_framework_data);
+	LM_DBG("ph_framework_data: [%p]->[%p]\n", &ph_framework_data,
+			ph_framework_data);
 	/* Extract arguments from url */
-	if (0!=ph_parse_url(&msg->first_line.u.request.uri,
-				&ctx.mod, &ctx.cmd, &arg)){
+	if(0
+			!= ph_parse_url(
+					&msg->first_line.u.request.uri, &ctx.mod, &ctx.cmd, &arg)) {
 		pi_fault(&ctx, 500, "Bad URL");
 		goto send_reply;
 	}
 
-	if (arg.s) {
-		if (arg.len) {
+	if(arg.s) {
+		if(arg.len) {
 			/* Unescape args */
-			ctx.arg.s = pkg_malloc((arg.len)*sizeof(char));
-			if (ctx.arg.s==NULL){
+			ctx.arg.s = pkg_malloc((arg.len) * sizeof(char));
+			if(ctx.arg.s == NULL) {
 				PKG_MEM_ERROR;
 				pi_fault(&ctx, 500, "Internal Server Error (oom)");
 				goto send_reply;
 			}
-			for(i=0;i<arg.len;i++) if (arg.s[i]=='+') arg.s[i]=' ';
-			if (0>un_escape(&arg, &ctx.arg)) {
+			for(i = 0; i < arg.len; i++)
+				if(arg.s[i] == '+')
+					arg.s[i] = ' ';
+			if(0 > un_escape(&arg, &ctx.arg)) {
 				LM_ERR("unable to escape [%.*s]\n", arg.len, arg.s);
 				pi_fault(&ctx, 500, "Bad arg in URL");
 				goto send_reply;
@@ -356,31 +356,32 @@ static int ki_xhttp_pi_dispatch(sip_msg_t* msg)
 		LM_DBG("Got no arg\n");
 		goto send_reply;
 	}
-	
+
 send_reply:
-	LM_DBG("ph_framework_data: [%p]->[%p]\n", &ph_framework_data, ph_framework_data);
+	LM_DBG("ph_framework_data: [%p]->[%p]\n", &ph_framework_data,
+			ph_framework_data);
 	lock_release(ph_lock);
-	if (!ctx.reply_sent) {
+	if(!ctx.reply_sent) {
 		ret = pi_send(&ctx);
 	}
-	if (ret < 0) return -1;
+	if(ret < 0)
+		return -1;
 	return 0;
 }
 
-static int xhttp_pi_dispatch(sip_msg_t* msg, char* s1, char* s2)
+static int xhttp_pi_dispatch(sip_msg_t *msg, char *s1, char *s2)
 {
 	return ki_xhttp_pi_dispatch(msg);
 }
 
 /* rpc function documentation */
-static const char *rpc_reload_doc[2] = {
-	"Reload the xml framework", 0
-};
+static const char *rpc_reload_doc[2] = {"Reload the xml framework", 0};
 
 /* rpc function implementations */
-static void rpc_reload(rpc_t *rpc, void *c) {
+static void rpc_reload(rpc_t *rpc, void *c)
+{
 	lock_get(ph_lock);
-	if (0!=ph_init_cmds(&ph_framework_data, filename.s)) {
+	if(0 != ph_init_cmds(&ph_framework_data, filename.s)) {
 		rpc->rpl_printf(c, "Reload failed");
 	} else {
 		rpc->rpl_printf(c, "Reload OK");
@@ -390,9 +391,7 @@ static void rpc_reload(rpc_t *rpc, void *c) {
 }
 
 static rpc_export_t rpc_methods[] = {
-	{"xhttp_pi.reload", rpc_reload, rpc_reload_doc, 0},
-	{0, 0, 0, 0}
-};
+		{"xhttp_pi.reload", rpc_reload, rpc_reload_doc, 0}, {0, 0, 0, 0}};
 
 /**
  *

+ 11 - 11
src/modules/xhttp_pi/xhttp_pi.h

@@ -37,15 +37,15 @@
 #define PRINT_VALUE_BUF_LEN 256
 
 
-
 /** Representation of the xhttp_pi reply being constructed.
  *
  * This data structure describes the xhttp_pi reply that is being constructed
  * and will be sent to the client.
  */
-struct xhttp_pi_reply {
+struct xhttp_pi_reply
+{
 	int code;	/**< Reply code which indicates the type of the reply */
-	str reason;	/**< Reason phrase text which provides human-readable
+	str reason; /**< Reason phrase text which provides human-readable
 			 * description that augments the reply code */
 	str body;	/**< The xhttp_pi http body built so far */
 	str buf;	/**< The memory buffer allocated for the reply, this is
@@ -61,16 +61,16 @@ struct xhttp_pi_reply {
  *
  * There is always one context per xhttp_pi request.
  */
-typedef struct pi_ctx {
-	sip_msg_t* msg;			/**< The SIP/HTTP received message. */
-	struct xhttp_pi_reply reply;	/**< xhttp_pi reply to be sent to the client */
+typedef struct pi_ctx
+{
+	sip_msg_t *msg;				 /**< The SIP/HTTP received message. */
+	struct xhttp_pi_reply reply; /**< xhttp_pi reply to be sent to the client */
 	int reply_sent;
-	int mod;			/**< Module being processed */
-	int cmd;			/**< PI command being processed */
-	int arg_received;		/**< PI argument flag */
-	str arg;			/**< PI command argument */
+	int mod;		  /**< Module being processed */
+	int cmd;		  /**< PI command being processed */
+	int arg_received; /**< PI argument flag */
+	str arg;		  /**< PI command argument */
 } pi_ctx_t;
 
 
 #endif
-

File diff suppressed because it is too large
+ 575 - 478
src/modules/xhttp_pi/xhttp_pi_fnc.c


+ 73 - 67
src/modules/xhttp_pi/xhttp_pi_fnc.h

@@ -33,87 +33,93 @@
 #include "xhttp_pi.h"
 
 /**< no validation required */
-#define PH_FLAG_NONE        0
+#define PH_FLAG_NONE 0
 /**< validate as socket: [proto:]host[:port] */
-#define PH_FLAG_P_HOST_PORT (1<<0)
+#define PH_FLAG_P_HOST_PORT (1 << 0)
 /**< validate as socket: [proto:]IPv4[:port] */
-#define PH_FLAG_P_IPV4_PORT (1<<1)
+#define PH_FLAG_P_IPV4_PORT (1 << 1)
 /**< validate as IPv4 */
-#define PH_FLAG_IPV4        (1<<2)
+#define PH_FLAG_IPV4 (1 << 2)
 /**< validate as SIP URI */
-#define PH_FLAG_URI     (1<<3)
+#define PH_FLAG_URI (1 << 3)
 /**< validate as SIP URI w/ IPv4 host */
-#define PH_FLAG_URI_IPV4HOST    (1<<4)
+#define PH_FLAG_URI_IPV4HOST (1 << 4)
 
 typedef short int ph_val_flags;
 
-typedef struct ph_db_url_ {
-    str id;
-    str db_url;
-    db1_con_t *http_db_handle;
-    db_func_t http_dbf;
-}ph_db_url_t;
-
-typedef struct ph_table_col_ {
-    str field;
-    db_type_t type;
-    ph_val_flags validation;
-}ph_table_col_t;
-typedef struct ph_db_table_ {
-    str id;
-    str name;
-    ph_db_url_t *db_url;
-    ph_table_col_t *cols;
-    int cols_size;
-}ph_db_table_t;
-
-typedef struct ph_vals_ {
-    str *ids;  /* String to display for the given value */
-    str *vals; /* prepopulated value for a specific field */
-    int vals_size;
-}ph_vals_t;
-
-typedef struct ph_cmd_ {
-    str name;
-    unsigned int type;
-    ph_db_table_t *db_table;
-    db_op_t *c_ops;
-    db_key_t *c_keys;
-    db_type_t *c_types;
-    ph_vals_t *c_vals; /* array of prepopulated values */
-    int c_keys_size;
-    db_key_t *q_keys;
-    db_type_t *q_types;
-    ph_vals_t *q_vals; /* array of prepopulated values */
-	str *link_cmd;     /* cmd to be executed for query links */
-    int q_keys_size;
-    db_key_t *o_keys;
-    int o_keys_size;
-}ph_cmd_t;
-
-typedef struct ph_mod_ {
-    str module;
-    ph_cmd_t *cmds;
-    int cmds_size;
-}ph_mod_t;
-
-typedef struct ph_framework_ {
-    ph_db_url_t *ph_db_urls;
-    int ph_db_urls_size;
-    ph_db_table_t *ph_db_tables;
-    int ph_db_tables_size;
-    ph_mod_t *ph_modules;
-    int ph_modules_size;
-}ph_framework_t;
+typedef struct ph_db_url_
+{
+	str id;
+	str db_url;
+	db1_con_t *http_db_handle;
+	db_func_t http_dbf;
+} ph_db_url_t;
+
+typedef struct ph_table_col_
+{
+	str field;
+	db_type_t type;
+	ph_val_flags validation;
+} ph_table_col_t;
+typedef struct ph_db_table_
+{
+	str id;
+	str name;
+	ph_db_url_t *db_url;
+	ph_table_col_t *cols;
+	int cols_size;
+} ph_db_table_t;
+
+typedef struct ph_vals_
+{
+	str *ids;  /* String to display for the given value */
+	str *vals; /* prepopulated value for a specific field */
+	int vals_size;
+} ph_vals_t;
+
+typedef struct ph_cmd_
+{
+	str name;
+	unsigned int type;
+	ph_db_table_t *db_table;
+	db_op_t *c_ops;
+	db_key_t *c_keys;
+	db_type_t *c_types;
+	ph_vals_t *c_vals; /* array of prepopulated values */
+	int c_keys_size;
+	db_key_t *q_keys;
+	db_type_t *q_types;
+	ph_vals_t *q_vals; /* array of prepopulated values */
+	str *link_cmd;	   /* cmd to be executed for query links */
+	int q_keys_size;
+	db_key_t *o_keys;
+	int o_keys_size;
+} ph_cmd_t;
+
+typedef struct ph_mod_
+{
+	str module;
+	ph_cmd_t *cmds;
+	int cmds_size;
+} ph_mod_t;
+
+typedef struct ph_framework_
+{
+	ph_db_url_t *ph_db_urls;
+	int ph_db_urls_size;
+	ph_db_table_t *ph_db_tables;
+	int ph_db_tables_size;
+	ph_mod_t *ph_modules;
+	int ph_modules_size;
+} ph_framework_t;
 
 
 int ph_init_async_lock(void);
 void ph_destroy_async_lock(void);
 
-int ph_init_cmds(ph_framework_t **framework_data, const char* filename);
-int ph_parse_url(const str* url_str, int* mod, int* cmd, str* arg);
+int ph_init_cmds(ph_framework_t **framework_data, const char *filename);
+int ph_parse_url(const str *url_str, int *mod, int *cmd, str *arg);
 int ph_run_pi_cmd(pi_ctx_t *ctx);
 
 
 #endif
-

Some files were not shown because too many files changed in this diff