Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/lib/libjcl/jcl.h
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 2003-2011 AT&T Intellectual Property *
5
* and is licensed under the *
6
* Eclipse Public License, Version 1.0 *
7
* by AT&T Intellectual Property *
8
* *
9
* A copy of the License is available at *
10
* http://www.eclipse.org/org/documents/epl-v10.html *
11
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
12
* *
13
* Information and Software Systems Research *
14
* AT&T Research *
15
* Florham Park NJ *
16
* *
17
* Glenn Fowler <[email protected]> *
18
* *
19
***********************************************************************/
20
#pragma prototyped
21
/*
22
* jcl interface definitions
23
*/
24
25
#ifndef _JCL_H
26
#define _JCL_H 1
27
28
#include <ast.h>
29
#include <dt.h>
30
#include <error.h>
31
#include <vmalloc.h>
32
33
#define JCL_VERSION 20050214L
34
35
#define JCL_AUTO "JCL_AUTO_"
36
#define JCL_MAPFILE "prefix"
37
38
#define JCL_CREATE 0x00000001
39
#define JCL_EXEC 0x00000002
40
#define JCL_IMPORT 0x00000004
41
#define JCL_LISTAUTOEDITS 0x00000008
42
#define JCL_LISTCOUNTS 0x00000010
43
#define JCL_LISTEXEC 0x00000020
44
#define JCL_LISTINPUTS 0x00000040
45
#define JCL_LISTOUTPUTS 0x00000080
46
#define JCL_LISTPROGRAMS 0x00000100
47
#define JCL_LISTSCRIPTS 0x00000200
48
#define JCL_LISTVARIABLES 0x00000400
49
#define JCL_MAPPED 0x00000800
50
#define JCL_MARKLENGTH 0x00001000
51
#define JCL_PARAMETERIZE 0x00002000
52
#define JCL_RECURSE 0x00004000
53
#define JCL_SCOPE 0x00008000
54
#define JCL_STANDARD 0x00010000
55
#define JCL_SUBDIR 0x00020000
56
#define JCL_TRACE 0x00040000
57
#define JCL_VERBOSE 0x00080000
58
#define JCL_WARN 0x00100000
59
#define JCL_GDG 0x00200000
60
61
#define JCL_JOB 0x20000000
62
#define JCL_PGM 0x40000000
63
#define JCL_PROC 0x80000000
64
65
#define JCL_INHERIT (~(JCL_SCOPE))
66
67
#define JCL_DD_SYSIN 0x0001
68
#define JCL_DD_SYSOUT 0x0002
69
#define JCL_DD_SYSERR 0x0004
70
#define JCL_DD_REFERENCE 0x0008
71
#define JCL_DD_INCLUDE 0x0010
72
#define JCL_DD_DUMMY 0x0020
73
#define JCL_DD_DIR 0x0040
74
#define JCL_DD_ALIAS 0x0080
75
#define JCL_DD_MARKED 0x0100
76
77
#define JCL_RECFM_A 0x01
78
#define JCL_RECFM_B 0x02
79
#define JCL_RECFM_D 0x04
80
#define JCL_RECFM_F 0x08
81
#define JCL_RECFM_M 0x10
82
#define JCL_RECFM_S 0x20
83
#define JCL_RECFM_U 0x40
84
#define JCL_RECFM_V 0x80
85
86
#define JCL_SYM_EXPORT 0x01
87
#define JCL_SYM_IMPORT 0x02
88
#define JCL_SYM_READONLY 0x04
89
#define JCL_SYM_SET 0x08
90
91
#define JCL_DISP_NEW 'N'
92
#define JCL_DISP_OLD 'O'
93
#define JCL_DISP_SHR 'S'
94
#define JCL_DISP_MOD 'M'
95
96
#define JCL_DISP_DELETE 'D'
97
#define JCL_DISP_KEEP 'K'
98
#define JCL_DISP_PASS 'P'
99
#define JCL_DISP_CATLG 'C'
100
#define JCL_DISP_UNCATLG 'U'
101
102
#define JCL_COND_ONLY 1
103
#define JCL_COND_EVEN 2
104
#define JCL_COND_LT 3
105
#define JCL_COND_LE 4
106
#define JCL_COND_EQ 5
107
#define JCL_COND_NE 6
108
#define JCL_COND_GE 7
109
#define JCL_COND_GT 8
110
#define JCL_COND_OR 9
111
#define JCL_COND_AND 10
112
113
struct Jclcat_s; typedef struct Jclcat_s Jclcat_t;
114
struct Jclcond_s; typedef struct Jclcond_s Jclcond_t;
115
struct Jcldd_s; typedef struct Jcldd_s Jcldd_t;
116
struct Jcldir_s; typedef struct Jcldir_s Jcldir_t;
117
struct Jcldisc_s; typedef struct Jcldisc_s Jcldisc_t;
118
struct Jclout_s; typedef struct Jclout_s Jclout_t;
119
struct Jcloutput_s; typedef struct Jcloutput_s Jcloutput_t;
120
struct Jclstep_s; typedef struct Jclstep_s Jclstep_t;
121
struct Jclsym_s; typedef struct Jclsym_s Jclsym_t;
122
struct Jcl_s; typedef struct Jcl_s Jcl_t;
123
124
typedef int (*Jcloptset_f)(Jcl_t*, int, Jcldisc_t*);
125
126
struct Jcldisc_s
127
{
128
unsigned long version; /* interface version */
129
Error_f errorf; /* error function */
130
const char* usage; /* option usage */
131
Jcloptset_f optsetf; /* option function */
132
time_t date; /* system date */
133
time_t odate; /* original date */
134
time_t rdate; /* current run date */
135
};
136
137
struct Jclcat_s
138
{
139
Jclcat_t* next;
140
char* path;
141
};
142
143
struct Jclout_s
144
{
145
Jclout_t* next;
146
Jcloutput_t* output;
147
};
148
149
struct Jclcond_s
150
{
151
Jclcond_t* next;
152
char* step;
153
short code;
154
short op;
155
};
156
157
struct Jcldd_s
158
{
159
Dtlink_t link;
160
char* name;
161
char* path;
162
char* here;
163
char* card;
164
char dlm[3];
165
int lrecl;
166
int reference;
167
unsigned short flags;
168
unsigned char recfm;
169
unsigned char disp[3];
170
Jclcat_t* cat;
171
Jclout_t* out;
172
#ifdef _JCLDD_PRIVATE_
173
_JCLDD_PRIVATE_
174
#endif
175
};
176
177
struct Jcloutput_s
178
{
179
Dtlink_t link;
180
char* name;
181
char* parm;
182
#ifdef _JCLOUTPUT_PRIVATE_
183
_JCLOUTPUT_PRIVATE_
184
#endif
185
};
186
187
struct Jcldir_s
188
{
189
Dtlink_t link;
190
char name[1];
191
};
192
193
struct Jclsym_s
194
{
195
Dtlink_t link;
196
char* value;
197
int flags;
198
char name[1];
199
};
200
201
struct Jclstep_s
202
{
203
char* name;
204
char* command;
205
char* parm;
206
Dt_t* dd;
207
Jclcond_t* cond;
208
Dt_t* syms;
209
Vmalloc_t* vm;
210
unsigned long flags;
211
};
212
213
struct Jcl_s
214
{
215
char* id;
216
Jcldisc_t* disc;
217
Vmalloc_t* vm;
218
unsigned long flags;
219
unsigned long roflags;
220
unsigned long steps;
221
unsigned long passed;
222
unsigned long failed;
223
char* name;
224
char* tmp;
225
Jclcond_t* cond;
226
Dt_t* dd;
227
Dt_t* output;
228
Dt_t* syms;
229
Jclstep_t* step;
230
#ifdef _JCL_PRIVATE_
231
_JCL_PRIVATE_
232
#endif
233
};
234
235
#define jclinit(d,e) (memset(d,0,sizeof(*(d))),(d)->version=JCL_VERSION,(d)->errorf=(Error_f)(e),(d)->date=(d)->odate=(d)->rdate=time(NiL))
236
237
extern int jclmap(Jcl_t*, const char*, Jcldisc_t*);
238
extern int jclstats(Sfio_t*, unsigned long, Jcldisc_t*);
239
240
extern int jclclose(Jcl_t*);
241
extern int jcleval(Jcl_t*, Jclcond_t*, int);
242
extern char* jclfind(Jcl_t*, const char*, unsigned long, int, Sfio_t**);
243
extern int jclinclude(Jcl_t*, const char*, unsigned long, Jcldisc_t*);
244
extern Jcl_t* jclopen(Jcl_t*, const char*, unsigned long, Jcldisc_t*);
245
extern char* jclparm(char**);
246
extern char* jclpath(Jcl_t*, const char*);
247
extern int jclpop(Jcl_t*);
248
extern int jclpush(Jcl_t*, Sfio_t*, const char*, long);
249
extern int jclrc(Jcl_t*, Jclstep_t*, int);
250
extern int jclrun(Jcl_t*);
251
extern Jclstep_t* jclstep(Jcl_t*);
252
extern Jclsym_t* jclsym(Jcl_t*, const char*, const char*, int);
253
254
#endif
255
256