00001 /* 00002 * Copyright 2008 The qDecoder Project. All rights reserved. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions 00006 * are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY THE QDECODER PROJECT ``AS IS'' AND ANY 00015 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00016 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00017 * DISCLAIMED. IN NO EVENT SHALL THE QDECODER PROJECT BE LIABLE FOR ANY 00018 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00019 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00020 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00021 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00022 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00023 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 */ 00025 00026 #ifndef _QINTERNAL_H 00027 #define _QINTERNAL_H 00028 00029 #define QDECODER_PRIVATEKEY "qDecoder-by-Seungyoung_Kim" 00030 00031 #ifdef BUILD_DEBUG 00032 #define DEBUG(fmt, args...) fprintf(stderr, "[DEBUG] " fmt " (%s:%d)\n", ##args, __FILE__, __LINE__); 00033 #else 00034 #define DEBUG(fms, args...) 00035 #endif 00036 00037 /* 00038 * Internal Macros 00039 */ 00040 #define MAX_PATHLEN (1023+1) 00041 #define MAX_LINEBUF (1023+1) 00042 #define CONST_STRLEN(x) (sizeof(x) - 1) 00043 00044 /* 00045 * Internal Definitions 00046 */ 00047 #define DEF_DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) 00048 #define DEF_FILE_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) 00049 00050 /* 00051 * qInternalCommon.c 00052 */ 00053 extern char _q_x2c(char hex_up, char hex_low); 00054 extern char* _q_makeword(char *str, char stop); 00055 extern char* _q_fgets(char *str, int size, FILE *stream); 00056 extern ssize_t _q_writef(int fd, char *format, ...); 00057 extern ssize_t _q_write(int fd, const void *buf, size_t nbytes); 00058 extern int _q_unlink(const char *pathname); 00059 00060 /* 00061 * To prevent compiler warning 00062 */ 00063 extern char* strptime(const char *, const char *, struct tm *); 00064 00065 00066 #endif /* _QINTERNAL_H */