tool_utils.h File Reference

Miscellaneous helpful functions. More...

#include <inttypes.h>
#include <stdbool.h>

Go to the source code of this file.

Defines

#define _TIFA_TOOL_UTILS_H_

Functions

bool is_a_number (const char *const str_n, uint32_t length)
 Does a string str_n read as a number?
void chomp (char *const str_n, uint32_t length)
 NULL terminates a string.


Detailed Description

Miscellaneous helpful functions.

Author:
Jerome Milan
Date:
Fri Jun 10 2011
Version:
2011-06-10
Miscellaneous functions used by the "tool programs".

Definition in file tool_utils.h.


Define Documentation

#define _TIFA_TOOL_UTILS_H_

Standard include guard.

Definition at line 35 of file tool_utils.h.


Function Documentation

void chomp ( char *const   str_n,
uint32_t  length 
)

NULL terminates a string.

NULL terminates the string str_n at the first occurence of a newline encountered. If no newline is found str_n is left unchanged.

Note:
This function is actually quite different from the Perl builtin chomp function. It's name should probably be changed to avoid possible confusion.
Parameters:
[in] str_n The string to NULL terminate.
[in] length The maximum length of the string to check.

bool is_a_number ( const char *const   str_n,
uint32_t  length 
)

Does a string str_n read as a number?

Returns true if the string str_n represents a number in the decimal base, false otherwise.

Parameters:
[in] str_n The string to check.
[in] length The maximum length of the string to check.


Generated on Fri Jun 17 11:10:12 2011 for TIFA by Doxygen 1.5.5