Manager


Data Structures

struct  libnfsnapi_mgr_t

Functions

libnfsnapi_mgr_tlibnfsnapi_mgr_create (const char *login, const char *api_key, int *error_out)
void libnfsnapi_mgr_destroy (libnfsnapi_mgr_t *mgr)
int libnfsnapi_mgr_error (libnfsnapi_mgr_t *mgr)
const char * libnfsnapi_mgr_strerror (libnfsnapi_mgr_t *mgr)
void libnfsnapi_mgr_set_timenudge (libnfsnapi_mgr_t *mgr, int nudge)

Detailed Description

Example usage:
        libnfsnapi_mgr_t *mgr;
                ...
        mgr = libnfsnapi_mgr_create("testuser", "p3kxmRKf9dk3l6ls");
                ...
        libnfsnapi_mgr_destroy(mgr);

Function Documentation

libnfsnapi_mgr_t* libnfsnapi_mgr_create const char *  login,
const char *  api_key,
int *  error_out
 

Create a Manager object, used for accessing the NFSN API.

This should only ever fail on malloc failure. It could fail whilst initialising libcurl, but that's pretty unlikely.

Parameters:
login Your NFSN member name. It will be copied internally.
api_key Your NFSN-issued API key. It will be copied internally.
error_out If not NULL, and an error occurs, an error code will be stored at this memory location (see libnfsnapi_error_t).
Returns:
A Manager object, or NULL on failure.

Definition at line 24 of file mgr.c.

References LIBNFSNAPI_ERROR_LIBCURL, LIBNFSNAPI_ERROR_MEMORY, and libnfsnapi_mgr_destroy().

Here is the call graph for this function:

void libnfsnapi_mgr_destroy libnfsnapi_mgr_t mgr  ) 
 

Destroy a Manager object, and free all memory associated with it. Do not use this pointer after calling this function.

Definition at line 112 of file mgr.c.

Referenced by libnfsnapi_mgr_create().

int libnfsnapi_mgr_error libnfsnapi_mgr_t mgr  ) 
 

Return the error code for the last failure associated with this Manager object. This will only be a sensible value if a libNFSNapi call actually indicated failure to its caller somehow.

See also:
Error handling

Definition at line 129 of file mgr.c.

const char* libnfsnapi_mgr_strerror libnfsnapi_mgr_t mgr  ) 
 

Convenience function. Equivalent to libnfsnapi_strerror(libnfsnapi_mgr_error(mgr))

Definition at line 134 of file mgr.c.

References libnfsnapi_strerror().

Here is the call graph for this function:

void libnfsnapi_mgr_set_timenudge libnfsnapi_mgr_t mgr,
int  nudge
 

Set the time nudge for this Manager object.

Interfacing with the NFSN API requires a timestamp to be used, and it must be accurate to within 5 seconds. Ideally, the client of this library would be running on a machine with an NTP-synchronised clock. However, if that is not possible or desired, the time nudge setting can be used to artificially alter the generated timestamp.

Parameters:
mgr The Manager object.
nudge Number of seconds to add to each generated timestamp.

Definition at line 139 of file mgr.c.


Generated on Sat Jan 13 17:42:28 2007 for libNFSNapi by  doxygen 1.4.6