Bug #1437: CkLoop worker traces to previous entry on pe rather than
[charm.git] / examples / charm++ / barnes-charm / barnes / stdinc.H
blob27f902a89e67fe94bd96cd12b5f713cfaff58643
1 /*************************************************************************/
2 /*                                                                       */
3 /*  Copyright (c) 1994 Stanford University                               */
4 /*                                                                       */
5 /*  All rights reserved.                                                 */
6 /*                                                                       */
7 /*  Permission is given to use, copy, and modify this software for any   */
8 /*  non-commercial purpose as long as this copyright notice is not       */
9 /*  removed.  All other uses, including redistribution in whole or in    */
10 /*  part, are forbidden without prior written permission.                */
11 /*                                                                       */
12 /*  This software is provided with absolutely no warranty and no         */
13 /*  support.                                                             */
14 /*                                                                       */
15 /*************************************************************************/
18  * STDINC.H: standard include file for C programs.
19  */
21 #ifndef _STDINC_H_
22 #define _STDINC_H_
25  * If not already loaded, include stdio.h.
26  */
28 #include <stdio.h>
31  * STREAM: a replacement for FILE *.
32  */
34 typedef FILE *stream;
37  * NULL: denotes a pointer to no object.
38  */
40 #ifndef NULL
41 #define NULL 0
42 #endif
45  * BOOL, TRUE and FALSE: standard names for logical values.
46  */
48 typedef int bool;
50 #ifndef TRUE
52 #define FALSE 0
53 #define TRUE  1
55 #endif
58  * BYTE: a short name for a handy chunk of bits.
59  */
61 typedef unsigned char byte;
64  * STRING: for null-terminated strings which are not taken apart.
65  */
67 typedef char *string;
70  * REAL: default type is double; 
71  */
73 typedef  double  real, *realptr;
76  * PROC, IPROC, RPROC: pointers to procedures, integer functions, and
77  * real-valued functions, respectively.
78  */
80 typedef void (*proced)();
81 typedef int (*iproc)();
82 typedef real (*rproc)();
85  * LOCAL: declare something to be local to a file.
86  * PERMANENT: declare something to be permanent data within a function.
87  */
89 #define local     static
90 #define permanent static
93  * STREQ: handy string-equality macro.
94  */
96 #define streq(x,y) (strcmp((x), (y)) == 0)
99  *  PI, etc.  --  mathematical constants
100  */
102 #define   PI         3.14159265358979323846
103 #define   TWO_PI     6.28318530717958647693
104 #define   FOUR_PI   12.56637061435917295385
105 #define   HALF_PI    1.57079632679489661923
106 #define   FRTHRD_PI  4.18879020478639098462
109  *  ABS: returns the absolute value of its argument
110  *  MAX: returns the argument with the highest value
111  *  MIN: returns the argument with the lowest value
112  */
114 #define   ABS(x)       (((x) < 0) ? -(x) : (x))
116 #endif