/
Crimson2/alias/
Crimson2/area.tmp/
Crimson2/area.tmp/AnomalySpaceDock/
Crimson2/area.tmp/AnomalyStation/
Crimson2/area.tmp/AntHill/
Crimson2/area.tmp/ArcticTerrarium/
Crimson2/area.tmp/BuilderCity/
Crimson2/area.tmp/Dungeon/
Crimson2/area.tmp/MiningDock/
Crimson2/area.tmp/PipeSystem/
Crimson2/area.tmp/RattArea/
Crimson2/area.tmp/RobotFactory/
Crimson2/area.tmp/SilverDale/
Crimson2/area.tmp/StarshipFearless/
Crimson2/area.tmp/StationConduits/
Crimson2/area.tmp/TerrariumAlpha/
Crimson2/area.tmp/TerrariumBeta/
Crimson2/area.tmp/TestArea/
Crimson2/area.tmp/Void/
Crimson2/area/
Crimson2/area/AnomalySpaceDock/
Crimson2/area/AnomalyStation/
Crimson2/area/MiningDock/
Crimson2/area/PipeSystem/
Crimson2/area/SilverDale/
Crimson2/area/StationConduits/
Crimson2/area/Void/
Crimson2/board/
Crimson2/clone/
Crimson2/lib/
Crimson2/mole/
Crimson2/mole/mole_src/HELP/
Crimson2/player/
Crimson2/util/
Crimson2/wldedit/
Crimson2/wldedit/res/
/* all the various macros used by Crimson2 */
/* "log.h" must be included prior to using a few of these */

#define MINV(a,b)\
(\
 ((a) < (b)) ? (a):(b) \
 )

#define MAXV(a,b)\
(\
 ((a) > (b)) ? (a):(b) \
 )

#define BOUNDV(a,b,c)\
(\
 MINV( MAXV(a,b), c ) \
 )

/* absolute value */
#define ABSV(a)\
(\
 ((a) > 0) ? (a):(-1*(a)) \
 )

#define MAXSET(n,max) n=MINV(n,max)
#define MINSET(n,min) n=MAXV(min,n)
#define BOUNDSET(min,n,max) n=BOUNDV(min,n,max)

/* Bit operations */
#define BIT(flag,bit) (((flag)&(bit))==(bit)) /* if all the bits are set */
#define BITANY(flag,bit) ((flag)&(bit)) /* if any bit is set */
#define BITSET(flag,bit) flag|=(bit)
#define BITCLR(flag,bit) flag&=(~(bit))
#define BITFLIP(flag,bit) if (BIT( (flag),(bit) )) BITCLR( (flag),(bit) ); else BITSET( (flag),(bit) )

/* Perror routine */
#define PERROR(routineName) \
do { \
  BYTE buf[256]; \
  sprintf(buf, "%s(%s:%d) ", routineName, __FILE__, __LINE__); \
  perror(buf); \
} while(0)

#ifdef WIN32
  /* Perror routine */
  #define PSOCKETERROR(routineName) \
  do { \
    printf("%s(%s:%d): %s\n", routineName, __FILE__, __LINE__, WSAGetLastErrorString() ); \
  } while(0)

  #define EXIT(error) \
  do { \
    WSACleanup(); \
    exit(error); \
  } while(0)

#else
  /* Unix is just PERROR */
  #define PSOCKETERROR(routineName) PERROR(routineName)

  #define EXIT(error) exit(error)
#endif