Typedefs | Enumerations | Functions
Network interface

Typedefs

typedef void * quvi_net_t
 Network handle.
typedef void * quvi_net_propfeat_t
 Network property feature handle.
typedef int(* quvi_callback_fetch )(quvi_net_t)
 Fetch callback function.
typedef int(* quvi_callback_resolve )(quvi_net_t)
 Resolve callback function.
typedef int(* quvi_callback_verify )(quvi_net_t)
 Verify callback function.

Enumerations

enum  QUVInetProperty {
  QUVI_NET_PROPERTY_NONE = 0x00, QUVI_NET_PROPERTY_URL = QUVIPROPERTY_STRING + 1, QUVI_NET_PROPERTY_REDIRECTURL = QUVIPROPERTY_STRING + 2, QUVI_NET_PROPERTY_CONTENT = QUVIPROPERTY_STRING + 3,
  QUVI_NET_PROPERTY_CONTENTTYPE = QUVIPROPERTY_STRING + 4, QUVI_NET_PROPERTY_CONTENTLENGTH = QUVIPROPERTY_DOUBLE + 5, QUVI_NET_PROPERTY_RESPONSECODE = QUVIPROPERTY_LONG + 6, QUVI_NET_PROPERTY_FEATURES = QUVIPROPERTY_VOID + 7,
  _QUVI_NET_PROPERTY_LAST = 7
}
enum  QUVInetPropertyFeature { QUVI_NET_PROPERTY_FEATURE_NONE = 0x00, QUVI_NET_PROPERTY_FEATURE_NAME = QUVIPROPERTY_STRING + 1, QUVI_NET_PROPERTY_FEATURE_VALUE = QUVIPROPERTY_STRING + 2, _QUVI_NET_PROPERTY_FEATURE_LAST = 2 }
enum  QUVInetPropertyFeatureName { QUVI_NET_PROPERTY_FEATURE_NAME_NONE = 0x00, QUVI_NET_PROPERTY_FEATURE_ARBITRARYCOOKIE, QUVI_NET_PROPERTY_FEATURE_USERAGENT, _QUVI_NET_PROPERTY_FEATURE_NAME_LAST }

Functions

QUVIcode quvi_net_getprop (quvi_net_t handle, QUVInetProperty property,...)
 Get network property.
QUVIcode quvi_net_setprop (quvi_net_t handle, QUVInetProperty property,...)
 Set network property.
QUVIcode quvi_net_getprop_feat (quvi_net_propfeat_t handle, QUVInetPropertyFeature feature,...)
 Get network property feature.
char * quvi_net_get_one_prop_feat (quvi_net_t handle, QUVInetPropertyFeatureName feature)
 Convenience function that wraps quvi_net_getprop_feat()
QUVIcode quvi_net_seterr (quvi_net_t handle, const char *fmt,...)
 Set network error message.

Detailed Description

The network interface allows overriding the default use of libcurl in libquvi.

Since:
0.2.16

Typedef Documentation

typedef void* quvi_net_t

Network handle.

Since:
0.2.16
typedef void* quvi_net_propfeat_t

Network property feature handle.

Since:
0.2.16
Examples:
callback_libsoup.c.

Fetch callback function.

Called by the library when it attempts to fetch an URL.

Note:
  • Must set QUVI_NET_PROPERTY_CONTENT
  • Must set QUVI_NET_PROPERTY_RESPONSECODE
  • Must return QUVI_OK or QUVI_CALLBACK if error occurred
See also:
quvi_net_getprop
Since:
0.2.16

Resolve callback function.

Called by the library when it attempts to resolve an URL to a another location.

Note:
  • Must set QUVI_NET_PROPERTY_REDIRECTURL if new location was found
  • Must set QUVI_NET_PROPERTY_RESPONSECODE
  • Must return QUVI_OK or QUVI_CALLBACK if error occurred
See also:
quvi_net_getprop
Since:
0.2.16

Verify callback function.

Called by the library when it attempts to verify a media stream URL.

Note:
  • Must set QUVI_NET_PROPERTY_CONTENTTYPE
  • Must set QUVI_NET_PROPERTY_CONTENTLENGTH
  • Must set QUVI_NET_PROPERTY_RESPONSECODE
  • Must return QUVI_OK or QUVI_CALLBACK if error occurred
