source: trunk/include/global_msg.h @ 5054

Revision 1987, 3.6 KB checked in by friberg, 13 years ago (diff)

Added in global_*.h files from the hydra release. These are used by
some of the CERI modules.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE
3 *   CHECKED IT OUT USING THE COMMAND CHECKOUT.
4 *
5 *    $Id$
6 *
7 *    Revision history:
8 *     $Log$
9 *     Revision 1.1  2005/08/15 18:35:58  friberg
10 *     Added in global_*.h files from the hydra release. These are used by
11 *     some of the CERI modules.
12 *
13 *     Revision 1.1.1.1  2004/03/31 18:43:18  michelle
14 *     New Hydra Import
15 *
16 *     Revision 1.2  2003/09/04 20:44:58  lucky
17 *      Replaced AMPLITUDE_TYPE with MAGNITUDE_TYPE
18 *
19 *     Revision 1.1  2003/09/03 15:29:40  lucky
20 *     Initial revision
21 *
22 *     Revision 1.5  2002/11/03 00:08:42  lombard
23 *     Added earthworm RCS header
24 *
25 *
26 *
27 */
28/*
29**
30*/
31#ifndef _GLOBAL_MSG_H
32#define _GLOBAL_MSG_H
33
34#include <earthworm_defs.h> /* amp types */
35#include <transport.h>      /*  MSG_LOGO  */
36
37#define BUFF_OVERRUN_SIZE  20
38
39
40typedef int GLOBAL_MSG_STATUS;
41
42/*
43** Ensure that error numbers are negative to avoid
44** collision with some functions that return 0 - n for
45** success
46*/
47enum GLOBAL_MSG_STATUS_TYPES
48{
49    GLOBAL_MSG_UNKNOWN      =   1 /* value is undetermined or not supplied (?)                    */
50  , GLOBAL_MSG_SUCCESS      =   0 /* success                                                      */
51  , GLOBAL_MSG_NULL         =  -1 /* item pointer is NULL                                         */
52  , GLOBAL_MSG_VERSINVALID  =  -2 /* invalid version                                              */
53  , GLOBAL_MSG_FORMATERROR  =  -3 /* invalid format (while parsing)                               */
54  , GLOBAL_MSG_MAXCHILDREN  =  -4 /* too many children (applies to global location, phase)        */
55  , GLOBAL_MSG_BADPARAM     =  -5 /* parameter error (e.g. string too long, index out of range)   */
56  , GLOBAL_MSG_TOOSMALL     =  -6 /* [buffer] too small to contain message                        */
57  , GLOBAL_MSG_BADCHILD     =  -7 /* invalid child line                                           */
58  , GLOBAL_MSG_DEFINESMALL  =  -9 /* max buffer size too small for normal write                   */
59  , GLOBAL_MSG_BADAMPTYPE   = -10 /* amp magtype not defined                                      */
60};
61
62
63
64/* ==========================================================================
65**                    FUNCTION DECLARATIONS
66** ========================================================================= */
67
68/*
69** DTStringToTime()
70**
71**  "YYYYMMDDHHMMss.sss" --> double (secs since 1/1/1970)
72*/
73double DTStringToTime( const char * p_datestring );
74
75/*
76** DTStringToTime()
77**
78**  double --> "YYYYMMDDHHMMss.sss"
79**
80**  p_buffer must be at least 19 chars long
81**
82**  RETURNS
83**     GLOBAL_MSG_SUCCESS
84**     GLOBAL_MSG_NULL -- p_buffer is null
85*/
86int TimeToDTString( const double p_time, char * p_buffer );
87
88
89/* EncodeAuthor() -- encodes author from logo
90**
91** RETURNS
92**     GLOBAL_MSG_SUCCESS
93**     GLOBAL_MSG_NULLSTRUCT -- buffer pointer is NULL
94*/
95GLOBAL_MSG_STATUS EncodeAuthor( MSG_LOGO   p_logo
96                              , char     * r_buffer
97                              );
98
99/* DecodeAuthor() -- decodes logo from author
100**
101** RETURNS
102**     GLOBAL_MSG_SUCCESS
103**     GLOBAL_MSG_NULLSTRUCT -- buffer pointer is NULL
104**     GLOBAL_MSG_BADPARAM -- buffer string is invalid length
105**     GLOBAL_MSG_FORMATERROR -- number conversion error
106*/
107GLOBAL_MSG_STATUS DecodeAuthor( MSG_LOGO * p_logo
108                              , char     * r_buffer
109                              );
110
111
112/* GetGlobalAmpTypeName
113**
114**   A little helper function to obtain the character string
115**   for the specified type code
116*/
117const char * GetGlobalAmpTypeName( MAGNITUDE_TYPE p_type );
118
119
120#endif
Note: See TracBrowser for help on using the repository browser.