595a002000-02-04Per Hedbor // $Id: module.h,v 1.31 2000/02/04 01:37:26 per Exp $
b1fca01996-11-12Per Hedbor #ifndef ROXEN_MODULE_H #define ROXEN_MODULE_H
5452281999-12-28Martin Nilsson #define SERIOUS
b1fca01996-11-12Per Hedbor  /* Variable types. */ #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
ae32d01998-03-23David Hedbor #define TYPE_TOGGLE 7
595a002000-02-04Per Hedbor /* #define TYPE_ERROR 8 */
b1fca01996-11-12Per Hedbor #define TYPE_DIR_LIST 9 #define TYPE_FILE_LIST 10 #define TYPE_LOCATION 11
595a002000-02-04Per Hedbor /* #define TYPE_COLOR 12 */
b1fca01996-11-12Per Hedbor #define TYPE_TEXT_FIELD 13
370fad1997-01-27Per Hedbor #define TYPE_TEXT 13
b1fca01996-11-12Per Hedbor #define TYPE_PASSWORD 14 #define TYPE_FLOAT 15
595a002000-02-04Per Hedbor  /* #define TYPE_PORTS 16 */
b1fca01996-11-12Per Hedbor #define TYPE_MODULE 17
595a002000-02-04Per Hedbor /*#define TYPE_MODULE_LIST 18 somewhat buggy.. */ /*#define TYPE_MULTIPLE_MODULE 18 somewhat buggy.. */
b1fca01996-11-12Per Hedbor 
8e727d1997-03-11Per Hedbor #define TYPE_FONT 19
f6d62d1997-03-26Per Hedbor #define TYPE_CUSTOM 20
595a002000-02-04Per Hedbor  /* #define TYPE_NODE 21 */
f6d62d1997-03-26Per Hedbor 
b1fca01996-11-12Per Hedbor  /* Variable indexes */ #define VAR_VALUE 0 #define VAR_NAME 1 #define VAR_TYPE 2 #define VAR_DOC_STR 3 #define VAR_MISC 4 #define VAR_CONFIGURABLE 5 #define VAR_SHORTNAME 6 #define VAR_SIZE 7 #define VAR_TYPE_MASK 255
e7e6031999-11-05Per Hedbor 
b1fca01996-11-12Per Hedbor #define VAR_EXPERT 256
9b9f701997-08-12Per Hedbor #define VAR_MORE 512
49038f1999-11-27Per Hedbor 
275fe21999-10-11Per Hedbor #define VAR_DEVELOPER 1024
e7e6031999-11-05Per Hedbor #define VAR_INITIAL 2048
b1fca01996-11-12Per Hedbor  // Fast but unreliable.
d826931998-01-17Henrik Grubbström (Grubba) #define QUERY(var) variables[ #var ][VAR_VALUE]
b1fca01996-11-12Per Hedbor  // Like query, but for global variables.
cb9aab1999-03-27Henrik Grubbström (Grubba) #ifdef IN_ROXEN
6458611999-03-27Henrik Grubbström (Grubba) #define GLOBVAR(x) variables[ #x ][VAR_VALUE]
cb9aab1999-03-27Henrik Grubbström (Grubba) #else /* !IN_ROXEN */
6458611999-03-27Henrik Grubbström (Grubba) #define GLOBVAR(x) roxen->variables[ #x ][VAR_VALUE]
cb9aab1999-03-27Henrik Grubbström (Grubba) #endif /* IN_ROXEN */
b1fca01996-11-12Per Hedbor 
94e8e42000-01-10Martin Nilsson #define MODULE_ZERO 0
8bc20a1998-08-20Per Hedbor #define MODULE_EXTENSION (1<<0) #define MODULE_LOCATION (1<<1) #define MODULE_URL (1<<2) #define MODULE_FILE_EXTENSION (1<<3) #define MODULE_PARSER (1<<4) #define MODULE_LAST (1<<5) #define MODULE_FIRST (1<<6)
b1fca01996-11-12Per Hedbor 
8bc20a1998-08-20Per Hedbor #define MODULE_AUTH (1<<7) #define MODULE_MAIN_PARSER (1<<8) #define MODULE_TYPES (1<<9) #define MODULE_DIRECTORIES (1<<10)
b1fca01996-11-12Per Hedbor 
8bc20a1998-08-20Per Hedbor #define MODULE_PROXY (1<<11) #define MODULE_LOGGER (1<<12) #define MODULE_FILTER (1<<13)
b1fca01996-11-12Per Hedbor 
ae32d01998-03-23David Hedbor // A module which can be called from other modules, protocols, scripts etc.
8bc20a1998-08-20Per Hedbor #define MODULE_PROVIDER (1<<15)
b878961999-11-06Per Hedbor 
7f8c681998-08-10Per Hedbor // The module implements a protocol.
8bc20a1998-08-20Per Hedbor #define MODULE_PROTOCOL (1<<16)
1410351997-04-09Marcus Comstedt 
5a6ef51998-11-22Per Hedbor // A configuration interface module #define MODULE_CONFIG (1<<17)
ae32d01998-03-23David Hedbor 
7f8c681998-08-10Per Hedbor // Flags.
8bc20a1998-08-20Per Hedbor #define MODULE_SECURITY (1<<29)
b878961999-11-06Per Hedbor 
8bc20a1998-08-20Per Hedbor #define MODULE_EXPERIMENTAL (1<<30)
7f8c681998-08-10Per Hedbor 
2a2a5b1996-12-01Per Hedbor 
b878961999-11-06Per Hedbor // Module level security. #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
35aead1997-05-08Per Hedbor 
595a002000-02-04Per Hedbor #define DEFFONT(X,Y,Z,Q)
35aead1997-05-08Per Hedbor 
7f8c681998-08-10Per Hedbor #define CACHE(seconds) id->misc->cacheable=min(id->misc->cacheable,seconds) #define NOCACHE() id->misc->cacheable=0
00a4be1999-12-07Martin Nilsson #define TAGDOCUMENTATION mapping tagdocumentation(){return get_value_from_file(__FILE__,"tagdoc","#define manual\n");}
b1fca01996-11-12Per Hedbor #endif