Macros
macros.h File Reference
#include "exception.h"
#include "config.h"
Include dependency graph for macros.h:

Go to the source code of this file.

Macros

#define bool   int
 
#define true   1
 
#define false   0
 
#define null   0
 
#define PROXY(o)   (o->this)
 
#define MIN(i, j)   (i < j ? i : j)
 
#define CALLER   Caller.get_caller(this_object(), backtrace())
 
#define MCALLER   (CALLER == master() ? PREVCALLER : CALLER)
 
#define PREVCALLER   function_object(backtrace()[-3][2])
 
#define CALLINGFUNCTION   function_name(backtrace()[-2][2])
 
#define CALLERCLASS   backtrace()[-2][0]
 
#define CALLERPROGRAM   object_program(function_object(backtrace()[-2][2]))
 
#define MESSAGE(s, args...)   write("["+Calendar.Second(time())->format_time()+"] "+s+"\n", args)
 
#define MESSAGE_START(s, args...)   write("["+Calendar.Second(time())->format_time()+"] "+s, args)
 
#define MESSAGE_APPEND(s, args...)   write(s, args)
 
#define MESSAGE_END(s, args...)   write(s+"\n", args)
 
#define WARN(s, args...)   werror(s+"\n", args)
 
#define LOG(s)
 
#define FATAL(s, args...)   werror("-------------------------------\n"+ctime(time())+s+"\n", args)
 
#define _LOG(s)   werror("("+this_object()->get_object_id()+") "+s+"\n")
 
#define TRACE(s)
 
#define LOG_DB(s)   catch {_Server->get_module("log")->log_text("database",s); }
 
#define SECURITY_LOG(s, args...)   if (1) {if (_Server->get_module("log")) _Server->get_module("log")->log_security(s, args);}
 
#define LOG_BOOT(s)   catch { _LOG->log_boot(s); }
 
#define LOG_EVENT(s)   catch{_LOG->log_event(s);}
 
#define LOG_ERR(s)   catch{_LOG->log_error(s);}
 
#define LOG_DEBUG(s)   catch{_Server->get_module("log")->log_debug(s);}
 
#define PRINT_BT(c)   ("Error: " + c[0] + "\n" + master()->describe_backtrace(c[1]))
 
#define THROW(c, e)   throw( ({ c, backtrace(), e}))
 
#define IS_SOCKET(o)   (master()->is_socket(o))
 
#define NIL   (([])[""])
 
#define CONTENTOF(x)   _FILEPATH->path_to_object(x)->get_content()
 
#define T_INT   "int"
 
#define T_STRING   "string"
 
#define T_FLOAT   "float"
 
#define T_OBJECT   "object"
 
#define T_MAPPING   "mapping"
 
#define T_ARRAY   "array"
 
#define IS_PROXY(o)   (object_program(o) == (program)"/kernel/proxy.pike" || object_program(o) == (program)"/kernel/proxy")
 
#define URLTYPE_FS   0
 
#define URLTYPE_DB   1
 
#define URLTYPE_HTTP   2
 
#define URLTYPE_RELOC   3
 
#define URLTYPE_DBO   4
 
#define URLTYPE_DBFT   5
 
#define MAX_BUFLEN   65504
 

Macro Definition Documentation

#define _LOG (   s)    werror("("+this_object()->get_object_id()+") "+s+"\n")

Definition at line 64 of file macros.h.

#define bool   int

Definition at line 27 of file macros.h.

#define CALLER   Caller.get_caller(this_object(), backtrace())

Definition at line 35 of file macros.h.

#define CALLERCLASS   backtrace()[-2][0]

Definition at line 45 of file macros.h.

#define CALLERPROGRAM   object_program(function_object(backtrace()[-2][2]))

Definition at line 47 of file macros.h.

#define CALLINGFUNCTION   function_name(backtrace()[-2][2])

Definition at line 43 of file macros.h.

#define CONTENTOF (   x)    _FILEPATH->path_to_object(x)->get_content()

Definition at line 97 of file macros.h.

#define false   0

