OC Updated for version 2.0
Functions
Miscellaneous Procedures

Functions

const char * oc_errstring (OCerror err)
const char * oc_clientparam_get (OCobject link, const char *param)
OCerror oc_svcerrordata (OCobject link, char **codep, char **msgp, long *httpp)

Function Documentation

const char* oc_clientparam_get ( OCobject  link,
const char *  param 
)

Each OClink object maintains a table of (name,value) pairs, called client parameters. It is initialized from any such parameters specified in the URL given as argument to oc_open().

Parameters:
[in]linkThe link through which the server is accessed.
[in]paramThe name of the parameter whose value is desired.
Returns:
The corresponding value, or NULL if parameter name is not in the table.

Definition at line 1401 of file oc.c.

References OCDEREF, and OCVERIFYX.

const char* oc_errstring ( OCerror  err)

Return a user-readable error message corresponding to a given OCerror value.

Parameters:
[in]errThe OCerror value.
Returns:
The error message

Definition at line 1382 of file oc.c.

OCerror oc_svcerrordata ( OCobject  link,
char **  codep,
char **  msgp,
long *  httpp 
)

Sometimes, when a fetch request fails, there will be error information in the reply from the server. Typically this only occurs if an API operation returns OC_EDAS, OC_EDDS, OC_EDATADDS, or OC_EDAPSVC. This procedure will attempt to locate and return information from such an error reply.

The error reply contains three pieces of information.

  1. code - a string representing a numeric error code.
  2. msg - a string representing an extended error message.
  3. http - an integer representing an HTTP error return (e.g. 404).
Parameters:
[in]linkThe link through which the server is accessed.
[in]codepA pointer for returning the error code.
[in]msgpA pointer for returning the error message.
[in]httppA pointer for returning the HTTP error number.
Return values:
OC_NOERRif an error was found and the return values are defined.
OtherErrorif no error reply could be found, so the return values are meaningless.

Definition at line 1486 of file oc.c.

References OCDEREF, and OCVERIFY.