minor changes
[public/netxms.git] / include / nxsl.h
CommitLineData
8e76f8aa 1/* $Id$ */
cce155af
VK
2/*
3** NetXMS - Network Management System
375e0736 4** Copyright (C) 2005, 2006 Victor Kirhenshtein
cce155af
VK
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**
375e0736 20** File: nxsl.h
cce155af
VK
21**
22**/
23
24#ifndef _nxsl_h_
25#define _nxsl_h_
26
27#ifdef _WIN32
28#ifdef LIBNXSL_EXPORTS
29#define LIBNXSL_EXPORTABLE __declspec(dllexport)
30#else
31#define LIBNXSL_EXPORTABLE __declspec(dllimport)
32#endif
33#else /* _WIN32 */
34#define LIBNXSL_EXPORTABLE
35#endif
36
37
38//
b36dc6ff
VK
39// Various defines
40//
41
42#define MAX_FUNCTION_NAME 64
43
44
45//
cd890184
VK
46// Script execution errors
47//
48
49#define NXSL_ERR_DATA_STACK_UNDERFLOW 1
50#define NXSL_ERR_CONTROL_STACK_UNDERFLOW 2
51#define NXSL_ERR_BAD_CONDITION 3
52#define NXSL_ERR_NOT_NUMBER 4
53#define NXSL_ERR_NULL_VALUE 5
54#define NXSL_ERR_INTERNAL 6
55#define NXSL_ERR_NO_MAIN 7
56#define NXSL_ERR_CONTROL_STACK_OVERFLOW 8
57#define NXSL_ERR_DIVIDE_BY_ZERO 9
58#define NXSL_ERR_REAL_VALUE 10
59#define NXSL_ERR_NO_FUNCTION 11
60#define NXSL_ERR_INVALID_ARGUMENT_COUNT 12
bd40de8f 61#define NXSL_ERR_TYPE_CAST 13
9e52272a
VK
62#define NXSL_ERR_NOT_OBJECT 14
63#define NXSL_ERR_NO_SUCH_ATTRIBUTE 15
2791a0c9 64#define NXSL_ERR_MODULE_NOT_FOUND 16
fa2b47a7 65#define NXSL_ERR_NOT_STRING 17
69aa75eb 66#define NXSL_ERR_REGEXP_ERROR 18
16ec9c2e 67#define NXSL_ERR_NOT_INTEGER 19
9c69cc80
VK
68#define NXSL_ERR_INVALID_OBJECT_OPERATION 20
69#define NXSL_ERR_BAD_CLASS 21
45ae7827 70#define NXSL_ERR_VARIABLE_ALREADY_EXIST 22
ffee16a5
VK
71#define NXSL_ERR_INDEX_NOT_INTEGER 23
72#define NXSL_ERR_NOT_ARRAY 24
cd890184
VK
73
74
75//
ea84fc85
VK
76// Special return codes for external functions
77//
78
79#define NXSL_STOP_SCRIPT_EXECUTION -1
80
81
82//
b36dc6ff
VK
83// Exportable classes
84//
85
86#ifdef __cplusplus
87#include <nxsl_classes.h>
375e0736
VK
88#else
89struct NXSL_Program;
b36dc6ff
VK
90#endif
91
92
93//
cce155af
VK
94// Functions
95//
96
4f0c7a63
VK
97#ifdef __cplusplus
98extern "C" {
99#endif
100
ccc34207 101NXSL_Program LIBNXSL_EXPORTABLE *NXSLCompile(const TCHAR *pszSource,
375e0736 102 TCHAR *pszError, int nBufSize);
ccc34207 103TCHAR LIBNXSL_EXPORTABLE *NXSLLoadFile(const TCHAR *pszFileName, DWORD *pdwFileSize);
cce155af 104
4f0c7a63
VK
105#ifdef __cplusplus
106}
107#endif
cce155af
VK
108
109#endif