more helper functions added to nxinstall
[public/netxms.git] / src / nxinstall / nxinstall.h
CommitLineData
3c050e4c
VK
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 */
38class NXSL_FileClass : public NXSL_Class
39{
40public:
41 NXSL_FileClass();
42
43 virtual NXSL_Value *getAttr(NXSL_Object *object, const TCHAR *attr);
44};
45
46/**
47 * NXSL installer environment
48 */
49class NXSL_InstallerEnvironment : public NXSL_Environment
50{
51public:
52 NXSL_InstallerEnvironment();
53
54 virtual void trace(int level, const TCHAR *text);
55};
56
57/**
58 * NXSL external functions
59 */
60int F_access(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
c5f180e6
VK
61int F_chdir(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
62int F_CopyFile(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
63int F_DeleteFile(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
3c050e4c
VK
64int F_fopen(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
65int F_fclose(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
66int F_feof(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
67int F_fgets(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
68int F_fputs(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
c5f180e6
VK
69int F_mkdir(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
70int F_RenameFile(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
71int F_rmdir(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
72int F_system(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NXSL_Program *program);
3c050e4c
VK
73
74/**
75 * Global variables
76 */
77extern int g_traceLevel;
78extern NXSL_FileClass g_nxslFileClass;
79
80#endif