#include <string.h>
Go to the source code of this file.
Defines |
#define | pgm_getchar getchar |
#define | _LOCAL_H_ |
#define | STREQ(s1, s2) (strcmp( s1, s2 ) == 0) |
#define | STREQN(s1, s2, n) (strncmp( s1, s2, n ) == 0) |
#define | STREQNL(s1, s2) (strncmp( s1, s2, strlen(s2) ) == 0) |
#define | IN_RANGE(xx, ll, rr) ((xx)>=(ll)&&(xx)<=(rr)) |
#define | CLAMP(xx, ll, rr) ((xx) = (xx)<(ll)? (ll): (xx)>(rr)? (rr): (xx)) |
#define | SWAP(aa, bb, tt) ( tt = aa, aa = bb, bb = tt ) |
#define | MAX(aa, bb) ((aa)>=(bb)?(aa):(bb)) |
#define | MIN(aa, bb) ((aa)<=(bb)?(aa):(bb)) |
#define | ABS(aa) ((aa)>=0?(aa):-(aa)) |
#define | SQR(aa) ((aa)*(aa)) |
#define | SIGN(aa) ((aa)>=0? 1: -1) |
#define | OK 0 |
#define | ERR -1 |
#define | FALSE 0 |
#define | TRUE 1 |
#define | ON 1 |
#define | OFF 0 |
#define | PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args) |
#define | PDEBUGG(fmt, args...) |
#define | KB 0x400 |
#define | MB 0x100000 |
#define | ASSERT(cond) |
#define | WORKTODO (-1) |
Define Documentation
#define ABS |
( |
|
aa | ) |
((aa)>=0?(aa):-(aa)) |
Value:if ( !(cond) ){ \
fprintf( stderr, "ASSERTION: %s %d",__FILE__,__LINE__ );\
exit( 1 );\
}
Definition at line 394 of file local.h.
#define CLAMP |
( |
|
xx, |
|
|
|
ll, |
|
|
|
rr |
|
) |
| ((xx) = (xx)<(ll)? (ll): (xx)>(rr)? (rr): (xx)) |
#define IN_RANGE |
( |
|
xx, |
|
|
|
ll, |
|
|
|
rr |
|
) |
| ((xx)>=(ll)&&(xx)<=(rr)) |
#define MAX |
( |
|
aa, |
|
|
|
bb |
|
) |
| ((aa)>=(bb)?(aa):(bb)) |
#define MIN |
( |
|
aa, |
|
|
|
bb |
|
) |
| ((aa)<=(bb)?(aa):(bb)) |
#define PDEBUG |
( |
|
fmt, |
|
|
|
args... |
|
) |
| fprintf(stderr, fmt, ## args) |
#define PDEBUGG |
( |
|
fmt, |
|
|
|
args... |
|
) |
| |
#define pgm_getchar getchar |
#define SIGN |
( |
|
aa | ) |
((aa)>=0? 1: -1) |
#define SQR |
( |
|
aa | ) |
((aa)*(aa)) |
#define STREQ |
( |
|
s1, |
|
|
|
s2 |
|
) |
| (strcmp( s1, s2 ) == 0) |
#define STREQN |
( |
|
s1, |
|
|
|
s2, |
|
|
|
n |
|
) |
| (strncmp( s1, s2, n ) == 0) |
#define STREQNL |
( |
|
s1, |
|
|
|
s2 |
|
) |
| (strncmp( s1, s2, strlen(s2) ) == 0) |
#define SWAP |
( |
|
aa, |
|
|
|
bb, |
|
|
|
tt |
|
) |
| ( tt = aa, aa = bb, bb = tt ) |