gclibo.h

Go to the documentation of this file.
00001 
00007 #ifndef I_007AD0AF_C956_4B96_ADE2_AD04FAFFEE99
00008 #define I_007AD0AF_C956_4B96_ADE2_AD04FAFFEE99
00009 
00010 //set library visibility for gcc and msvc
00011 #if BUILDING_GCLIB && HAVE_VISIBILITY
00012 #define GCLIB_DLL_EXPORTED __attribute__((__visibility__("default")))
00013 #elif BUILDING_GCLIB && defined _MSC_VER
00014 #define GCLIB_DLL_EXPORTED __declspec(dllexport)
00015 #elif defined _MSC_VER
00016 #define GCLIB_DLL_EXPORTED __declspec(dllimport)
00017 #else
00018 #define GCLIB_DLL_EXPORTED
00019 #endif
00020 
00021 #define _CRT_SECURE_NO_WARNINGS //use traditional C calls like strncpy()
00022 
00023 #include "gclib.h" //Galil's C Library
00024 #include <stdlib.h> //atoi, atof
00025 #include <string.h> //strcpy
00026 #include <stdio.h> //fopen
00027 #include <math.h> //log()
00028 
00029 #ifdef _WIN32
00030 #define GCALL __stdcall
00031 #else
00032 #define GCALL  /* nothing */
00033 #endif
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 
00039 #define SMALLBUF 256 //size for a small buffer response.
00040 #define MALLOCBUF G_HUGE_BUFFER //malloc used for large program and array uploads.
00041 #define MAXPROG MALLOCBUF //maximum size for a program.
00042 #define MAXARRAY MALLOCBUF //maximum size for an array table upload.
00043 #define POLLINGINTERVAL 100 //interval for polling commands, in miliseconds.
00044 
00046   GCLIB_DLL_EXPORTED void GCALL GSleep(unsigned int timeout_ms);
00054 
00055   GCLIB_DLL_EXPORTED GReturn GCALL GVersion(GCStringOut ver, GSize ver_len);
00065 
00066   GCLIB_DLL_EXPORTED GReturn GCALL GAddresses(GCStringOut addresses, GSize addresses_len);
00077 
00078   GCLIB_DLL_EXPORTED GReturn GCALL GInfo(GCon g, GCStringOut info, GSize info_len);
00090 
00091   GCLIB_DLL_EXPORTED GReturn GCALL GTimeout(GCon g, short timeout_ms);
00102 
00103   GCLIB_DLL_EXPORTED GReturn GCALL GCmd(GCon g, GCStringIn command);
00116 
00117   GCLIB_DLL_EXPORTED GReturn GCALL GCmdT(GCon g, GCStringIn command, GCStringOut trimmed_response, GSize response_len, GCStringOut* front);
00134 
00135   GCLIB_DLL_EXPORTED GReturn GCALL GCmdI(GCon g, GCStringIn command, int* value);
00149 
00150   GCLIB_DLL_EXPORTED GReturn GCALL GCmdD(GCon g, GCStringIn command, double* value);
00165 
00166   GCLIB_DLL_EXPORTED GReturn GCALL GMotionComplete(GCon g, GCStringIn axes);
00183 
00184   GCLIB_DLL_EXPORTED GReturn GCALL GRecordRate(GCon g, double period_ms);
00197 
00198   GCLIB_DLL_EXPORTED GReturn GCALL GProgramDownloadFile(GCon g, GCStringIn file_path, GCStringIn preprocessor);
00210 
00211   GCLIB_DLL_EXPORTED GReturn GCALL GProgramUploadFile(GCon g, GCStringIn file_path);
00222 
00223   GCLIB_DLL_EXPORTED GReturn GCALL GArrayDownloadFile(GCon g, GCStringIn file_path);
00236 
00237   GCLIB_DLL_EXPORTED GReturn GCALL GArrayUploadFile(GCon g, GCStringIn file_path, GCStringIn names);
00251 
00252   GCLIB_DLL_EXPORTED GReturn GCALL GIpRequests(GCStringOut requests, GSize requests_len);
00278 
00279   GCLIB_DLL_EXPORTED GReturn GCALL GAssign(char* ip, char* mac);
00296 
00297   GCLIB_DLL_EXPORTED void GCALL GError(GReturn rc, GCStringOut error, GSize error_len);
00306 #ifdef __cplusplus
00307 } //extern "C"
00308 #endif
00309 
00310 #endif //I_007AD0AF_C956_4B96_ADE2_AD04FAFFEE99