root/trunk/midgard/apis/php5/mgd_preparser.h

Revision 10559, 2.5 kB (checked in by piotras, 2 years ago)

Headers cleanup

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* $Id$
2 Copyright (C) 1999 Jukka Zitting <jukka.zitting@iki.fi>
3 Copyright (C) 2000 The Midgard Project ry
4 Copyright (C) 2000 Emile Heyns, Aurora SA <emile@iris-advies.com>
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 2 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 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #ifndef MGD_PREPARSER_H
22 #define MGD_PREPARSER_H
23 #include "php_midgard.h"
24
25 extern MGD_FUNCTION(ret_type, template, (type param));
26 extern MGD_FUNCTION(ret_type, snippet, (type param));
27 extern MGD_FUNCTION(ret_type, snippet_required, (type param));
28 extern MGD_FUNCTION(ret_type, ref, (type param));
29 extern MGD_FUNCTION(ret_type, eval, (type param));
30 extern MGD_FUNCTION(ret_type, is_element_loaded, (type param));
31
32 #if MIDGARD_142MOD
33
34 extern MGD_FUNCTION(ret_type, variable, (type param));
35
36 char * php_midgard_variable(midgard_pool * pool, char * name, char * member, char * type);
37 char * php_eval_midgard(midgard_pool * pool, const char *name, char *value, int exit_php);
38 int mgdparse(void);
39
40 extern GByteArray *mgd_output_buffer;
41 #define mgd_append_byte(buffer, str) if((*str) != '\0' )\
42             g_byte_array_append((buffer), (str), 1);
43 #define mgd_set_buffer(buffer, str) { \
44         (buffer) = g_byte_array_new(); \
45         if(strlen(str) > 0 ) { \
46                 g_byte_array_append((buffer), (str), strlen(str)); \
47         } \
48 }
49
50 #define mgd_free_buffer(buffer) {if(buffer) g_byte_array_free((buffer), TRUE);}
51 #define mgd_append_buffer(buffer, str) { if(str && strlen(str) > 0 )\
52             g_byte_array_append((buffer), (str), strlen(str)); }
53 #define mgd_append_output_buffer_const(str) { if(sizeof(str) > 0 )\
54             g_byte_array_append(mgd_output_buffer, (str), (sizeof(str) == 1) ? 1 : sizeof(str)-1 ); }
55 #define mgd_append_output_buffer(str) { if(str && strlen(str) > 0 )\
56             g_byte_array_append(mgd_output_buffer, (str), strlen(str)); }
57 #define mgd_append_output_buffer_data(gstr) { if(gstr && (gstr)->len > 0 )\
58             g_byte_array_append(mgd_output_buffer, (gstr)->data, (gstr)->len); }
59
60 #endif /* MIDGARD_142MOD */
61
62 //#define MGD_PREPARSER_LOG
63
64 #endif
Note: See TracBrowser for help on using the browser.