Definition at line 29 of file macros.h.

#define FATAL (   s,
  args... 
)    werror("-------------------------------\n"+ctime(time())+s+"\n", args)

Definition at line 62 of file macros.h.

#define IS_PROXY (   o)    (object_program(o) == (program)"/kernel/proxy.pike" || object_program(o) == (program)"/kernel/proxy")

Definition at line 108 of file macros.h.

#define IS_SOCKET (   o)    (master()->is_socket(o))

Definition at line 93 of file macros.h.

#define LOG (   s)

Definition at line 59 of file macros.h.

#define LOG_BOOT (   s)    catch { _LOG->log_boot(s); }

Definition at line 83 of file macros.h.

#define LOG_DB (   s)    catch {_Server->get_module("log")->log_text("database",s); }

Definition at line 72 of file macros.h.

#define LOG_DEBUG (   s)    catch{_Server->get_module("log")->log_debug(s);}

Definition at line 89 of file macros.h.

#define LOG_ERR (   s)    catch{_LOG->log_error(s);}

Definition at line 87 of file macros.h.

#define LOG_EVENT (   s)    catch{_LOG->log_event(s);}

Definition at line 85 of file macros.h.

#define MAX_BUFLEN   65504

Definition at line 117 of file macros.h.

#define MCALLER   (CALLER == master() ? PREVCALLER : CALLER)

Definition at line 39 of file macros.h.

#define MESSAGE (   s,
  args... 
)    write("["+Calendar.Second(time())->format_time()+"] "+s+"\n", args)

Definition at line 49 of file macros.h.

#define MESSAGE_APPEND (   s,
  args... 
)    write(s, args)

Definition at line 51 of file macros.h.

#define MESSAGE_END (   s,
  args... 
)    write(s+"\n", args)

Definition at line 52 of file macros.h.

#define MESSAGE_START (   s,
  args... 
)    write("["+Calendar.Second(time())->format_time()+"] "+s, args)

Definition at line 50 of file macros.h.

#define MIN (   i,
 
)    (i < j ? i : j)

Definition at line 33 of file macros.h.

#define NIL   (([])[""])

Definition at line 95 of file macros.h.

#define null   0

Definition at line 30 of file macros.h.

#define PREVCALLER   function_object(backtrace()[-3][2])

Definition at line 41 of file macros.h.

#define PRINT_BT (   c)    ("Error: " + c[0] + "\n" + master()->describe_backtrace(c[1]))

Definition at line 90 of file macros.h.

#define PROXY (   o)    (o->this)

Definition at line 32 of file macros.h.

#define SECURITY_LOG (   s,
  args... 
)    if (1) {if (_Server->get_module("log")) _Server->get_module("log")->log_security(s, args);}

Definition at line 78 of file macros.h.

#define T_ARRAY   "array"

Definition at line 104 of file macros.h.

#define T_FLOAT   "float"

Definition at line 101 of file macros.h.

#define T_INT   "int"

Definition at line 99 of file macros.h.

#define T_MAPPING   "mapping"

Definition at line 103 of file macros.h.

#define T_OBJECT   "object"

Definition at line 102 of file macros.h.

#define T_STRING   "string"

Definition at line 100 of file macros.h.

#define THROW (   c,
 
)    throw( ({ c, backtrace(), e}))

Definition at line 92 of file macros.h.

#define TRACE (   s)

Definition at line 69 of file macros.h.

#define true   1

Definition at line 28 of file macros.h.

#define URLTYPE_DB   1

Definition at line 111 of file macros.h.

#define URLTYPE_DBFT   5

Definition at line 115 of file macros.h.

#define URLTYPE_DBO   4

Definition at line 114 of file macros.h.

#define URLTYPE_FS   0

Definition at line 110 of file macros.h.

#define URLTYPE_HTTP   2

Definition at line 112 of file macros.h.

#define URLTYPE_RELOC   3

Definition at line 113 of file macros.h.

#define WARN (   s,
  args... 
)    werror(s+"\n", args)

Definition at line 54 of file macros.h.