Barrelfish
Functions
args.h File Reference

Argument processing for distributed services. More...

Functions

struct dist_args process_dist_args (int *argc, char **argv[])
 Process and return the generic distributed service command-line arguments. More...
 
char * list_to_string (coreid_t list[], size_t l_len)
 Convert an array of coreids into a string representation of the list. More...
 

Detailed Description

Argument processing for distributed services.

Function Documentation

char* list_to_string ( coreid_t  list[],
size_t  l_len 
)

Convert an array of coreids into a string representation of the list.

The string looks like: "1,2,3,". This function mallocs the memory for the string. The calelr is therefore responsible for freeing it.

Parameters
listthe list to convert.
l_lenthe number of elements in the list.
Returns
The string representation of the list. This function mallocs the memory for the string. The caller is therefore responsible for freeing it.
struct dist_args process_dist_args ( int *  argc,
char **  argv[] 
)

Process and return the generic distributed service command-line arguments.

The generic distributed service command-line arguments are processed, and appropriate values set in the return struct. In particular, this procedire creates and returns a list of cores to start the service on based on the arguments and possibly querying the SKB.

After processing argc and argv are modified so that argv points to all un-recognised arguments. In this way, service-specific arguments can still be processed separately.

Parameters
argca pointer to argc as passed to main(). argc will be modified.
argvargv as passed to main(). argv will be modified.
Returns
A struct containing the values of the processed arguments. The list elements of the struct are malloced (and so must be freed by the caller), but the path element is not.