summaryrefslogtreecommitdiff
path: root/src/insfile.h
blob: 27164f2906a75ad8798e24fc15cbf3fb1657923e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
   /*******************************************************/
   /*      "C" Language Integrated Production System      */
   /*                                                     */
   /*               CLIPS Version 6.30  02/04/15          */
   /*                                                     */
   /*                                                     */
   /*******************************************************/

/*************************************************************/
/* Purpose:                                                  */
/*                                                           */
/* Principal Programmer(s):                                  */
/*      Brian L. Dantes                                      */
/*                                                           */
/* Contributing Programmer(s):                               */
/*                                                           */
/* Revision History:                                         */
/*                                                           */
/*      6.24: Added environment parameter to GenClose.       */
/*            Added environment parameter to GenOpen.        */
/*                                                           */
/*            Renamed BOOLEAN macro type to intBool.         */
/*                                                           */
/*            Corrected code to remove compiler warnings.    */
/*                                                           */
/*      6.30: Removed conditional code for unsupported       */
/*            compilers/operating systems (IBM_MCW,          */
/*            MAC_MCW, and IBM_TBC).                         */
/*                                                           */
/*            Changed integer type/precision.                */
/*                                                           */
/*            Added const qualifiers to remove C++           */
/*            deprecation warnings.                          */
/*                                                           */
/*            Converted API macros to function calls.        */
/*                                                           */
/*************************************************************/

#ifndef _H_insfile
#define _H_insfile

#ifndef _H_expressn
#include "expressn.h"
#endif

#define INSTANCE_FILE_DATA 30

#if BLOAD_INSTANCES || BSAVE_INSTANCES
struct instanceFileData
  {
   const char *InstanceBinaryPrefixID;
   const char *InstanceBinaryVersionID;
   unsigned long BinaryInstanceFileSize;

#if BLOAD_INSTANCES
   unsigned long BinaryInstanceFileOffset;
   char *CurrentReadBuffer;
   unsigned long CurrentReadBufferSize;
   unsigned long CurrentReadBufferOffset;
#endif
  };

#define InstanceFileData(theEnv) ((struct instanceFileData *) GetEnvironmentData(theEnv,INSTANCE_FILE_DATA))

#endif /* BLOAD_INSTANCES || BSAVE_INSTANCES */

#ifdef LOCALE
#undef LOCALE
#endif

#ifdef _INSFILE_SOURCE_
#define LOCALE
#else
#define LOCALE extern
#endif

   LOCALE void                           SetupInstanceFileCommands(void *);
   LOCALE long                           SaveInstancesCommand(void *);
   LOCALE long                           LoadInstancesCommand(void *);
   LOCALE long                           RestoreInstancesCommand(void *);
   LOCALE long                           EnvSaveInstancesDriver(void *,const char *,int,EXPRESSION *,intBool);
   LOCALE long                           EnvSaveInstances(void *,const char *,int);
#if BSAVE_INSTANCES
   LOCALE long                           BinarySaveInstancesCommand(void *);
   LOCALE long                           EnvBinarySaveInstancesDriver(void *,const char *,int,EXPRESSION *,intBool);
   LOCALE long                           EnvBinarySaveInstances(void *,const char *,int);
#endif
#if BLOAD_INSTANCES
   LOCALE long                           BinaryLoadInstancesCommand(void *);
   LOCALE long                           EnvBinaryLoadInstances(void *,const char *);
#endif
   LOCALE long                           EnvLoadInstances(void *,const char *);
   LOCALE long                           EnvLoadInstancesFromString(void *,const char *,int);
   LOCALE long                           EnvRestoreInstances(void *,const char *);
   LOCALE long                           EnvRestoreInstancesFromString(void *,const char *,int);

#if ALLOW_ENVIRONMENT_GLOBALS

#if BLOAD_INSTANCES
   LOCALE long                           BinaryLoadInstances(const char *);
#endif
#if BSAVE_INSTANCES
   LOCALE long                           BinarySaveInstances(const char *,int);
#endif
   LOCALE long                           LoadInstances(const char *);
   LOCALE long                           LoadInstancesFromString(const char *,int);
   LOCALE long                           RestoreInstances(const char *);
   LOCALE long                           RestoreInstancesFromString(const char *,int);
   LOCALE long                           SaveInstances(const char *,int);

#endif /* ALLOW_ENVIRONMENT_GLOBALS */

#endif /* _H_insfile */