My Project: parser.h File Reference

My Project

- Main Page
- Files

- File List
- File Members

All Files Functions Macros
Macros | Functions
parser.h File Reference

Functions to parse arguments from user. More...

Go to the source code of this file.

## Macros

#define | FREE_INTS(p) free_ints(p); p=NULL;
| Frees the memory allocated by strings_to_ints and sets the pointer to NULL. More...

## Functions

int * | strings_to_ints (int size, char **int_strings)
| Given an 'array' of int in string format, this function returns a list of intgers. More...
void | free_ints (int *p)
| Frees the memory allocated by strings_to_ints. More...

## Detailed Description

Functions to parse arguments from user.

Author
  Henrik Sandklef

Date
  25 Nov 2015

## Macro Definition Documentation

#define FREE_INTS | ( |  | p | ) | free_ints(p); p=NULL;

Frees the memory allocated by strings_to_ints and sets the pointer to NULL.

Parameters

  int | *p - memory to free

## Function Documentation

void free_ints | ( | int * | p | ) |

Frees the memory allocated by strings_to_ints.

Parameters

  int | *p - memory to free

int* strings_to_ints | ( | int | size,
|  | char ** | int_strings
| ) |  |

Given an 'array' of int in string format, this function returns a list of intgers.

Warning
  { This function allocates dynamically. Make sure you free the memory }

Parameters

  int | size - number of arguments in
  int | int_strings - integers in string format

Returns
  `Pointer` to int (an 'array')