2003-02-02 09:24:13 -05:00
|
|
|
#ifndef __GETURL_H__
|
|
|
|
#define __GETURL_H__
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <curl/curl.h>
|
|
|
|
#include <curl/types.h>
|
|
|
|
#include <curl/easy.h>
|
|
|
|
|
|
|
|
#define NUM_CONNECTIONS 10
|
|
|
|
#define NAK 0
|
|
|
|
#define ACK 1
|
|
|
|
#define YP_RESPONSE_SIZE 2046
|
|
|
|
#define YP_SID_SIZE 255
|
|
|
|
|
2003-02-02 11:48:15 -05:00
|
|
|
struct curl_memory_struct {
|
|
|
|
char memory[YP_RESPONSE_SIZE];
|
|
|
|
size_t size;
|
2003-02-02 09:24:13 -05:00
|
|
|
};
|
2003-02-02 11:48:15 -05:00
|
|
|
struct curl_memory_struct2 {
|
|
|
|
char sid[YP_SID_SIZE];
|
|
|
|
char message[YP_RESPONSE_SIZE];
|
|
|
|
int touch_freq;
|
|
|
|
int response;
|
|
|
|
size_t size;
|
2003-02-02 09:24:13 -05:00
|
|
|
};
|
|
|
|
|
2003-02-02 11:48:15 -05:00
|
|
|
typedef struct tag_curl_connection {
|
|
|
|
struct curl_memory_struct result;
|
|
|
|
struct curl_memory_struct2 header_result;
|
|
|
|
CURL *curl_handle;
|
|
|
|
int in_use;
|
|
|
|
} curl_connection;
|
2003-02-02 09:24:13 -05:00
|
|
|
|
|
|
|
|
|
|
|
int curl_initialize();
|
|
|
|
void curl_shutdown();
|
2003-02-02 11:48:15 -05:00
|
|
|
CURL *curl_get_handle(int which);
|
|
|
|
struct curl_memory_struct *curl_get_result(int which);
|
|
|
|
struct curl_memory_struct2 *curl_get_header_result(int which);
|
|
|
|
void curl_print_header_result(struct curl_memory_struct2 *mem);
|
|
|
|
int curl_get_connection();
|
|
|
|
int curl_release_connection(int which);
|
2003-02-02 09:24:13 -05:00
|
|
|
#endif
|
|
|
|
|