b4ad332002-03-12Martin Stjernholm // -*- pike -*- //
0917d32013-03-04Anders Johansson // $Id$
b4ad332002-03-12Martin Stjernholm 
b1fca01996-11-12Per Hedbor #ifndef ROXEN_MODULE_H #define ROXEN_MODULE_H
55a8662000-11-20Per Hedbor /* #include "config.h" */ #include <roxen.h>
a1257f2000-07-09Per Hedbor // compat
2ed6c62003-09-01Henrik Grubbström (Grubba) // // NOTE: This used to be a valid lvalue. // In the few places where it was used as an lvalue, // use set("var", value).
a1257f2000-07-09Per Hedbor #define QUERY(var) query( #var )
b1fca01996-11-12Per Hedbor  // Like query, but for global variables.
cb9aab1999-03-27Henrik Grubbström (Grubba) #ifdef IN_ROXEN
a1257f2000-07-09Per Hedbor #define GLOBVAR(x) query( #x )
cb9aab1999-03-27Henrik Grubbström (Grubba) #else /* !IN_ROXEN */
a1257f2000-07-09Per Hedbor #define GLOBVAR(x) roxenp()->query(#x)
cb9aab1999-03-27Henrik Grubbström (Grubba) #endif /* IN_ROXEN */
b1fca01996-11-12Per Hedbor 
ffae402000-04-17Martin Nilsson #define TAGDOCUMENTATION mapping tagdocumentation(){return [mapping]get_value_from_file(__FILE__,"tagdoc","#define manual\n");}
d32cfe2000-03-28Martin Nilsson 
9317ce2008-09-15Jonas Wallden #define ROXEN_MAJOR_VERSION 5
7b669a2014-08-28Henrik Grubbström (Grubba) #define ROXEN_MINOR_VERSION 5
d32cfe2000-03-28Martin Nilsson 
4f4a962000-07-04Per Hedbor  #define TYPE_STRING 1 #define TYPE_FILE 2 #define TYPE_INT 3 #define TYPE_DIR 4 #define TYPE_STRING_LIST 5 #define TYPE_MULTIPLE_STRING 5 #define TYPE_INT_LIST 6 #define TYPE_MULTIPLE_INT 6 #define TYPE_FLAG 7 #define TYPE_TOGGLE 7 #define TYPE_DIR_LIST 9 #define TYPE_FILE_LIST 10 #define TYPE_LOCATION 11 #define TYPE_TEXT_FIELD 13 #define TYPE_TEXT 13 #define TYPE_PASSWORD 14 #define TYPE_FLOAT 15 #define TYPE_MODULE 17 #define TYPE_FONT 19 #define TYPE_CUSTOM 20 #define TYPE_URL 21 #define TYPE_URL_LIST 22 #define VAR_TYPE_MASK 255
b98c022001-07-31Per Hedbor #define VAR_EXPERT 0x100 #define VAR_MORE 0x200 #define VAR_DEVELOPER 0x400 #define VAR_INITIAL 0x800 #define VAR_NOT_CFIF 0x1000 #define VAR_INVISIBLE 0x2000
4f4a962000-07-04Per Hedbor 
b98c022001-07-31Per Hedbor #define VAR_PUBLIC 0x4000 #define VAR_NO_DEFAULT 0x8000
332c482000-11-02Per Hedbor 
4f4a962000-07-04Per Hedbor #define MOD_ALLOW 1 #define MOD_USER 2 #define MOD_DENY 3 #define MOD_PROXY_USER 4 #define MOD_ACCEPT 5 #define MOD_ACCEPT_USER 6 #define MOD_ACCEPT_PROXY_USER 7
8ab8bf2001-03-13Martin Nilsson  #define ENCODE_RXML_INT(value, type) \ (type && type != RXML.t_int ? type->encode ((value), RXML.t_int) : (value)) #define ENCODE_RXML_FLOAT(value, type) \
a2cd402001-03-24Martin Nilsson  ((value) ? (type && type != RXML.t_float ? type->encode ((value), RXML.t_float) : (value)) : RXML.nil)
f55a012001-03-14Martin Stjernholm #define ENCODE_RXML_TEXT(value, type) \
a2cd402001-03-24Martin Nilsson  ((value) ? (type && type != RXML.t_text ? type->encode ((value), RXML.t_text) : (value)) : RXML.nil)
8ab8bf2001-03-13Martin Nilsson #define ENCODE_RXML_XML(value, type) \
a2cd402001-03-24Martin Nilsson  ((value) ? (type && type != RXML.t_xml ? type->encode ((value), RXML.t_xml) : (value)) : RXML.nil)
8ab8bf2001-03-13Martin Nilsson 
e1d0af2001-06-18Martin Stjernholm #if constant (thread_create)
3c6d942001-06-25Martin Stjernholm # define RXML_CONTEXT (_cur_rxml_context->get())
e1d0af2001-06-18Martin Stjernholm #else
3c6d942001-06-25Martin Stjernholm # define RXML_CONTEXT (_cur_rxml_context)
e1d0af2001-06-18Martin Stjernholm #endif
b4ad332002-03-12Martin Stjernholm // Debug macros. #ifdef MODULE_DEBUG # define DO_IF_MODULE_DEBUG(code...) code #else # define DO_IF_MODULE_DEBUG(code...)
b1fca01996-11-12Per Hedbor #endif
b4ad332002-03-12Martin Stjernholm  #ifdef RXML_VERBOSE # define TAG_DEBUG_TEST(test) 1 #elif defined (RXML_REQUEST_VERBOSE) # define TAG_DEBUG_TEST(test) \ ((test) || RXML_CONTEXT->id && RXML_CONTEXT->id->misc->rxml_verbose) #else # define TAG_DEBUG_TEST(test) (test) #endif #endif // !ROXEN_MODULE_H