more helper functions added to nxinstall
[public/netxms.git] / src / nxinstall / nxinstall.h
1 /*
2 ** NetXMS - Network Management System
3 ** NXSL-based installer tool collection
4 ** Copyright (C) 2005-2011 Victor Kirhenshtein
5 **
6 ** This program is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** 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., 675 Mass Ave, Cambridge, MA 02139, USA.
19 **
20 ** File: nxinstall.h
21 **
22 **/
23
24 #ifndef _nxinstall_h_
25 #define _nxinstall_h_
26
27 #include <nms_common.h>
28 #include <nms_util.h>
29 #include <nxsl.h>
30
31 #if HAVE_GETOPT_H
32 #include <getopt.h>
33 #endif
34
35 /**
36 * "FILE" class
37 */
38 class NXSL_FileClass : public NXSL_Class
39 {
40 public:
41 NXSL_FileClass();
42
43 virtual NXSL_Value *getAttr(NXSL_Object *object, const TCHAR *attr);
44 };
45
46 /**
47 * NXSL installer environment
48 */
49 class NXSL_InstallerEnvironment : public NXSL_Environment
50 {
51 public:
52 NXSL_InstallerEnvironment();
53
54 virtual void trace(int level, const TCHAR *text);
55 };
56
57 /**
58 * NXSL external functions
59 */
60 int F_access(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
61 int F_chdir(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
62 int F_CopyFile(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
63 int F_DeleteFile(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
64 int F_fopen(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
65 int F_fclose(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
66 int F_feof(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
67 int F_fgets(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
68 int F_fputs(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
69 int F_mkdir(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
70 int F_RenameFile(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
71 int F_rmdir(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
72 int F_system(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
73
74 /**
75 * Global variables
76 */
77 extern int g_traceLevel;
78 extern NXSL_FileClass g_nxslFileClass;
79
80 #endif