See also:
quvi_net_getprop
Since:
0.2.16

Enumeration Type Documentation

Property codes

Since:
0.2.16
Enumerator:
QUVI_NET_PROPERTY_NONE 

Unused

QUVI_NET_PROPERTY_URL 

URL (Null-terminated string)

QUVI_NET_PROPERTY_REDIRECTURL 

URL to another location (Null-terminated string)

QUVI_NET_PROPERTY_CONTENT 

Content (Null-terminated string)

QUVI_NET_PROPERTY_CONTENTTYPE 

Content-type parsed from the returned HTTP header (Null-terminated string)

QUVI_NET_PROPERTY_CONTENTLENGTH 

Content-length parsed from the returned HTTP header (long)

QUVI_NET_PROPERTY_RESPONSECODE 

Response code returned by the server (long)

QUVI_NET_PROPERTY_FEATURES 

Network features, e.g. arbitrary cookie, etc. (Pointer to a linked list)

See also:
quvi_llst_next
quvi_llst_data
_QUVI_NET_PROPERTY_LAST 

Placeholder

Property feature codes

Since:
0.2.16
Enumerator:
QUVI_NET_PROPERTY_FEATURE_NONE 

Unused

QUVI_NET_PROPERTY_FEATURE_NAME 

Name of the property feature (Null-terminated string)

QUVI_NET_PROPERTY_FEATURE_VALUE 

Value of the property feature (Null-terminated string)

_QUVI_NET_PROPERTY_FEATURE_LAST 

Placeholder

enum QUVInetPropertyFeatureName Property feature names

Since:
0.2.16
Enumerator:
QUVI_NET_PROPERTY_FEATURE_NAME_NONE 

Unused

QUVI_NET_PROPERTY_FEATURE_ARBITRARYCOOKIE 

Arbitrary cookie

QUVI_NET_PROPERTY_FEATURE_USERAGENT 

User-agent

_QUVI_NET_PROPERTY_FEATURE_NAME_LAST 

Placeholder


Function Documentation

QUVIcode quvi_net_getprop ( quvi_net_t  handle,
QUVInetProperty  property,
  ... 
)

Get network property.

Parameters:
handleNetwork handle
propertyProperty ID
...Parameter
Returns:
Non-zero if an error occurred
Warning:
Do not attempt to free the memory returned by this function
See also:
QUVInetProperty
Since:
0.2.16
Examples:
callback_libsoup.c.
QUVIcode quvi_net_setprop ( quvi_net_t  handle,
QUVInetProperty  property,
  ... 
)

Set network property.

Parameters:
handleNetwork handle
propertyProperty ID
...Parameter
Returns:
Non-zero if an error occurred
See also:
QUVInetProperty
Since:
0.2.16
Examples:
callback_libsoup.c.
QUVIcode quvi_net_getprop_feat ( quvi_net_propfeat_t  handle,
QUVInetPropertyFeature  feature,
  ... 
)

Get network property feature.

Parameters:
handleNetwork property feature handle
featureFeature ID
...Parameter
Returns:
Non-zero if an error occurred
See also:
QUVInetPropertyFeature
Since:
0.2.16
Examples:
callback_libsoup.c.
char* quvi_net_get_one_prop_feat ( quvi_net_t  handle,
QUVInetPropertyFeatureName  feature 
)

Convenience function that wraps quvi_net_getprop_feat()

Parameters:
handleNetwork handle
featureFeature name ID
Returns:
Null-terminated string or NULL
Warning:
Do not attempt to free the memory returned by this function
Note:
Returns the first matching result
See also:
quvi_llst_next
quvi_llst_data
Since:
0.2.16
Examples:
callback_libsoup.c.
QUVIcode quvi_net_seterr ( quvi_net_t  handle,
const char *  fmt,
  ... 
)

Set network error message.

Parameters:
handleNetwork handle
fmtFormat string
...Parameter
Returns:
Non-zero if an error occurred
Since:
0.2.16
Examples:
callback_libsoup.c.
 All Files Functions Typedefs Enumerations Enumerator Defines