net.h
Go to the documentation of this file.
00001 /* quvi
00002  * Copyright (C) 2011  Toni Gundogdu <legatvs@gmail.com>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301  USA
00018  */
00019 
00020 #ifndef quvi_net_h
00021 #define quvi_net_h
00022 
00035 typedef void *quvi_net_t;
00036 
00040 typedef void *quvi_net_propfeat_t;
00041 
00057 typedef int (*quvi_callback_fetch) (quvi_net_t);
00058 
00075 typedef int (*quvi_callback_resolve) (quvi_net_t);
00076 
00093 typedef int (*quvi_callback_verify) (quvi_net_t);
00094 
00099 typedef enum
00100 {
00101   QUVI_NET_PROPERTY_NONE = 0x00,
00103   QUVI_NET_PROPERTY_URL  = QUVIPROPERTY_STRING + 1,
00105   QUVI_NET_PROPERTY_REDIRECTURL = QUVIPROPERTY_STRING + 2,
00107   QUVI_NET_PROPERTY_CONTENT = QUVIPROPERTY_STRING + 3,
00109   QUVI_NET_PROPERTY_CONTENTTYPE = QUVIPROPERTY_STRING + 4,
00112   QUVI_NET_PROPERTY_CONTENTLENGTH = QUVIPROPERTY_DOUBLE + 5,
00114   QUVI_NET_PROPERTY_RESPONSECODE = QUVIPROPERTY_LONG + 6,
00116   QUVI_NET_PROPERTY_FEATURES = QUVIPROPERTY_VOID + 7,
00123   /* Add new ones below. Bump _QUVI_NET_PROPERTY_LAST accordingly. */
00124 
00125   _QUVI_NET_PROPERTY_LAST = 7 
00126 } QUVInetProperty;
00127 
00132 typedef enum
00133 {
00134   QUVI_NET_PROPERTY_FEATURE_NONE = 0x00,
00136   QUVI_NET_PROPERTY_FEATURE_NAME = QUVIPROPERTY_STRING + 1,
00138   QUVI_NET_PROPERTY_FEATURE_VALUE = QUVIPROPERTY_STRING + 2,
00141   /* Add new ones below. Bump _QUVI_NET_PROPERTY_FEATURE_LAST accordingly. */
00142 
00143   _QUVI_NET_PROPERTY_FEATURE_LAST = 2
00146 } QUVInetPropertyFeature;
00147 
00152 typedef enum
00153 {
00154   QUVI_NET_PROPERTY_FEATURE_NAME_NONE = 0x00,
00157   /* Unlike other properties, these do not specify "type". */
00158 
00159   QUVI_NET_PROPERTY_FEATURE_ARBITRARYCOOKIE,
00161   QUVI_NET_PROPERTY_FEATURE_USERAGENT,
00164   /* Add new ones below. */
00165 
00166   _QUVI_NET_PROPERTY_FEATURE_NAME_LAST
00169 } QUVInetPropertyFeatureName;
00170 
00171 #ifdef __cplusplus
00172 extern "C" {
00173 #endif /* __cplusplus */
00174 
00189   QUVIcode quvi_net_getprop(quvi_net_t handle, QUVInetProperty property, ...);
00190 
00203   QUVIcode quvi_net_setprop(quvi_net_t handle, QUVInetProperty property, ...);
00204 
00217   QUVIcode quvi_net_getprop_feat(quvi_net_propfeat_t handle, QUVInetPropertyFeature feature, ...);
00218 
00235   char *quvi_net_get_one_prop_feat(quvi_net_t handle, QUVInetPropertyFeatureName feature);
00236 
00247   QUVIcode quvi_net_seterr(quvi_net_t handle, const char *fmt, ...);
00248 
00249 #ifdef __cplusplus
00250 }
00251 #endif /* __cplusplus */
00252  /* End of libquvi_net_if Network interface */
00254 
00255 #endif /* quvi_net_h */
00256 
00257 /* vim: set ts=2 sw=2 tw=72 expandtab: */
 All Files Functions Typedefs Enumerations Enumerator Defines