macros.h
00001 /* 00002 00003 This source file is part of Scol 00004 For the latest info, see http://www.scolring.org 00005 00006 Copyright (c) 2010 Stephane Bisaro, aka Iri <iri@irizone.net> 00007 00008 This source is under the terms of the Scol License. See the COPYING included file 00009 for more informations. 00010 00011 This program is distributed in the hope that it will be useful, but WITHOUT 00012 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00013 FOR A PARTICULAR PURPOSE. 00014 00015 For others informations, please contact us from http://www.scolring.org/ 00016 00017 */ 00018 00019 00020 /* 00021 // File: macros.h 00022 // Temporary macros (mostly used by debugger agent) 00023 // from F.J. Alberti 00024 */ 00025 00026 00027 #ifndef _MACROS_H_ 00028 #define _MACROS_H_ 00029 00030 #define SAFEdelete(p) { if (p) { free (p); (p) = NULL; } } 00031 00032 #define _SEPTRBIT 0x00000001 00033 00034 00035 /* SE conversions*/ 00036 #define SEW2I(w) ((w)>>1) 00037 #define SEW2P(w) ((w)>>1) 00038 #define SEI2W(n) ((n)<<1) 00039 #define SEP2W(p) ((p)<<1 | _SEPTRBIT) 00040 00041 #define MTOI( mot ) ((mot)>>1) 00042 #define MTOP( mot ) ((mot)>>1) 00043 #define ITOM( mot ) ((mot)<<1) 00044 #define PTOM( mot ) (((mot)<<1)+1) 00045 00046 /* Stack management*/ 00047 #define SEDROP(m, n) ((m)->pp += (n)) 00048 00049 /* String management*/ 00050 #define SEPUSHSTR(m, s) (Mpushstrbloc((m), (s))) 00051 00052 /* $Iri : convert any string to utf-8 (should be used with gtk ...) Don't forget to free after used !*/ 00053 #define SCOLUTF8(string) g_locale_to_utf8 (string, -1, NULL, NULL, NULL) 00054 /* $Iri : convert any string from utf-8 Don't forget to free after used !*/ 00055 #define UTF8SCOL(string) g_locale_from_utf8 (string, -1, NULL, NULL, NULL) 00056 00057 /* #define CHAR2WCHAR(c) (c == NIL ? NULL : (PtrObjWChar) MMstart (mm,((PtrObjVoid)MMstart(mm,c))->Buffer>>1))*/ 00058 00059 #endif
Generated on Tue Mar 15 13:59:36 2011 for sqlite3 by 1.6.3