libdeltacloud 0.9
Defines | Functions
src/libdeltacloud.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <pthread.h>
#include "libdeltacloud.h"
#include "common.h"
#include "curl_action.h"

Functions

struct deltacloud_errordeltacloud_get_last_error (void)
const char * deltacloud_get_last_error_string (void)
int deltacloud_initialize (struct deltacloud_api *api, char *url, char *user, char *password)
int deltacloud_prepare_parameter (struct deltacloud_create_parameter *param, const char *name, const char *value)
struct
deltacloud_create_parameter
deltacloud_allocate_parameter (const char *name, const char *value)
void deltacloud_free_parameter_value (struct deltacloud_create_parameter *param)
void deltacloud_free_parameter (struct deltacloud_create_parameter *param)
int deltacloud_has_link (struct deltacloud_api *api, const char *name)
void deltacloud_free (struct deltacloud_api *api)

Detailed Description


Function Documentation

struct deltacloud_create_parameter* deltacloud_allocate_parameter ( const char *  name,
const char *  value 
) [read]

A function to allocate and prepare a deltacloud_create_parameter structure for use. A deltacloud_create_parameter structure is used as an optional input parameter to one of the deltacloud_create functions. It is up to the caller to free the structure with deltacloud_free_parameter().

Parameters:
[in]nameThe name to assign to the deltacloud_create_parameter structure
[in]valueThe value to assign to the deltacloud_create_parameter structure
Returns:
A newly allocated deltacloud_create_parameter structure on success, NULL on error
void deltacloud_free ( struct deltacloud_api api)

A function to free up a deltacloud_api structure originally configured through deltacloud_initialize().

Parameters:
[in]apiThe deltacloud_api structure to free
void deltacloud_free_parameter ( struct deltacloud_create_parameter param)

A function to free a deltacloud_create_parameter structure (typically allocated by deltacloud_allocate_parameter()).

Parameters:
[in]paramThe deltacloud_create_parameter to free
void deltacloud_free_parameter_value ( struct deltacloud_create_parameter param)

A function to free the memory assigned to a deltacloud_create_parameter structure (typically by deltacloud_prepare_parameter()).

Parameters:
[in]paramThe deltacloud_create_parameter structure to free memory from
struct deltacloud_error* deltacloud_get_last_error ( void  ) [read]

A function to get a pointer to the deltacloud_error structure corresponding to the last failure. The results of this are undefined if no error occurred. As the pointer is to thread-local storage that libdeltacloud manages, the caller should not attempt to free the structure.

Returns:
A deltacloud_error structure corresponding to the last failure
const char* deltacloud_get_last_error_string ( void  )

A function to get the details (as a string) corresponding to the last failure. The results of this are undefined if no error occurred. As the string is to thread-local storage that libdeltacloud manages, the caller should not attempt to free the string.

Returns:
A string description of the last failure
int deltacloud_has_link ( struct deltacloud_api api,
const char *  name 
)

A function to determine if the deltacloud_api structure contains a particular link. This can be used to determine if the deltacloud server on the other end supports certain features.

Parameters:
[in]apiThe deltacloud_api structure representing this connection
[in]nameThe feature to find
Returns:
1 if the feature is supported, 0 if the feature is not supported, and -1 on error
int deltacloud_initialize ( struct deltacloud_api api,
char *  url,
char *  user,
char *  password 
)

The main API entry point. All users of the library must call this function first to initialize the library. The caller must free the deltacloud_api structure using deltacloud_free() when finished.

Parameters:
[in,out]apiThe api structure
[in]urlThe url to the deltacloud server
[in]userThe username required to connect to the deltacloud server
[in]passwordThe password required to connect to the deltacloud server
Returns:
0 on success, -1 on error
int deltacloud_prepare_parameter ( struct deltacloud_create_parameter param,
const char *  name,
const char *  value 
)

A function to prepare a deltacloud_create_parameter structure for use. A deltacloud_create_parameter structure is used as an optional input parameter to one of the deltacloud_create functions. It is up to the caller to free the memory allocated to the structure with deltacloud_free_parameter_value().

Parameters:
[in,out]paramThe deltacloud_create_parameter structure to prepare for use
[in]nameThe name to assign to the deltacloud_create_parameter structure
[in]valueThe value to assign to the deltacloud_create_parameter structure
Returns:
0 on success, -1 on error
 All Data Structures Files Functions Variables