File:  [ELWIX - Embedded LightWeight unIX -] / mqtt / inc / Attic / dbmqtt.h
Revision 1.1.2.2: download - view: text, annotated - select for diffs - revision graph
Wed Nov 23 00:42:16 2011 UTC (12 years, 11 months ago) by misho
Branches: mqtt1_0
add many code
- db* funcs
- rtlm handling
- new files

#ifndef __DBMQTT_H
#define __DBMQTT_H


/*
 * mqtt_db_open() Open database connection
 *
 * @csCfgName = config filename
 * @modtype = RTL module type, 0== mqtt_acc or !=0 mqtt_pub
 * return: NULL error or SQL handle
 */
sqlite3 *mqtt_db_open(sl_config *cfg, int modtype);
/*
 * mqtt_db_close() Close database connection
 *
 * @sql = SQL handle
 * return: none
 */
void mqtt_db_close(sqlite3 *sql);
/*
 * mqtt_db_log() Log database connection message
 *
 * @fmt = format string
 * @... = argument list
 * return: none
 */
void mqtt_db_log(const char *fmt, ...);
#define MQTT_DB_LOG(_sql)	(assert((_sql)), mqtt_db_log("Error:: SQL #%d - %s", \
					sqlite3_errcode((_sql)), sqlite3_errmsg((_sql))))


#endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>