/************************************************************************/
/*google search client api for c/c++*/
/*By littlestar,2003,TRS Open Lab*/
/************************************************************************/
//go http://www.google.com/apis/reference.html for more information
/*start primitive data types*/
#ifdef _SOAP_TYPES
typedef char * xsd__string;
typedef int xsd__int;
struct xsd__base64Binary
{
unsigned char *__ptr;
int __size;
};
typedef bool xsd__boolean;
typedef double xsd__double;
/*end primitive data types*/
struct DirectoryCategoryArray
{
struct typens__DirectoryCategory * __ptr;
int __size;
int __offset;
};
struct typens__ResultElement
{
xsd__string summary;
xsd__string URL;
xsd__string snippet;
xsd__string title;
xsd__string cachedSize;
xsd__boolean relatedInformationPresent;
xsd__string hostName;
struct typens__DirectoryCategory * directoryCategory;
xsd__string directoryTitle;
};
struct typens__doGoogleSearchResponse
{
struct typens__GoogleSearchResult * _return_;
};
struct typens__DirectoryCategory
{
xsd__string fullViewableName;
xsd__string specialEncoding;
};
struct typens__GoogleSearchResult
{
xsd__boolean documentFiltering;
xsd__string searchComments;
xsd__int estimatedTotalResultsCount;
xsd__boolean estimateIsExact;
struct ResultElementArray * resultElements;
xsd__string searchQuery;
xsd__int startIndex;
xsd__int endIndex;
xsd__string searchTips;
struct DirectoryCategoryArray * directoryCategories;
xsd__double searchTime;
};
struct ResultElementArray
{
struct typens__ResultElement * __ptr;
int __size;
int __offset;
};
struct typens__doSpellingSuggestionResponse
{
xsd__string _return_;
};
struct typens__doGetCachedPageResponse
{
struct xsd__base64Binary * _return_;
};
#endif
//建立Soap连接
extern "C" int _stdcall CreateSoapSession(void **SoapSessionHandle,char *strServerAdd,char *key);
//设置代理服务器,支持http代理.
extern "C" int _stdcall SetSoapProxy(void *SoapSessionHandle,char *strProxyHost,int ProxyPort);
//页面检索
extern "C" int _stdcall doGoogleSearch(void *SoapSessionHandle, xsd__string q, xsd__int start, xsd__int maxResults, xsd__boolean filter, xsd__string restrict_, xsd__boolean safeSearch, xsd__string lr, xsd__string ie, xsd__string oe, struct typens__doGoogleSearchResponse * out);
//取得google服务器上的缓存页面
extern "C" int _stdcall doGetCachedPage(void *SoapSessionHandle, xsd__string url, struct typens__doGetCachedPageResponse * out );
//拼写检查
extern "C" int _stdcall doSpellingSuggestion(void *SoapSessionHandle, xsd__string phrase, struct typens__doSpellingSuggestionResponse * out );
//取得SOAP错误消息
extern "C" char* _stdcall GetSoapErrorMessage(void *SoapSessionHandle);
//释放SOAP缓存.
extern "C" int _stdcall FreeSoapCache(void *SoapSessionHandle);
//释放Soap连接
extern "C" int _stdcall FreeSoapSession(void **SoapSessionHandle);