helpers.c File Reference

#include "common.h"
#include "pam_kmux.h"
#include "helpers.h"
#include "pam_kmux_options.h"
Include dependency graph for helpers.c:

Functions

char * upper_case (const char *string)
 Transform to uppercase.
bool result_expected (const char *query)
 Find out if a result is expected.
char * trim (const char *string)
 Trim whitespaces.
char * i_to_a (int value)
 Convert integer to string.
size_t i_to_a_len (int value)
 Determine resulting string length which will be needed to convert value into a string.
void sec_free (void *p)
 Secure free previously allocated space.

Detailed Description

Implementation of helper function. This file contains the implementation function of usefull helper functions.

Author:
Julian Thome
Date:
2009-11-11

Function Documentation

char* i_to_a ( int  value  ) 

Convert integer to string.

This function creates a character array contains the given string as string.

Return values:
char* The resulting string.
NULL Something went wrong.
size_t i_to_a_len ( int  value  ) 

Determine resulting string length which will be needed to convert value into a string.

This function determines the length of a string which should contains value.

Returns:
size_t The length of the string if everythin is ok.
bool result_expected ( const char *  query  ) 

Find out if a result is expected.

This function finds out if query is a select statement or not.

Parameters:
query Char array to scan.
Return values:
true Statement is a select statement.
false Statement is not a select statement.
void sec_free ( void *  p  ) 

Secure free previously allocated space.

This function calls free but also set the given pointer to NULL.

Parameters:
p Pointer who references allocated space that sould be deallocated.
Returns:
Nothing to return.
char* trim ( const char *  string  ) 

Trim whitespaces.

This function deletes all whitespaces in the character array.

Parameters:
string Character Array which will be processed.
Return values:
char* Trimmed string if everything is ok.
NULL Something went wrong.
char* upper_case ( const char *  string  ) 

Transform to uppercase.

This function transform a given character array to uppercase.

Parameters:
string Char array which should be transformed to uppercase.
Return values:
char* Successfully transform string to uppercase.
NULL Something went wrong.
Generated on Mon Apr 5 22:28:48 2010 for pam_kmux by  doxygen 1.6.3