libtrbase  1.0.2
Web server and task management solution.
commons.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define Bool   char
 
#define TRUE   1
 
#define FALSE   0
 
#define MAX(a, b)   ((a)>(b)? (a) : (b))
 
#define MIN(a, b)   ((a)<(b)? (a) : (b))
 
#define SWAP_XOR(a, b)   ((a)^=(b),(b)^=(a),(a)^=(b))
 
#define SWAP(type, a, b)
 
#define CSTRA(val)   val, sizeof(val)-1
 Const STRing Argument. More...
 

Detailed Description

Common reusable definitions.

Todo:
All public symbols need to be prefixed to make name clashes more unlikely.
Author
Georg Hopp

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 3 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, see http://www.gnu.org/licenses/.

Definition in file commons.h.

Macro Definition Documentation

#define Bool   char

Definition at line 30 of file commons.h.

#define CSTRA (   val)    val, sizeof(val)-1

Const STRing Argument.

Const STRing Argument This makro evaluates to two function argument.

Parameters
char*val A NULL terminated static string.

Definition at line 69 of file commons.h.

#define FALSE   0

Definition at line 39 of file commons.h.

#define MAX (   a,
 
)    ((a)>(b)? (a) : (b))

Definition at line 42 of file commons.h.

#define MIN (   a,
 
)    ((a)<(b)? (a) : (b))

Definition at line 46 of file commons.h.

#define SWAP (   type,
  a,
 
)
Value:
do { \
type tmp = (a); \
(a) = (b); \
(b) = tmp; \
} while(0);

swap two variable through an intermediate.

Definition at line 57 of file commons.h.

#define SWAP_XOR (   a,
 
)    ((a)^=(b),(b)^=(a),(a)^=(b))

XOR variant of swapping a variable

Definition at line 52 of file commons.h.

Referenced by TR_euklidGcd().

#define TRUE   1

Definition at line 38 of file commons.h.