The qDecoder Project

[svn] / trunk / src / qDecoder.h

Parent Directory Parent Directory Revision Log Revision Log


Revision 314 - Download Blame
Tue Oct 7 07:15:57 2008 UTC (19 months, 3 weeks ago) by wolkykim
File size: 18409 byte(s)
Adding some comments
    1 /**************************************************************************
    2  * qDecoder - Web Application Interface for C/C++   
    3  *
    4  * Copyright (C) 2007 Seung-young Kim.
    5  *
    6  * This program is free software: you can redistribute it and/or modify
    7  * it under the terms of the GNU Lesser General Public License as published
    8  * by the Free Software Foundation, either version 3 of the License, or
    9  * (at your option) any later version.
   10  *
   11  * This program is distributed in the hope that it will be useful,
   12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14  * GNU Lesser General Public License for more details.
   15  *
   16  * You should have received a copy of the GNU Lesser General Public License
   17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   18  *************************************************************************/
   19 
   20 /**
   21  * qDecoder Header file
   22  *
   23  * @file qDecoder.h
   24  */
   25 
   26 #ifndef _QDECODER_H
   27 #define _QDECODER_H
   28 
   29 #include <stdio.h>
   30 #include <stdbool.h>
   31 #include <time.h>
   32 #include <sys/types.h>
   33 
   34 /**
   35  * Base Structures used for Internal
   36  */
   37 typedef struct Q_NLOBJ {
   38 	char *name;			/*!< key name */
   39 	void *object;			/*!< object data */
   40 	int  size;			/*!< object size */
   41 	struct Q_NLOBJ *next;		/*!< link pointer */
   42 } Q_NLOBJ;
   43 
   44 typedef struct {
   45 	void *object;			/*!< object data */
   46 	int  size;			/*!< object size */
   47 } Q_OBJ;
   48 
   49 /**
   50  * Structure for linked-list data structure.
   51  */
   52 typedef struct {
   53 	int num;			/*!< number of objects */
   54 	size_t size;			/*!< total size of objects */
   55 	Q_NLOBJ *first;			/*!< first object pointer */
   56 	Q_NLOBJ *last;			/*!< last object pointer */
   57 	Q_NLOBJ *next;			/*!< next object pointer used by only for qEntryFirst() and qEntryNext()*/
   58 	Q_NLOBJ *cont;			/*!< next object pointer used by qEntry*Next*() and member functions*/
   59 } Q_ENTRY;
   60 
   61 /**
   62  * Structure for hash-table data structure.
   63  */
   64 typedef struct {
   65 	int	max;			/*!< maximum hashtable size */
   66 	int	num;			/*!< used slot counter */
   67 
   68 	int	*count;			/*!< hash collision counter. 0 indicate empty slot, -1 is used for moved slot due to hash collision */
   69 	int	*hash;			/*!< key hash. we use qHashFnv32() to generate hash integer */
   70 	char	**key;			/*!< key string */
   71 	void	**value;		/*!< value */
   72 	int	*size;			/*!< value size */
   73 } Q_HASHTBL;
   74 
   75 /**
   76  * Structure for hash-table data structure based on array.
   77  */
   78 #define _Q_HASHARR_MAX_KEYSIZE		(31+1)
   79 #define _Q_HASHARR_DEF_VALUESIZE	(32)
   80 
   81 typedef struct {
   82 	int	count;					/*!< hash collision counter. 0 indicates empty slot, -1 is used for moved slot due to hash collision, -2 is used for indicating linked block */
   83 	int	hash;					/*!< key hash. we use qFnv32Hash() to generate hash integer */
   84 
   85 	char	key[_Q_HASHARR_MAX_KEYSIZE];		/*!< key string, it can be truncated */
   86 	int	keylen;					/*!< original key length */
   87 	unsigned char keymd5[16];			/*!< md5 hash of the key */
   88 
   89 	unsigned char value[_Q_HASHARR_DEF_VALUESIZE];	/*!< value */
   90 	int	size;					/*!< value size */
   91 	int	link;					/*!< next index of the value. */
   92 } Q_HASHARR;
   93 
   94 /**
   95  * Structure for array-based circular-queue data structure.
   96  */
   97 typedef struct {
   98 	int	max;		// maximum queue slots
   99 	int	used;		// used queue slots
  100 
  101 	int	head;		// head pointer
  102 	int	tail;		// tail pointer
  103 
  104 	size_t	objsize;	// object size
  105 	void	*objarr;	// external queue data memory pointer
  106 } Q_QUEUE;
  107 
  108 /**
  109  * Structure for obstack data structure.
  110  */
  111 typedef struct {
  112 	Q_ENTRY *stack;			/*!< first object pointer */
  113 	void	*final;			/*!< final object pointer */
  114 } Q_OBSTACK;
  115 
  116 /**
  117  * Structure for file log.
  118  */
  119 typedef struct {
  120 	char	logbase[1024];		/*!< directory which log file is located  */
  121 	char	nameformat[256];	/*!< file naming format like qdecoder-%Y%m%d.log */
  122 
  123 	char	filename[256];		/*!< generated filename according to the name format */
  124 	char	logpath[1024];		/*!< generated system path of log file */
  125 	FILE	*fp;			/*!< file pointer of logpath */
  126 
  127 	bool	console;		/*!< flag for console print out */
  128 	int	rotateinterval;		/*!< log file will be rotate in this interval seconds */
  129 	int	nextrotate;		/*!< next rotate universal time, seconds */
  130 	bool	flush;			/*!< flag for immediate sync */
  131 } Q_LOG;
  132 
  133 /* Database Support*/
  134 #ifdef _mysql_h
  135 #define _Q_ENABLE_MYSQL				(1)
  136 // mysql specific connector option
  137 #define _Q_MYSQL_OPT_RECONNECT			(1)
  138 #define _Q_MYSQL_OPT_CONNECT_TIMEOUT		(10)
  139 #define _Q_MYSQL_OPT_READ_TIMEOUT		(30)
  140 #define _Q_MYSQL_OPT_WRITE_TIMEOUT		(30)
  141 #endif
  142 
  143 /**
  144  * Structure for independent database interface.
  145  */
  146 typedef struct {
  147 	bool connected;			/*!< if opened true, if closed false */
  148 
  149 	struct {
  150 		char*	dbtype;
  151 		char*	addr;
  152 		int	port;
  153 		char*	username;
  154 		char*	password;
  155 		char*	database;
  156 		bool	autocommit;
  157 		bool	fetchtype;
  158 	} info;				/*!< database connection infomation */
  159 
  160 	// for mysql database
  161 #ifdef _Q_ENABLE_MYSQL
  162 	MYSQL		*mysql;
  163 #endif
  164 } Q_DB;
  165 
  166 /**
  167  * Structure for database result set.
  168  */
  169 typedef struct {
  170 #ifdef _Q_ENABLE_MYSQL
  171 	bool		fetchtype;
  172 	MYSQL_RES	*rs;
  173 	MYSQL_FIELD	*fields;
  174 	MYSQL_ROW	row;
  175 	int		cols;
  176 	int		cursor;
  177 #endif
  178 } Q_DBRESULT;
  179 
  180 #ifndef _DOXYGEN_SKIP
  181 
  182 /* qDecoder C++ support */
  183 #ifdef __cplusplus
  184 extern "C" {
  185 #endif
  186 
  187 /*
  188  * qCgiRequest.c
  189  */
  190 extern	Q_ENTRY*	qCgiRequestParseOption(Q_ENTRY *request, bool filemode, const char *basepath, int clearold);
  191 extern	Q_ENTRY*	qCgiRequestParse(Q_ENTRY *request);
  192 extern	Q_ENTRY*	qCgiRequestParseQueries(Q_ENTRY *request, const char *method);
  193 extern	Q_ENTRY*	qCgiRequestParseCookies(Q_ENTRY *request);
  194 extern	char*		qCgiRequestGetQueryString(const char *query_type);
  195 
  196 /*
  197  * qCgiResponse.c
  198  */
  199 extern	bool		qCgiResponseSetCookie(Q_ENTRY *request, const char *name, const char *value, int exp_days, const char *path, const char *domain, bool secure);
  200 extern	bool		qCgiResponseRemoveCookie(Q_ENTRY *request, const char *name, const char *path, const char *domain, bool secure);
  201 
  202 extern	bool		qCgiResponseSetContentType(Q_ENTRY *request, const char *mimetype);
  203 extern	const char*	qCgiResponseGetContentType(Q_ENTRY *request);
  204 extern	bool		qCgiResponseRedirect(Q_ENTRY *request, const char *uri);
  205 extern	int		qCgiResponseDownload(Q_ENTRY *request, const char *filepath, const char *mimetype);
  206 extern	void		qCgiResponseError(Q_ENTRY *request, char *format, ...);
  207 
  208 /*
  209  * qSession.c
  210  */
  211 extern	Q_ENTRY*	qSessionInit(Q_ENTRY *request, const char *dirpath);
  212 extern	bool		qSessionSetTimeout(Q_ENTRY *session, time_t seconds);
  213 extern	const char*	qSessionGetId(Q_ENTRY *session);
  214 extern	time_t		qSessionGetCreated(Q_ENTRY *session);
  215 extern	bool		qSessionSave(Q_ENTRY *session);
  216 extern	bool		qSessionDestroy(Q_ENTRY *session);
  217 
  218 /*
  219  * qHtml.c
  220  */
  221 extern	bool		qHtmlPrintf(FILE *stream, int mode, const char *format, ...);
  222 extern	bool		qHtmlPuts(FILE *stream, int mode, char *buf);
  223 extern	bool		qHtmlIsEmail(const char *email);
  224 extern	bool		qHtmlIsUrl(const char *url);
  225 
  226 /*
  227  * qSocket.c
  228  */
  229 extern	int		qSocketOpen(const char *hostname, int port);
  230 extern	bool		qSocketClose(int sockfd);
  231 extern	int		qSocketWaitReadable(int sockfd, int timeoutms);
  232 extern	int		qSocketWaitWritable(int sockfd, int timeoutms);
  233 extern	ssize_t		qSocketRead(void *binary, int sockfd, size_t nbytes, int timeoutms);
  234 extern	ssize_t		qSocketGets(char *str, int sockfd, size_t nbytes, int timeoutms);
  235 extern	ssize_t		qSocketWrite(int sockfd, const void *binary, size_t nbytes);
  236 extern	ssize_t		qSocketPuts(int sockfd, const char *str);
  237 extern	ssize_t		qSocketPrintf(int sockfd, const char *format, ...);
  238 extern	ssize_t		qSocketSendfile(int sockfd, const char *filepath, off_t offset, size_t nbytes);
  239 extern	ssize_t		qSocketSaveIntoFile(int outfd, int sockfd, size_t nbytes, int timeoutms);
  240 extern	ssize_t		qSocketSaveIntoMemory(char *mem, int sockfd, size_t nbytes, int timeoutms);
  241 
  242 /*
  243  * qSem.c
  244  */
  245 extern	int		qSemInit(const char *keyfile, int keyid, int nsems, bool ifexistdestroy);
  246 extern	int		qSemGetId(const char *keyfile, int keyid);
  247 extern	bool		qSemEnter(int semid, int semno);
  248 extern	bool		qSemEnterNowait(int semid, int semno);
  249 extern	bool		qSemEnterForce(int semid, int semno, int maxwaitms, bool *forceflag);
  250 extern	bool		qSemLeave(int semid, int semno);
  251 extern	bool		qSemCheck(int semid, int semno);
  252 extern	bool		qSemFree(int semid);
  253 
  254 /*
  255  * qShm.c
  256  */
  257 extern	int		qShmInit(const char *keyfile, int keyid, size_t size, bool ifexistdestroy);
  258 extern	int		qShmGetId(const char *keyfile, int keyid);
  259 extern	void*		qShmGet(int shmid);
  260 extern	bool		qShmFree(int shmid);
  261 
  262 /*
  263  * qDatabase.c
  264  */
  265 extern	Q_DB*		qDbInit(const char *dbtype, const char *addr, int port, const char *database, const char *username, const char *password, bool autocommit);
  266 extern	bool		qDbOpen(Q_DB *db);
  267 extern	bool		qDbClose(Q_DB *db);
  268 extern	bool		qDbFree(Q_DB *db);
  269 extern	const char*	qDbGetError(Q_DB *db, unsigned int *errorno);
  270 extern	bool		qDbPing(Q_DB *db);
  271 extern	bool		qDbGetLastConnStatus(Q_DB *db);
  272 extern	bool		qDbSetFetchType(Q_DB *db, bool use);
  273 
  274 extern	int		qDbExecuteUpdate(Q_DB *db, const char *query);
  275 extern	int		qDbExecuteUpdatef(Q_DB *db, const char *format, ...);
  276 
  277 extern	Q_DBRESULT*	qDbExecuteQuery(Q_DB *db, const char *query);
  278 extern	Q_DBRESULT*	qDbExecuteQueryf(Q_DB *db, const char *format, ...);
  279 extern	bool		qDbResultNext(Q_DBRESULT *result);
  280 extern	bool		qDbResultFree(Q_DBRESULT *result);
  281 
  282 extern	int     	qDbGetCols(Q_DBRESULT *result);
  283 extern	int     	qDbGetRows(Q_DBRESULT *result);
  284 extern	int     	qDbGetRow(Q_DBRESULT *result);
  285 
  286 extern	const char*	qDbGetStr(Q_DBRESULT *result, const char *field);
  287 extern	const char*	qDbGetStrAt(Q_DBRESULT *result, int idx);
  288 extern	int		qDbGetInt(Q_DBRESULT *result, const char *field);
  289 extern	int		qDbGetIntAt(Q_DBRESULT *result, int idx);
  290 
  291 extern	bool		qDbBeginTran(Q_DB *db);
  292 extern	bool		qDbEndTran(Q_DB *db, bool commit);
  293 extern	bool		qDbCommit(Q_DB *db);
  294 extern	bool		qDbRollback(Q_DB *db);
  295 
  296 /*
  297  * qEntry.c
  298  */
  299 extern	Q_ENTRY*	qEntryInit(void);
  300 extern	const Q_NLOBJ*	qEntryFirst(Q_ENTRY *entry);
  301 extern	const Q_NLOBJ*	qEntryNext(Q_ENTRY *entry);
  302 extern	int		qEntryRemove(Q_ENTRY *entry, const char *name);
  303 extern	bool		qEntryPut(Q_ENTRY *entry, const char *name, const void *object, int size, bool update);
  304 extern	bool		qEntryPutStr(Q_ENTRY *entry, const char *name, const char *str, bool update);
  305 extern	bool		qEntryPutStrf(Q_ENTRY *entry, const char *name, bool update, char *format, ...);
  306 extern	bool		qEntryPutInt(Q_ENTRY *entry, const char *name, int num, bool update);
  307 extern	const void*	qEntryGet(Q_ENTRY *entry, const char *name, int *size);
  308 extern	const void*	qEntryGetCase(Q_ENTRY *entry, const char *name, int *size);
  309 extern	const void*	qEntryGetNext(Q_ENTRY *entry, const char *name, int *size);
  310 extern	const void*	qEntryGetNextCase(Q_ENTRY *entry, const char *name, int *size);
  311 extern	const void*	qEntryGetLast(Q_ENTRY *entry, const char *name, int *size);
  312 extern	const char*	qEntryGetStr(Q_ENTRY *entry, const char *name);
  313 extern	const char*	qEntryGetStrCase(Q_ENTRY *entry, const char *name);
  314 extern	const char*	qEntryGetStrf(Q_ENTRY *entry, char *format, ...);
  315 extern	const char*	qEntryGetStrNext(Q_ENTRY *entry, const char *name);
  316 extern	const char*	qEntryGetStrNextCase(Q_ENTRY *entry, const char *name);
  317 extern	const char*	qEntryGetStrLast(Q_ENTRY *entry, const char *name);
  318 extern	int		qEntryGetInt(Q_ENTRY *entry, const char *name);
  319 extern	int		qEntryGetIntCase(Q_ENTRY *entry, const char *name);
  320 extern	int		qEntryGetIntf(Q_ENTRY *entry, char *format, ...);
  321 extern	int		qEntryGetIntNext(Q_ENTRY *entry, const char *name);
  322 extern	int		qEntryGetIntNextCase(Q_ENTRY *entry, const char *name);
  323 extern	int 		qEntryGetIntLast(Q_ENTRY *entry, const char *name);
  324 extern	int 		qEntryGetNum(Q_ENTRY *entry);
  325 extern	int		qEntryGetNo(Q_ENTRY *entry, const char *name);
  326 extern	bool		qEntryReverse(Q_ENTRY *entry);
  327 extern	bool		qEntryPrint(Q_ENTRY *entry, FILE *out, bool print_object);
  328 extern	bool		qEntryFree(Q_ENTRY *entry);
  329 extern	bool		qEntrySave(Q_ENTRY *entry, const char *filepath, char sepchar, bool encode);
  330 extern	int		qEntryLoad(Q_ENTRY *entry, const char *filepath, char sepchar, bool decode);
  331 
  332 /*
  333  * qHashtbl.c
  334  */
  335 extern	Q_HASHTBL*	qHashtblInit(int max);
  336 extern	bool		qHashtblFree(Q_HASHTBL *tbl);
  337 extern	bool		qHashtblPut(Q_HASHTBL *tbl, const char *key, const void *value, int size);
  338 extern	bool		qHashtblPutStr(Q_HASHTBL *tbl, const char *key, const char *value);
  339 extern	bool		qHashtblPutInt(Q_HASHTBL *tbl, const char *key, int value);
  340 extern	void*		qHashtblGet(Q_HASHTBL *tbl, const char *key, int *size);
  341 extern	char*		qHashtblGetStr(Q_HASHTBL *tbl, const char *key);
  342 extern	int		qHashtblGetInt(Q_HASHTBL *tbl, const char *key);
  343 extern	const char*	qHashtblGetFirstKey(Q_HASHTBL *tbl, int *idx);
  344 extern	const char*	qHashtblGetNextKey(Q_HASHTBL *tbl, int *idx);
  345 extern	bool		qHashtblRemove(Q_HASHTBL *tbl, const char *key);
  346 extern	bool		qHashtblPrint(Q_HASHTBL *tbl, FILE *out, bool showvalue);
  347 extern	bool		qHashtblStatus(Q_HASHTBL *tbl, int *used, int *max);
  348 
  349 /*
  350  * qHasharr.c
  351  */
  352 extern	size_t		qHasharrSize(int max);
  353 extern	int		qHasharrInit(Q_HASHARR *tbl, size_t memsize);
  354 extern	bool		qHasharrClear(Q_HASHARR *tbl);
  355 extern	bool		qHasharrPut(Q_HASHARR *tbl, const char *key, const void *value, int size);
  356 extern	bool		qHasharrPutStr(Q_HASHARR *tbl, const char *key, const char *value);
  357 extern	bool		qHasharrPutInt(Q_HASHARR *tbl, const char *key, int value);
  358 extern	void*		qHasharrGet(Q_HASHARR *tbl, const char *key, int *size);
  359 extern	char*		qHasharrGetStr(Q_HASHARR *tbl, const char *key);
  360 extern	int		qHasharrGetInt(Q_HASHARR *tbl, const char *key);
  361 extern	const char*	qHasharrGetFirstKey(Q_HASHARR *tbl, int *idx);
  362 extern	const char*	qHasharrGetNextKey(Q_HASHARR *tbl, int *idx);
  363 extern	bool		qHasharrRemove(Q_HASHARR *tbl, const char *key);
  364 extern	bool		qHasharrPrint(Q_HASHARR *tbl, FILE *out);
  365 extern	bool		qHasharrStatus(Q_HASHARR *tbl, int *used, int *max);
  366 
  367 /*
  368  * qQueue.c
  369  */
  370 extern	size_t		qQueueSize(int max, size_t objsize);
  371 extern	int		qQueueInit(Q_QUEUE *queue, void* datamem, size_t datamemsize, size_t objsize);
  372 extern	bool		qQueueClear(Q_QUEUE *queue);
  373 extern	bool		qQueuePush(Q_QUEUE *queue, const void *object);
  374 extern	bool		qQueuePopFirst(Q_QUEUE *queue, void *object);
  375 extern	bool		qQueuePopLast(Q_QUEUE *queue, void *object);
  376 extern	bool		qQueueStatus(Q_QUEUE *queue, int *used, int *max);
  377 
  378 /*
  379  * qObstack.c
  380  */
  381 extern	Q_OBSTACK*	qObstackInit(void);
  382 extern	bool		qObstackGrow(Q_OBSTACK *obstack, const void *object, size_t size);
  383 extern	bool		qObstackGrowStr(Q_OBSTACK *obstack, const char *str);
  384 extern	bool		qObstackGrowStrf(Q_OBSTACK *obstack, const char *format, ...);
  385 extern	void*		qObstackFinish(Q_OBSTACK *obstack);
  386 extern	void*		qObstackGetFinal(Q_OBSTACK *obstack);
  387 extern	size_t		qObstackGetSize(Q_OBSTACK *obstack);
  388 extern	int		qObstackGetNum(Q_OBSTACK *obstack);
  389 extern	bool		qObstackFree(Q_OBSTACK *obstack);
  390 
  391 /*
  392  * qConfig.c
  393  */
  394 extern	Q_ENTRY*	qConfigParseFile(Q_ENTRY *config, const char *filepath, char sepchar);
  395 extern	Q_ENTRY*	qConfigParseStr(Q_ENTRY *config, const char *str, char sepchar);
  396 
  397 /*
  398  * qLog.c
  399  */
  400 extern	Q_LOG*		qLogOpen(const char *logbase, const char *filenameformat, int rotateinterval, bool flush);
  401 extern	bool		qLogClose(Q_LOG *log);
  402 extern	bool		qLogSetConsole(Q_LOG *log, bool consoleout);
  403 extern	bool		qLogFlush(Q_LOG *log);
  404 extern	bool		qLog(Q_LOG *log, const char *format, ...);
  405 
  406 /*
  407  * qString.c
  408  */
  409 extern	char*		qStrTrim(char *str);
  410 extern	char*		qStrTrimTail(char *str);
  411 extern	char*		qStrReplace(const char *mode, char *srcstr, const char *tokstr, const char *word);
  412 extern	char*		qStrCpy(char *dst, size_t dstsize, const char *src, size_t nbytes);
  413 extern	char*		qStrUpper(char *str);
  414 extern	char*		qStrLower(char *str);
  415 extern	char*		qStrCaseStr(const char *s1, const char *s2);
  416 extern	char*		qStrRev(char *str);
  417 extern	char*		qStrTok(char *str, const char *token, char *retstop);
  418 extern	Q_ENTRY*	qStrTokenizer(char *str, const char *delimiters);
  419 extern	char*		qStrCommaNumber(int number);
  420 extern	char*		qStrCatf(char *str, const char *format, ...);
  421 extern	char*		qStrDupBetween(const char *str, const char *start, const char *end);
  422 extern	char*		qStrUnique(const char *seed);
  423 extern	bool		qStrIsAlnum(const char *str);
  424 extern	char*		qStrConvEncoding(const char *fromstr, const char *fromcode, const char *tocode, float mag);
  425 
  426 /*
  427  * qFile.c
  428  */
  429 extern	bool		qFileLock(int fd);
  430 extern	bool		qFileUnlock(int fd);
  431 extern	bool		qFileExist(const char *filepath);
  432 extern	char*		qFileGetName(const char *filepath);
  433 extern	char*		qFileGetDir(const char *filepath);
  434 extern	char*		qFileGetExt(const char *filepath);
  435 extern	off_t		qFileGetSize(const char *filepath);
  436 extern	ssize_t		qFileSend(int outfd, int infd, size_t nbytes);
  437 extern	void*		qFileLoad(const char *filepath, size_t *nbytes);
  438 extern	void*		qFileRead(FILE *fp, size_t *nbytes);
  439 extern	ssize_t		qFileSave(const char *filepath, const void *buf, size_t size, bool append);
  440 extern	char*		qFileReadLine(FILE *fp);
  441 
  442 /*
  443  * qEncode.c
  444  */
  445 extern	Q_ENTRY*	qDecodeQueryString(Q_ENTRY *entry, const char *query, char equalchar, char sepchar, int *count);
  446 extern	char*		qEncodeUrl(const char *str);
  447 extern	char*		qDecodeUrl(char *str);
  448 
  449 /*
  450  * qHash.c
  451  */
  452 extern	unsigned char*	qHashMd5(const void *data, size_t nbytes);
  453 extern	char*		qHashMd5Str(const void *data, size_t nbytes);
  454 extern	char*		qHashMd5File(const char *filepath, size_t *nbytes);
  455 extern	unsigned int	qHashFnv32(unsigned int max, const void *data, size_t nbytes);
  456 
  457 /*
  458  * qSed.c
  459  */
  460 extern	bool		qSedStr(Q_ENTRY *entry, const char *srcstr, FILE *fpout);
  461 extern	bool		qSedFile(Q_ENTRY *entry, const char *filepath, FILE *fpout);
  462 
  463 /*
  464  * qCount.c
  465  */
  466 extern	int		qCountRead(const char *filepath);
  467 extern	bool		qCountSave(const char *filepath, int number);
  468 extern	int		qCountUpdate(const char *filepath, int number);
  469 
  470 /*
  471  * qTime.c
  472  */
  473 extern	char*		qTimeGetLocalStrf(char *buf, int size, time_t utctime, const char *format);
  474 extern	char*		qTimeGetLocalStr(time_t utctime);
  475 extern	const char*	qTimeGetLocalStaticStr(time_t utctime);
  476 extern	char*		qTimeGetGmtStrf(char *buf, int size, time_t utctime, const char *format);
  477 extern	char*		qTimeGetGmtStr(time_t utctime);
  478 extern	const char*	qTimeGetGmtStaticStr(time_t utctime);
  479 extern	time_t		qTimeParseGmtStr(const char *gmtstr);
  480 
  481 /*
  482  * qSystem.c
  483  */
  484 extern	const char	*qSysGetEnv(const char *envname, const char *nullstr);
  485 extern	char		*qSysCmd(const char *cmd);
  486 
  487 #ifdef __cplusplus
  488 }
  489 #endif
  490 
  491 #endif /* _DOXYGEN_SKIP */
  492 
  493 #endif /*_QDECODER_H */

Home | About | Examples | Changes | Download | SVN Repository | Install | Reference