| gclib 2.4.1 Galil Communications Library

Loading...
Searching...
No Matches
gclib_compat.h
Go to the documentation of this file.
1
22
27#ifndef GCLIB_COMPAT_H
28#define GCLIB_COMPAT_H
29
30#ifdef _MSC_VER
31#define GCLIB_DEPRECATED __declspec(deprecated)
32#elif defined(__GNUC__) | defined(__clang__)
33#define GCLIB_DEPRECATED __attribute__((__deprecated__))
34#else
35#define GCLIB_DEPRECATED
36#endif
37
38#include "gclib_record.h" // Galil data record structs and unions.
39#include "gclib_errors.h" // GReturn error code values and strings.
40
41#ifdef __cplusplus
42 extern "C" {
43#endif
44
45#ifndef _WIN32
46#pragma GCC visibility push(default)
47#endif
48
49// Constants for function arguments
50#define G_DR 1
51#define G_QR 0
52#define G_BOUNDS -1
53#define G_CR 0
54#define G_COMMA 1
55#define G_PUBLISH_SERVER 1
56#define G_REMOVE_SERVER 0
57#define G_USE_INITIAL_TIMEOUT -1
58
59// Convenience constants
60#define G_SMALL_BUFFER 1024
61#define G_HUGE_BUFFER 524288
62#define G_LINE_BUFFER 80
63
64//Constants for GUtility()
65#define G_UTIL_TIMEOUT 1
66#define G_UTIL_TIMEOUT_OVERRIDE 2
67#define G_USE_INITIAL_TIMEOUT -1
68#define G_UTIL_VERSION 128
69#define G_UTIL_INFO 129
70#define G_UTIL_SLEEP 130
71#define G_UTIL_ADDRESSES 131
72#define G_UTIL_IPREQUEST 132
73#define G_UTIL_ASSIGN 133
74#define G_UTIL_DEVICE_INITIALIZE 134
75#define G_UTIL_PING 135
76#define G_UTIL_ERROR_CONTEXT 136
77
78#define G_UTIL_GCAPS_HOST 256
79#define G_UTIL_GCAPS_VERSION 257
80#define G_UTIL_GCAPS_KEEPALIVE 258
81#define G_UTIL_GCAPS_ADDRESSES 259
82#define G_UTIL_GCAPS_IPREQUEST 260
83#define G_UTIL_GCAPS_ASSIGN 261
84#define G_UTIL_GCAPS_PING 262
85#define G_UTIL_GCAPS_LIST_SERVERS 263
86#define G_UTIL_GCAPS_PUBLISH_SERVER 264
87#define G_UTIL_GCAPS_SET_SERVER 265
88#define G_UTIL_GCAPS_SERVER_STATUS 266
89#define G_UTIL_GCAPS_REMOTE_CONNECTIONS 267
90#define G_UTIL_GCAPS_SERVER_INFO 268
91#define G_UTIL_GCAPS_ADDRESSES_GET_REMEMBERED 269
92#define G_UTIL_GCAPS_ADDRESSES_SET_REMEMBERED 270
93
94 typedef int GReturn;
95 typedef struct Context* GCon;
96 typedef unsigned int GSize;
97 typedef int GOption;
98 typedef char* GCStringOut;
99 typedef const char* GCStringIn;
100 typedef char* GBufOut;
101 typedef const char* GBufIn;
102 typedef unsigned char GStatus;
103 typedef void* GMemory;
104
106 GCLIB_DEPRECATED GReturn GOpen(GCStringIn connection_string, GCon* g);
150
152 GCLIB_DEPRECATED GReturn GClose(GCon g);
166
168 GCLIB_DEPRECATED GReturn GCommand(GCon g, GCStringIn command, GBufOut buffer, GSize buffer_len, GSize* bytes_returned);
182
184 GCLIB_DEPRECATED GReturn GProgramDownload(GCon g, GCStringIn program, GCStringIn preprocessor);
196
198 GCLIB_DEPRECATED GReturn GProgramUpload(GCon g, GBufOut buffer, GSize buffer_len);
208
210 GCLIB_DEPRECATED GReturn GArrayDownload(GCon g, const GCStringIn array_name, GOption first, GOption last, GCStringIn buffer);
224
226 GCLIB_DEPRECATED GReturn GArrayUpload(GCon g, const GCStringIn array_name, GOption first, GOption last, GOption delim, GBufOut buffer, GSize buffer_len);
240
242 GCLIB_DEPRECATED GReturn GRecord(GCon g, union GDataRecord* record, GOption method);
266
268 GCLIB_DEPRECATED GReturn GMessage(GCon g, GCStringOut buffer, GSize buffer_len);
299
301 GCLIB_DEPRECATED GReturn GInterrupt(GCon g, GStatus* status_byte);
320
322 GCLIB_DEPRECATED GReturn GFirmwareDownload(GCon g, GCStringIn filepath);
331
333 GCLIB_DEPRECATED GReturn GRead(GCon g, GBufOut buffer, GSize buffer_len, GSize* bytes_read);
339 GCLIB_DEPRECATED GReturn GWrite(GCon g, GBufIn buffer, GSize buffer_len);
345 GCLIB_DEPRECATED GReturn GUtility(GCon g, GOption request, GMemory memory1, GMemory memory2);
350
351#ifdef __cplusplus
352} //extern "C"
353#endif
354
355#ifndef _WIN32
356#pragma GCC visibility pop
357#endif
358
359#endif // GCLIB_COMPAT_H
GBufIn
const char * GBufIn
Data input to the library. No null-termination, function will have a GSize to indicate bytes to write...
Definition gclib_compat.h:101
GReturn
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
Definition gclib_compat.h:94
GUtility
GCLIB_DEPRECATED GReturn GUtility(GCon g, GOption request, GMemory memory1, GMemory memory2)
Does nothing and returns G_GCLIB_ERROR.
GOption
int GOption
Option integer for various formatting, etc.
Definition gclib_compat.h:97
GCLIB_DEPRECATED
#define GCLIB_DEPRECATED
Definition gclib_compat.h:35
GWrite
GCLIB_DEPRECATED GReturn GWrite(GCon g, GBufIn buffer, GSize buffer_len)
Does nothing and returns G_GCLIB_ERROR.
GStatus
unsigned char GStatus
Interrupt status byte.
Definition gclib_compat.h:102
GSize
unsigned int GSize
Size of buffers, etc.
Definition gclib_compat.h:96
GBufOut
char * GBufOut
Data output from the library. No null-termination implied. Returned values may be null-terminated,...
Definition gclib_compat.h:100
GCon
struct Context * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
Definition gclib_compat.h:95
GMemory
void * GMemory
Pointer to untyped memory for use in GUtility().
Definition gclib_compat.h:103
GCStringOut
char * GCStringOut
C-string output from the library. Implies null-termination.
Definition gclib_compat.h:98
GCStringIn
const char * GCStringIn
C-string input to the library. Implies null-termination.
Definition gclib_compat.h:99
GRead
GCLIB_DEPRECATED GReturn GRead(GCon g, GBufOut buffer, GSize buffer_len, GSize *bytes_read)
Does nothing and returns G_GCLIB_ERROR.
gclib_errors.h
gclib_record.h
GCommand
GCLIB_DEPRECATED GReturn GCommand(GCon g, GCStringIn command, GBufOut buffer, GSize buffer_len, GSize *bytes_returned)
Performs a command-and-response transaction on the connection.
GClose
GCLIB_DEPRECATED GReturn GClose(GCon g)
Closes a connection to a Galil Controller.
GOpen
GCLIB_DEPRECATED GReturn GOpen(GCStringIn connection_string, GCon *g)
Open a connection to a Galil Controller.
GArrayUpload
GCLIB_DEPRECATED GReturn GArrayUpload(GCon g, const GCStringIn array_name, GOption first, GOption last, GOption delim, GBufOut buffer, GSize buffer_len)
Uploads array data from the controller's array table.
GArrayDownload
GCLIB_DEPRECATED GReturn GArrayDownload(GCon g, const GCStringIn array_name, GOption first, GOption last, GCStringIn buffer)
Downloads array data to a pre-dimensioned array in the controller's array table.
GFirmwareDownload
GCLIB_DEPRECATED GReturn GFirmwareDownload(GCon g, GCStringIn filepath)
Upgrade firmware.
GProgramDownload
GCLIB_DEPRECATED GReturn GProgramDownload(GCon g, GCStringIn program, GCStringIn preprocessor)
Downloads a program to the controller's program buffer.
GProgramUpload
GCLIB_DEPRECATED GReturn GProgramUpload(GCon g, GBufOut buffer, GSize buffer_len)
Uploads a program from the controller's program buffer.
GRecord
GCLIB_DEPRECATED GReturn GRecord(GCon g, union GDataRecord *record, GOption method)
Provides a fresh copy of the controller's data record. Data is cast into a union, GDataRecord.
GMessage
GCLIB_DEPRECATED GReturn GMessage(GCon g, GCStringOut buffer, GSize buffer_len)
Provides access to unsolicited messages from the controller.
GInterrupt
GCLIB_DEPRECATED GReturn GInterrupt(GCon g, GStatus *status_byte)
Provides access to PCI and UDP interrupts from the controller.
GDataRecord
Data record union, containing all structs and a generic byte array accessor.
Definition gclib_record.h:1079