RAPICAM_3-15-2015
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include "interface/vcos/vcos.h"
#include "RaspiCLI.h"
Functions | |
int | raspicli_get_command_id (const COMMAND_LIST *commands, const int num_commands, const char *arg, int *num_parameters) |
void | raspicli_display_help (const COMMAND_LIST *commands, const int num_commands) |
int | raspicli_map_xref (const char *str, const XREF_T *map, int num_refs) |
const char * | raspicli_unmap_xref (const int en, XREF_T *map, int num_refs) |
Code for handling command line parameters
Description
Some functions/structures for command line parameter parsing
void raspicli_display_help | ( | const COMMAND_LIST * | commands, |
const int | num_commands | ||
) |
Display the list of commands in help format
commands | Array of command to check |
num_command | Number of commands in the arry |
int raspicli_get_command_id | ( | const COMMAND_LIST * | commands, |
const int | num_commands, | ||
const char * | arg, | ||
int * | num_parameters | ||
) |
Convert a string from command line to a comand_id from the list
commands | Array of command to check |
num_command | Number of commands in the array |
arg | String to search for in the list |
num_parameters | Returns the number of parameters used by the command |
int raspicli_map_xref | ( | const char * | str, |
const XREF_T * | map, | ||
int | num_refs | ||
) |
Function to take a string, a mapping, and return the int equivalent
str | Incoming string to match |
map | Mapping data |
num_refs | The number of items in the mapping data |
const char* raspicli_unmap_xref | ( | const int | en, |
XREF_T * | map, | ||
int | num_refs | ||
) |
Function to take a mmal enum (as int) and return the string equivalent
en | Incoming int to match |
map | Mapping data |
num_refs | The number of items in the mapping data |