#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include unsigned char sc_hp[] = { /* html page null terminated format string, from file src/hp.html */ #include }; #define SC_HTTP_PORT 7327 /* SEAR on mobile keyboard */ #define SC_HTTP_RBUFSIZE 4096 /* initial size of http read buffer, increasning by K */ #define SC_HTTP_USER_AGENT "Nokia WAP Gateway 4.1 CD1/ECD13_D/4.1.04)" /* so google and others sends a minimal response */ #define SC_HTTP_HEADERS "User-Agent: " SC_HTTP_USER_AGENT "\r\n" #include #include #include /* this is new in my programs. I am now using _sizeof for the actual alloced size of the array and _length for the count of elements in array. this is done to decrease number of calls to realloc&amis */ int main (int argc, char ** argv) { int rs = 0; struct sc_cache * c = sc_cache_init(); if (!c) { rs = 1; goto rc; } sc_query_google("slovenia", c); rc: sc_cache_free(c); return rs; }