Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

misc.h File Reference

miscellaneous utility functions. More...

#include "common.h"
#include <stdio.h>

Include dependency graph for misc.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define MAX(a, b)   (((a) >= (b)) ? (a) : (b))
 returns the maximum of two values (alias for MAX2()).

#define MAX2(a, b)   (MAX((a), (b)))
 returns the maximum of two values.

#define MAX3(a, b, c)   (MAX2(MAX2((a), (b)), (c)))
 returns the maximum of three values.

#define MAX4(a, b, c, d)   (MAX2(MAX3((a), (b), (c)), (d)))
 returns the maximum of four values.

#define MIN(a, b)   MIN2(a, b)
 evaluates to the smaller of two comparable objects.

#define MIN2(a, b)   (((a) < (b))? (a): (b))
 evaluates to the smaller of two comparable objects.

#define MIN3(a, b, c)   MIN2(a, MIN2(b, c))
 evaluates to the smallest of three comparable objects.

#define MIN4(a, b, c, d)   MIN2(a, MIN3(b, c, d))
 evaluates to the smallest of four comparable objects.


Functions

int getNextValue (int *beg, int *end, unsigned int from, const char *str)
 Returns the next key seperatet by space chars of the passed str beginning at "from". More...

char * getLine (FILE *file)
 Returns a single line from FILE* file. More...


Detailed Description

miscellaneous utility functions.

Definition in file misc.h.


Function Documentation

char* getLine FILE *    file
 

Returns a single line from FILE* file.

Parameters:
file  the file stream, from which the line is extracted
this is a trivial function, which extracts a line (finished by '
') and returns it (a char* to it).

Returns:
the line extracted, if none could be read, a zero length line is returned

Referenced by mimeInit(), and readConfigFile().

int getNextValue int *    beg,
int *    end,
unsigned int    from,
const char *    str
 

Returns the next key seperatet by space chars of the passed str beginning at "from".

Parameters:
beg  returns the first valid char
end  returns the last! valid char (not the one after it)
from  pos in str, from where to check
str  the string to check
beg and *end and from are relative to str!!

Returns:
0 on success, -1 otherwise

Referenced by htMthdParse(), and mimeInit().


Generated on Fri Jan 25 22:40:53 2002 for PDepp Webserver by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001