File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / trafshow / standard.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 16:55:18 2012 UTC (12 years, 4 months ago) by misho
Branches: trafshow, MAIN
CVS tags: v5_2_3p0, v5_2_3, HEAD
trafshow

    1: /*
    2: ------------------------------------------------------------------------------
    3: Standard definitions and types, Bob Jenkins
    4: ------------------------------------------------------------------------------
    5: */
    6: #ifndef STANDARD
    7: # define STANDARD
    8: # ifndef STDIO
    9: #  include <stdio.h>
   10: #  define STDIO
   11: # endif
   12: # ifndef STDDEF
   13: #  include <stddef.h>
   14: #  define STDDEF
   15: # endif
   16: typedef  unsigned long long  ub8;
   17: #define UB8MAXVAL 0xffffffffffffffffLL
   18: #define UB8BITS 64
   19: typedef    signed long long  sb8;
   20: #define SB8MAXVAL 0x7fffffffffffffffLL
   21: typedef  unsigned long  int  ub4;   /* unsigned 4-byte quantities */
   22: #define UB4MAXVAL 0xffffffff
   23: typedef    signed long  int  sb4;
   24: #define UB4BITS 32
   25: #define SB4MAXVAL 0x7fffffff
   26: typedef  unsigned short int  ub2;
   27: #define UB2MAXVAL 0xffff
   28: #define UB2BITS 16
   29: typedef    signed short int  sb2;
   30: #define SB2MAXVAL 0x7fff
   31: typedef  unsigned       char ub1;
   32: #define UB1MAXVAL 0xff
   33: #define UB1BITS 8
   34: typedef    signed       char sb1;   /* signed 1-byte quantities */
   35: #define SB1MAXVAL 0x7f
   36: typedef                 int  word;  /* fastest type available */
   37: 
   38: #define bis(target,mask)  ((target) |=  (mask))
   39: #define bic(target,mask)  ((target) &= ~(mask))
   40: #define bit(target,mask)  ((target) &   (mask))
   41: #ifndef min
   42: # define min(a,b) (((a)<(b)) ? (a) : (b))
   43: #endif /* min */
   44: #ifndef max
   45: # define max(a,b) (((a)<(b)) ? (b) : (a))
   46: #endif /* max */
   47: #ifndef align
   48: # define align(a) (((ub4)a+(sizeof(void *)-1))&(~(sizeof(void *)-1)))
   49: #endif /* align */
   50: #ifndef abs
   51: # define abs(a)   (((a)>0) ? (a) : -(a))
   52: #endif
   53: #define TRUE  1
   54: #define FALSE 0
   55: #define SUCCESS 0  /* 1 on VAX */
   56: 
   57: #endif /* STANDARD */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>