Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/3d/ast.c
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 1989-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
* David Korn <[email protected]> *
19
* Eduardo Krell <[email protected]> *
20
* *
21
***********************************************************************/
22
#pragma prototyped
23
24
#define NoN(x)
25
26
#include "3d.h"
27
#include "ast.h"
28
29
static char conf[] = "";
30
31
#define astconf(a,b,c) conf
32
#define ctermid ___ctermid
33
34
#include "state.c"
35
36
#include "astintercept.c"
37
#include "getenv.c"
38
#include "setenviron.c"
39
#include "getcwd.c"
40
#include "getwd.c"
41
#include "hashalloc.c"
42
#include "hashfree.c"
43
#include "hashlook.c"
44
#include "hashscan.c"
45
#include "hashsize.c"
46
#include "hashwalk.c"
47
#include "memset.c"
48
49
#if DEBUG
50
#include "fmterror.c"
51
#endif
52
53
#if FS
54
#include "tvgettime.c"
55
#include "eaccess.c"
56
#include "pathcat.c"
57
#include "pathtemp.c"
58
#include "pathtmp.c"
59
60
char*
61
pathbin(void)
62
{
63
char* p;
64
65
if (!(p = state.envpath) && !(p = getenv("PATH")))
66
p = ":/bin:/usr/bin:/usr/ucb";
67
return(p);
68
}
69
70
#include "tokscan.c"
71
#include "touch.c"
72
73
#endif
74
75
#include "strmatch.c"
76
#include "sigcrit.c"
77
#include "waitpid.c"
78
79
#undef _real_vfork
80
81
#define close CLOSE
82
#define fcntl FCNTL
83
#define read READ
84
#define write WRITE
85
86
#include "pathshell.c"
87
88
/*
89
* 3d doesn't handle spawnve() yet
90
* we need spawnveg3d()
91
*/
92
93
#if _lib_fork || _lib_vfork
94
#undef _lib_spawnve
95
#endif
96
97
#include "spawnveg.c" /* follows spawnve.c because of #undef's */
98
99
#include "gross.c"
100
101
#if _map_malloc
102
103
#undef calloc
104
#undef free
105
#undef malloc
106
#undef realloc
107
#undef strdup
108
109
extern void* calloc(size_t, size_t);
110
extern void free(void*);
111
extern void* malloc(size_t);
112
extern void* realloc(void*, size_t);
113
extern char* strdup(const char*);
114
115
extern void* _ast_calloc(size_t n, size_t m) { return calloc(n, m); }
116
extern void _ast_free(void* p) { free(p); }
117
extern void* _ast_malloc(size_t n) { return malloc(n); }
118
extern void* _ast_realloc(void* p, size_t n) { return realloc(p, n); }
119
extern char* _ast_strdup(const char* s) { return strdup(s); }
120
121
#endif
122
123