src/functions.c File Reference

useful functions More...

#include "../include/billigertelefonieren.h"

Include dependency graph for functions.c:


Functions

int numberLength (int number)
 find out how long an integer would be in characters
int numberLengthTime (time_t number)
 find out how long an time_t would be in characters
unsigned int parseCount (char *string)
 how many elements do we have in a comma seperated list?
int parseCSLintoARRAY (char *string, PREFIXARRAY *array, int type)
 parse a comma seperated list into an array
int power (int base, unsigned int exponent)
 calculate the power of a base and a positive exponent
int secondsUntilNextFullHour (int *bMidnight)
 determine amount of seconds until the next full hour
int todayIsHoliday ()
 find out if today is a holiday or a saturday

Detailed Description

useful functions

contains some functions used for string memory allocation, date determination, parsing, ... (c) 2005-2007 Markus Drescher last change: 03.03.07

---------------------------------------------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ----------------------------------------------------------------------------


Function Documentation

int numberLength ( int  number  ) 

find out how long an integer would be in characters

numberLength

Parameters:
number our integer to check
Returns:
length of the number

int numberLengthTime ( time_t  number  ) 

find out how long an time_t would be in characters

numberLengthTime

Parameters:
number our unsigned integer to check
Returns:
length of the number

unsigned int parseCount ( char *  string  ) 

how many elements do we have in a comma seperated list?

parseCount

Parameters:
string string to check for commas
Returns:
count of elements

int parseCSLintoARRAY ( char *  string,
PREFIXARRAY *  array,
int  type 
)

parse a comma seperated list into an array

parseCSLintoARRAY

Parameters:
string string to parse
array the array to be used for parsing
type provider type
Returns:
-1 for failure, else: count of array elements

int power ( int  base,
unsigned int  exponent 
)

calculate the power of a base and a positive exponent

power

Parameters:
base 
exponent 
Returns:
result

int secondsUntilNextFullHour ( int *  bMidnight  ) 

determine amount of seconds until the next full hour

secondsUntilNextFullHour

Parameters:
bMidnight out: will be returned if next hour is midnight or not
Returns:
seconds

int todayIsHoliday (  ) 

find out if today is a holiday or a saturday

todayIsHoliday

Returns:
TRUE if today is a holiday/saturday, FALSE if not

SourceForge.net Logo