StreamLinkforC  7.0.3-308369
Advanced functionality

Functions

int sl_get_serviceurl (streamlink *client, const char *service_name, sl_fieldlist *user_params, char **url_ptr, char **body_ptr)
 Obtain a URL and HTTP post body for a service hosted on the Liberator. More...
 
void sl_set_allocator (void *(*malloc_func)(size_t size), void *(*realloc_func)(void *orig, size_t size), void(*free_func)(void *))
 Set the allocator that will be used by the library. More...
 
char * sl_strdup (const char *orig)
 Duplicate the supplied string. More...
 
void * sl_calloc (size_t nmemb, size_t size)
 Allocate and zero an array of elements. More...
 
void * sl_malloc (size_t size)
 Allocate a chunk of memory. More...
 
void * sl_realloc (void *orig, size_t size)
 Reallocate the supplied memory. More...
 
void sl_free (void *block)
 Free the supplied memory block. More...
 

Detailed Description

Function Documentation

void* sl_calloc ( size_t  nmemb,
size_t  size 
)

Allocate and zero an array of elements.

Parameters
nmemb- Number of elements
size- Size of each element
Returns
The zeroed array
void sl_free ( void *  block)

Free the supplied memory block.

Parameters
block- Memory block to release
int sl_get_serviceurl ( streamlink client,
const char *  service_name,
sl_fieldlist user_params,
char **  url_ptr,
char **  body_ptr 
)

Obtain a URL and HTTP post body for a service hosted on the Liberator.

Parameters
client- The streamlink client
service_name- The servicename to create the parameters for (for example "blotterexport")
user_params- Parameters that should be used to build the URL and post body
url_ptr- Pointer to where the URL will be placed
body_ptr- Pointer to where trhe body will be placed
Note
You should free the contents of url_ptr and body_ptr after use using sl_free()

This function can be used to obtain to interact with the blotterexport service hosted by the Liberator.

void* sl_malloc ( size_t  size)

Allocate a chunk of memory.

Parameters
size- Amount of memory to allocate
Returns
The allocated memory
void* sl_realloc ( void *  orig,
size_t  size 
)

Reallocate the supplied memory.

Parameters
orig- The original memory block (may be NULL)
size- New size of the memory block
Returns
The allocated memory
void sl_set_allocator ( void *(*)(size_t size)  malloc_func,
void *(*)(void *orig, size_t size)  realloc_func,
void(*)(void *)  free_func 
)

Set the allocator that will be used by the library.

Parameters
malloc_func- Function for malloc()
realloc_func- Function for realloc()
free_func- Function for free()

By default the library will use the standard library allocation functions, you can use this function to redirect all memory usage by the library to a custom implementation.

char* sl_strdup ( const char *  orig)

Duplicate the supplied string.

Parameters
orig- The string to duplicate
Returns
A duplicate of orig

This function will use the allocation routines set using sl_set_allocator() to duplicate the supplied string


Generated on Tue Oct 16 2018 12:25:43 for StreamLinkforC