00001 /* tclink.h - Header file for TCLink library. 00002 * 00003 * TCLink Copyright (c) 2003 TrustCommerce. 00004 * http://www.trustcommerce.com 00005 * developer@trustcommerce.com 00006 * (626) 744-7700 00007 * 00008 * All code contained herein is copyright (c) TrustCommerce. 00009 * It is distributed to our clients for your convenience; it is for 00010 * use by those authorized persons ONLY and for no other purpose beyond 00011 * integrated with TrustCommerce's payment gateway. 00012 * 00013 * That said, please feel free to use this code in any way you see fit for 00014 * the purpose of TrustCommerce integration. Should you find any bugs or 00015 * make interesting improvements/optimizations, please contact us via 00016 * developer@trustcommerce.com. 00017 */ 00018 00019 #ifndef _TCLINK_H 00020 #define _TCLINK_H 00021 00022 #include "config.h" 00023 00024 /* Handle passed to all TCLink functions. A unique handle must be created 00025 * for each concurrent thread, but the same handle can be shared by transactions 00026 * occurring one after another (such as a for loop). 00027 */ 00028 #define TCLinkHandle void * 00029 00030 /* Parameter names and values cannot exceed this size. 00031 */ 00032 #define PARAM_MAX_LEN 256 00033 00034 /* Create a new TCLinkHandle. 00035 */ 00036 TCLinkHandle TCLinkCreate(); 00037 00038 /* Add a parameter to be sent to the server. 00039 */ 00040 void TCLinkPushParam(TCLinkHandle handle, const char *name, const char *value); 00041 00042 /* Flush the parameters to the server. 00043 */ 00044 void TCLinkSend(TCLinkHandle handle); 00045 00046 /* Look up a response value from the server. 00047 * Returns NULL if no such parameter, or stores the value in 'value' and 00048 * returns a pointer to value. value should be at least PARAM_MAX_LEN in size. 00049 */ 00050 char *TCLinkGetResponse(TCLinkHandle handle, const char *name, char *value); 00051 00052 /* Get all response values from the server in one giant string. 00053 * Stores the string into buf and returns a pointer to it. Size should be 00054 * sizeof(buf), which will limit the string so that no buffer overruns occur. 00055 */ 00056 char *TCLinkGetEntireResponse(TCLinkHandle handle, char *buf, int size); 00057 00058 /* Destory a handle, ending that transaction and freeing the memory associated with it. */ 00059 void TCLinkDestroy(TCLinkHandle handle); 00060 00061 /* Store version string into buf. Returns a pointer to buf. */ 00062 char *TCLinkGetVersion(char *buf); 00063 00064 #endif 00065
1.5.5