1 /*************** TabRest H Declares Source Code File (.H) **************/ 2 /* Name: tabrest.h Version 1.0 */ 3 /* (C) Copyright to the author Olivier BERTRAND 2019 */ 4 /* This file contains the common tabrest classes declares. */ 5 /***********************************************************************/ 6 #pragma once 7 8 #if defined(_WIN32) 9 #else // !_WIN32 10 #define stricmp strcasecmp 11 #endif // !_WIN32 12 13 typedef int(__stdcall* XGETREST) (char*, bool, PCSZ, PCSZ, PCSZ); 14 15 /***********************************************************************/ 16 /* Functions used by REST. */ 17 /***********************************************************************/ 18 XGETREST GetRestFunction(PGLOBAL g); 19 #if defined(REST_SOURCE) 20 extern "C" int restGetFile(char* m, bool xt, PCSZ http, PCSZ uri, PCSZ fn); 21 #endif // REST_SOURCE 22 #if defined(MARIADB) 23 PQRYRES RESTColumns(PGLOBAL g, PTOS tp, char* tab, char* db, bool info); 24 #endif // !MARIADB 25 26 27 /***********************************************************************/ 28 /* Restest table. */ 29 /***********************************************************************/ 30 class RESTDEF : public TABDEF { /* Table description */ 31 public: 32 // Constructor RESTDEF(void)33 RESTDEF(void) { Tdp = NULL; Http = Uri = Fn = NULL; } 34 35 // Implementation GetType(void)36 virtual const char *GetType(void) { return "REST"; } 37 38 // Methods 39 virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); 40 virtual PTDB GetTable(PGLOBAL g, MODE m); 41 42 protected: 43 // Members 44 PRELDEF Tdp; 45 PCSZ Http; /* Web connection HTTP */ 46 PCSZ Uri; /* Web connection URI */ 47 PCSZ Fn; /* The intermediate file name */ 48 }; // end of class RESTDEF 49