1 /* tclink.h - Header file for TCLink library. */
8 /* Handle passed to all TCLink functions. A unique handle must be created
9 * for each concurrent thread, but the same handle can be shared by transactions
10 * occurring one after another (such as a for loop).
12 #define TCLinkHandle void*
14 /* Parameter names and values cannot exceed this size.
16 #define PARAM_MAX_LEN 768
18 /* Create a new TCLinkHandle.
23 /* Add a parameter to be sent to the server.
26 TCLinkPushParam(TCLinkHandle handle
, const char* name
, const char* value
);
28 /* Flush the parameters to the server.
31 TCLinkSend(TCLinkHandle handle
);
33 /* Look up a response value from the server.
34 * Returns NULL if no such parameter, or stores the value in 'value' and
35 * returns a pointer to value. value should be at least PARAM_MAX_LEN in size.
38 TCLinkGetResponse(TCLinkHandle handle
, const char* name
, char* value
);
40 /* Get all response values from the server in one giant string.
41 * Stores the string into buf and returns a pointer to it. Size should be
42 * sizeof(buf), which will limit the string so that no buffer overruns occur.
45 TCLinkGetEntireResponse(TCLinkHandle handle
, char* buf
, int size
);
47 /* Destory a handle, ending that transaction and freeing the memory associated
50 TCLinkDestroy(TCLinkHandle handle
);
52 /* Store version string into buf. Returns a pointer to buf. */
54 TCLinkGetVersion(char* buf
);
56 /* The API methods below are subject to change. */
58 /* Enables (1) or Disables (0) the full SSL close_notify sequence. By default,
61 TCLinkSetFullClose(TCLinkHandle handle
, int full_ssl_close
);
63 /* Provides a method, once the handshake is completed, a means to verify the
64 * contents of that certificate independently. Note that the certificate may not
65 * be set depending on the negotation type (in which case the pointer would be
69 TCLinkSetValidateCallback(TCLinkHandle handle
,
70 int (*validate_cert
)(int, void*));