Add header.
[vlendec/samba-autobuild/.git] / source4 / lib / appweb / ejs-2.0 / ejs / system / ejsSystemDebug.c
1 /*
2  *      @file   ejsSystemDebug.c
3  *      @brief  System.Debug class
4  */
5 /********************************** Copyright *********************************/
6 /*
7  *      Copyright (c) Mbedthis Software LLC, 2005-2006. All Rights Reserved.
8  */
9 /********************************** Includes **********************************/
10
11 #include        "ejs.h"
12
13 /******************************************************************************/
14 /************************************ Methods *********************************/
15 /******************************************************************************/
16 /*
17  *      function bool isDebugMode()
18  *      MOB -- convert to accessor
19  */
20
21 static int isDebugMode(Ejs *ejs, EjsVar *thisObj, int argc, EjsVar **argv)
22 {
23         ejsTrace(ejs, "isDebugMode()\n");
24         ejsSetReturnValueToInteger(ejs, mprGetDebugMode(ejs));
25         return 0;
26 }
27
28 /******************************************************************************/
29 /******************************** Initialization ******************************/
30 /******************************************************************************/
31
32 int ejsDefineDebugClass(Ejs *ejs)
33 {
34         EjsVar  *systemDebugClass;
35
36         systemDebugClass =  ejsDefineClass(ejs, "System.Debug", "Object", 0);
37         if (systemDebugClass == 0) {
38                 return MPR_ERR_CANT_INITIALIZE;
39         }
40
41         /*
42          *      Define the class methods
43          */
44         ejsDefineCMethod(ejs, systemDebugClass, "isDebugMode", isDebugMode,
45                 EJS_NO_LOCAL);
46
47         return ejsObjHasErrors(systemDebugClass) ? MPR_ERR_CANT_INITIALIZE : 0;
48 }
49
50 /******************************************************************************/
51
52 /*
53  * Local variables:
54  * tab-width: 4
55  * c-basic-offset: 4
56  * End:
57  * vim:tw=78
58  * vim600: sw=4 ts=4 fdm=marker
59  * vim<600: sw=4 ts=4
60  */