b4f78f9cc649ecfccd8829c482bfa7077684fd4e
[public/netxms.git] / src / agent / libnxappc / nxappc.h
1 /*
2 ** NetXMS Application Connector Library
3 ** Copyright (C) 2015-2016 Raden Solutions
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining
6 ** a copy of this software and associated documentation files
7 ** (the "Software"), to deal in the Software without restriction, including
8 ** without limitation the rights to use, copy, modify, merge, publish,
9 ** distribute, sublicense, and/or sell copies of the Software, and to permit
10 ** persons to whom the Software is furnished to do so, subject to the
11 ** following conditions:
12 **
13 ** The above copyright notice and this permission notice shall be included in
14 ** all copies or substantial portions of the Software.
15 **
16 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 ** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 ** OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 ** OTHER DEALINGS IN THE SOFTWARE.
23 **/
24
25 #ifndef _nxappc_h_
26 #define _nxappc_h_
27
28 #ifdef _WIN32
29 #ifdef LIBNXAPPC_EXPORTS
30 #define LIBNXAPPC_EXPORTABLE __declspec(dllexport)
31 #else
32 #define LIBNXAPPC_EXPORTABLE __declspec(dllimport)
33 #endif
34 #else
35 #define LIBNXAPPC_EXPORTABLE
36 #endif
37
38 #define NXAPPC_SUCCESS (0)
39 #define NXAPPC_FAIL (-1)
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 int LIBNXAPPC_EXPORTABLE nxappc_open_channel(void);
46 int LIBNXAPPC_EXPORTABLE nxappc_reset_channel(void);
47 int LIBNXAPPC_EXPORTABLE nxappc_set_channel_name(const char *channel);
48
49 int LIBNXAPPC_EXPORTABLE nxappc_send_event(int code, const char *name, const char *format, ...);
50 int LIBNXAPPC_EXPORTABLE nxappc_send_data(void *data, int size);
51
52 int LIBNXAPPC_EXPORTABLE nxappc_register_counter(const char *counter, const char *instance);
53 int LIBNXAPPC_EXPORTABLE nxappc_update_counter_long(const char *counter, const char *instance, long diff);
54 int LIBNXAPPC_EXPORTABLE nxappc_update_counter_double(const char *counter, const char *instance, double diff);
55 int LIBNXAPPC_EXPORTABLE nxappc_reset_counter(const char *counter, const char *instance);
56 int LIBNXAPPC_EXPORTABLE nxappc_set_counter_long(const char *counter, const char *instance, long value);
57 int LIBNXAPPC_EXPORTABLE nxappc_set_counter_double(const char *counter, const char *instance, double value);
58
59 #ifdef __cplusplus
60 }
61 #endif
62
63 #endif