fixed makefile
[public/netxms.git] / include / nxsdapi.h
CommitLineData
a2a24e9d
VK
1/*
2** NetXMS - Network Management System
3** Copyright (C) 2003-2012 Victor Kirhenshtein
4**
5** This program is free software; you can redistribute it and/or modify
6** it under the terms of the GNU Lesser General Public License as published by
7** the Free Software Foundation; either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU Lesser General Public License
16** along with this program; if not, write to the Free Software
17** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18**
19** File: nxsdapi.h
20**
21**/
22
23#ifndef _nxsdapi_h_
24#define _nxsdapi_h_
25
26#ifdef _WIN32
27#ifdef LIBNXSD_EXPORTS
28#define LIBNXSD_EXPORTABLE __declspec(dllexport)
29#else
30#define LIBNXSD_EXPORTABLE __declspec(dllimport)
31#endif
32#else /* _WIN32 */
33#define LIBNXSD_EXPORTABLE
34#endif
35
36
37#include "nms_common.h"
38
39
40/**
41 * Storage element GUID structure
42 */
43#ifdef __HP_aCC
44#pragma pack 1
45#else
46#pragma pack(1)
47#endif
48
49typedef struct __sguid
50{
51 BYTE typeAndFlags;
52 BYTE data[31];
53} SGUID;
54
55#ifdef __HP_aCC
56#pragma pack
57#else
58#pragma pack()
59#endif
60
61/**
62 * Attribute set
63 */
64typedef struct __attribute_set
65{
66 SGUID guid;
67 int count;
68 int allocated;
69 char **names;
70 char **values;
71} ATTRIBUTE_SET;
72
73/**
74 * API functions
75 */
76
77#ifdef __cplusplus
78extern "C" {
79#endif
80
81void LIBNXSD_EXPORTABLE SerialToSGUID(const char *serial, BOOL isFake, SGUID *guid);
82void LIBNXSD_EXPORTABLE DevicePathToSGUID(const char *path, SGUID *guid);
83void LIBNXSD_EXPORTABLE ParseSGUID(SGUID *guid, int *type, char *data, int *isFake);
84
85int LIBNXSD_EXPORTABLE CreateStorageElement(SGUID *guid, int deviceType, const char *name, const char *serial, const char *path);
86int LIBNXSD_EXPORTABLE RemoveStorageElement(SGUID *guid);
87
88ATTRIBUTE_SET LIBNXSD_EXPORTABLE *CreateAttributeSet(SGUID *guid);
89void LIBNXSD_EXPORTABLE SetAttribute(ATTRIBUTE_SET *set, const char *attr, const char *value);
90void LIBNXSD_EXPORTABLE SetAttributeInt32(ATTRIBUTE_SET *set, const char *attr, LONG value);
91void LIBNXSD_EXPORTABLE SetAttributeUInt32(ATTRIBUTE_SET *set, const char *attr, DWORD value);
92void LIBNXSD_EXPORTABLE SetAttributeInt64(ATTRIBUTE_SET *set, const char *attr, INT64 value);
93void LIBNXSD_EXPORTABLE SetAttributeUInt64(ATTRIBUTE_SET *set, const char *attr, QWORD value);
94int LIBNXSD_EXPORTABLE UpdateAttributes(ATTRIBUTE_SET *set);
95void LIBNXSD_EXPORTABLE DeleteAttributeSet(ATTRIBUTE_SET *set);
96
97int LIBNXSD_EXPORTABLE LinkStorageElement(SGUID *element, SGUID *parent);
98int LIBNXSD_EXPORTABLE UnlinkStorageElement(SGUID *element, SGUID *parent);
99
100#ifdef __cplusplus
101}
102#endif
103
104#endif