Commit 37e4fc9c authored by Erwin Janssen's avatar Erwin Janssen

Remove all usage of _PACKAGE_ast and PACKAGE_ast

These two defines are never set in the configuration or code. Manually
setting them causes the build to fail. Therefore all usage of these
defines can be removed.
parent a6721d4a
......@@ -39,10 +39,6 @@ extern "C" {
#define FEATURE_X11 1
#endif
#ifdef _PACKAGE_ast
#include <ast.h>
#define HAVE_STRERROR 1
#else
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
......@@ -55,7 +51,6 @@ extern "C" {
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#endif
#include <inttypes.h>
#include <math.h>
......
......@@ -12,9 +12,6 @@
*************************************************************************/
%{
#if defined(_PACKAGE_ast)
#include <ast.h>
#endif
#include <stdio.h>
typedef void *Tobj;
......
......@@ -75,9 +75,6 @@ int Iparsegraphlabel (int, Tonm_t *);
int Ireadgraph (int, Tonm_t *);
int Iwritegraph (int, Tonm_t *);
#endif
#ifdef _PACKAGE_ast
int Imatch (int, Tonm_t *);
#endif
#ifdef FEATURE_CS
int C2Lreadcsmessage (int, Tonm_t *);
#endif
......@@ -151,9 +148,6 @@ Ifunc_t Ifuncs[] = {
{ "readgraph", Ireadgraph, 1, 2 },
{ "writegraph", Iwritegraph, 3, 3 },
#endif
#ifdef _PACKAGE_ast
{ "match", Imatch, 2, 2 },
#endif
#ifdef FEATURE_CS
{ "readcsmessage", C2Lreadcsmessage, 1, 1 },
#endif
......@@ -827,17 +821,6 @@ int Iwritegraph (int argc, lvar_t *argv) {
}
#endif
#ifdef _PACKAGE_ast
/* ast related functions */
int Imatch (int argc, lvar_t *argv) {
if (!T_ISSTRING (argv[0].o) || !T_ISSTRING (argv[1].o))
return L_FAILURE;
rtno = Tinteger (strmatch (Tgetstring (argv[0].o), Tgetstring (argv[1].o)));
return L_SUCCESS;
}
#endif
static void growbufp (int newsize) {
if (!(bufp = realloc (
bufp, ((newsize + BUFINCR - 1) / BUFINCR) * BUFINCR * BUFSIZE
......
......@@ -245,17 +245,6 @@ struct Agraph_s {
Agclos_t *clos; /* shared resources */
};
#if defined(_PACKAGE_ast)
/* fine control of object callbacks */
# if defined(_BLD_cgraph) && defined(__EXPORT__)
# define extern __EXPORT__
# endif
# if !defined(_BLD_cgraph) && defined(__IMPORT__)
# define extern __IMPORT__
# endif
#endif
extern void agpushdisc(Agraph_t * g, Agcbdisc_t * disc, void *state);
extern int agpopdisc(Agraph_t * g, Agcbdisc_t * disc);
extern int agcallbacks(Agraph_t * g, int flag); /* return prev value */
......@@ -418,11 +407,6 @@ extern agusererrf agseterrf(agusererrf);
#define TAILPORT_ID "tailport"
#define HEADPORT_ID "headport"
#if defined(_PACKAGE_ast)
# if !defined(_BLD_cgraph) && defined(__IMPORT__)
# define extern __IMPORT__
# endif
#endif
#if defined(_MSC_VER) && !defined(CGRAPH_EXPORTS)
#define extern __declspec(dllimport)
#endif
......
......@@ -34,10 +34,6 @@
* n - the order of the matrices A and Ainv
*/
#if defined(_PACKAGE_ast)
#include <ast.h>
#else
#endif
#include <stdlib.h>
#include "render.h"
extern int lu_decompose(double **a, int n);
......
......@@ -18,10 +18,6 @@
** Written by Kiem-Phong Vo
*/
#if PACKAGE_ast
int _AST_already_has_them;
#else
#if !_lib_atexit
#if _lib_onexit
......@@ -158,5 +154,4 @@ waitpid(int pid, int *status, int options)
#endif /*_lib_waitpid*/
#endif /*!PACKAGE_ast */
#endif
......@@ -33,24 +33,6 @@ extern "C" {
/* note that the macro vt_threaded has effect on vthread.h */
#include <vthread.h>
/* file system info */
#if defined(_PACKAGE_ast)
#include <ast.h>
#include <ast_time.h>
#include <ast_tty.h>
#include <ls.h>
#if _mem_st_blksize_stat
#define _stat_blksize 1
#endif
#if _lib_localeconv && _hdr_locale
#define _lib_locale 1
#endif
#else /*!defined(_PACKAGE_ast) */
#if defined(__mips) && __mips == 2 && !defined(_NO_LARGEFILE64_SOURCE)
#define _NO_LARGEFILE64_SOURCE 1
#endif
......@@ -124,8 +106,6 @@ extern "C" {
#include <unistd.h>
#endif
#endif /*defined(_PACKAGE_ast)*/
#include <errno.h>
#include <ctype.h>
......@@ -379,7 +359,7 @@ extern "C" {
#define ESPIPE 29
#endif
/* see if we can use memory mapping for io */
#if !defined(_PACKAGE_ast) && defined(_mmap_worthy)
#if defined(_mmap_worthy)
# ifdef _LARGEFILE64_SOURCE
# undef mmap
# endif
......@@ -740,13 +720,8 @@ extern "C" {
#define SF_RADIX 64 /* maximum integer conversion base */
#if defined(_PACKAGE_ast)
#define SF_MAXINT INT_MAX
#define SF_MAXLONG LONG_MAX
#else
#define SF_MAXINT ((int)(((uint)~0) >> 1))
#define SF_MAXLONG ((long)(((ulong)~0L) >> 1))
#endif
#define SF_MAXCHAR ((uchar)(~0))
......@@ -844,9 +819,6 @@ extern "C" {
#define max(x,y) ((x) > (y) ? (x) : (y))
/* fast functions for memory copy and memory clear */
#if defined(_PACKAGE_ast)
#define memclear(s,n) memzero(s,n)
#else
#if _lib_bcopy && !_lib_memcpy
#define memcpy(to,fr,n) bcopy((fr),(to),(n))
#endif
......@@ -855,7 +827,6 @@ extern "C" {
#else
#define memclear(s,n) memset((s),'\0',(n))
#endif
#endif /*defined(_PACKAGE_ast)*/
/* note that MEMCPY advances the associated pointers */
#define MEMCPY(to,fr,n) \
......@@ -916,8 +887,6 @@ extern "C" {
extern int munmap(void *, size_t);
#endif
#if !defined(_PACKAGE_ast)
#ifdef WIN32
#undef SF_ERROR
#include <io.h>
......@@ -981,8 +950,6 @@ extern "C" {
extern int open(const char *, int, ...);
#endif
#endif /* defined(_PACKAGE_ast) */
#endif /*_SFHDR_H*/
#ifdef __cplusplus
}
......
......@@ -25,9 +25,6 @@ extern "C" {
** Written by Kiem-Phong Vo
*/
#if defined(_PACKAGE_ast)
#include <ast_std.h>
#else
#include <ast_common.h>
#include <stdarg.h>
......@@ -93,8 +90,6 @@ extern "C" {
#endif
#endif
#endif /* defined(_PACKAGE_ast) */
/* Sfoff_t should be large enough for largest file address */
......
......@@ -34,14 +34,8 @@ static char *Version = "\n@(#)sfio (AT&T Labs - kpv) 2001-02-01\0\n";
*/
/* the below is for protecting the application from SIGPIPE */
#if defined(_PACKAGE_ast)
#include <sig.h>
#include <wait.h>
#define Sfsignal_f Sig_handler_t
#else
#include <signal.h>
typedef void (*Sfsignal_f) (int);
#endif
static int _Sfsigp = 0; /* # of streams needing SIGPIPE protection */
/* done at exiting time */
......@@ -233,18 +227,12 @@ int _sfpclose(reg Sfio_t * f)
CLOSE(p->file);
/* wait for process termination */
#if defined(_PACKAGE_ast)
sigcritical(1);
#endif
#ifndef WIN32
while ((pid = waitpid(p->pid, &status, 0)) == -1
&& errno == EINTR);
#endif
if (pid < 0)
status = -1;
#if defined(_PACKAGE_ast)
sigcritical(0);
#endif
#ifdef SIGPIPE
vtmtxlock(_Sfmutex);
......
......@@ -12,13 +12,11 @@
*************************************************************************/
#include "sfhdr.h"
#if !defined(_PACKAGE_ast)
#ifndef FIONREAD
#if _sys_ioctl
#include <sys/ioctl.h>
#endif
#endif
#endif
/* Read/Peek a record from an unseekable device
**
......
......@@ -17,10 +17,6 @@
** Written by Kiem-Phong Vo.
*/
#if defined(_PACKAGE_ast)
#include <proc.h>
#else
#define EXIT_NOTFOUND 127
#define READ 0
......@@ -118,8 +114,6 @@ static void execute(const char *argcmd)
_exit(EXIT_NOTFOUND);
}
#endif /*defined(_PACKAGE_ast)*/
#ifndef WIN32
/**
* @param f
......@@ -128,46 +122,6 @@ static void execute(const char *argcmd)
*/
Sfio_t *sfpopen(Sfio_t * f, const char *command, const char *mode)
{
#if defined(_PACKAGE_ast)
reg Proc_t *proc;
reg int sflags;
reg long flags;
reg int bits;
char *av[4];
if (!command || !command[0] || !(sflags = _sftype(mode, NiL, NiL)))
return 0;
if (f == (Sfio_t *) (-1)) { /* stdio compatibility mode */
f = NIL(Sfio_t *);
bits = SF_STDIO;
} else
bits = 0;
flags = 0;
if (sflags & SF_READ)
flags |= PROC_READ;
if (sflags & SF_WRITE)
flags |= PROC_WRITE;
av[0] = "sh";
av[1] = "-c";
av[2] = (char *) command;
av[3] = 0;
if (!(proc = procopen(0, av, 0, 0, flags)))
return 0;
if (!(f = sfnew(f, NIL(void *), (size_t) SF_UNBOUND,
(sflags & SF_READ) ? proc->rfd : proc->wfd, sflags)) ||
((f->bits |= bits),
_sfpopen(f, (sflags & SF_READ) ? proc->wfd : -1, proc->pid)) < 0)
{
if (f)
sfclose(f);
procclose(proc);
return 0;
}
procfree(proc);
return f;
#else
reg int pid, fd, pkeep, ckeep, sflags;
int stdio, parent[2], child[2];
Sfio_t sf;
......@@ -285,6 +239,5 @@ Sfio_t *sfpopen(Sfio_t * f, const char *command, const char *mode)
}
return NIL(Sfio_t *);
}
#endif /*defined(_PACKAGE_ast)*/
}
#endif
......@@ -122,7 +122,6 @@ static int _rmtmp(Sfio_t * f, char *file)
return 0;
}
#if !defined(_PACKAGE_ast)
#include <time.h>
#define TMPDFLT "/tmp"
static char **Tmppath, **Tmpcur;
......@@ -167,15 +166,12 @@ char **_sfgetpath(char *path)
return dirs;
}
#endif /*!defined(_PACKAGE_ast) */
static int _tmpfd(Sfio_t * f)
{
reg char *file;
reg int fd;
int t;
#if !defined(_PACKAGE_ast)
/* set up path of dirs to create temp files */
if (!Tmppath && !(Tmppath = _sfgetpath("TMPPATH"))) {
if (!(Tmppath = (char **) malloc(2 * sizeof(char *))))
......@@ -196,12 +192,10 @@ static int _tmpfd(Sfio_t * f)
Tmpcur += 1;
if (!Tmpcur || !Tmpcur[0])
Tmpcur = Tmppath;
#endif /*!defined(_PACKAGE_ast) */
file = NIL(char *);
fd = -1;
for (t = 0; t < 10; ++t) { /* compute a random name */
#if !defined(_PACKAGE_ast)
static ulong Key, A;
if (A == 0 || t > 0) { /* get a quasi-random coefficient */
reg int r;
......@@ -216,9 +210,6 @@ static int _tmpfd(Sfio_t * f)
Key = A * Key + 987654321;
file = sfprints("%s/sf%3.3.32lu.%3.3.32lu",
Tmpcur[0], (Key >> 15) & 0x7fff, Key & 0x7fff);
#else
file = pathtmp(file, NiL, "sf", NiL);
#endif /*!defined(_PACKAGE_ast) */
if (!file)
return -1;
......@@ -245,9 +236,6 @@ static int _tmpfd(Sfio_t * f)
if (fd >= 0)
_rmtmp(f, file);
#if defined(_PACKAGE_ast)
free(file);
#endif /*defined(_PACKAGE_ast)*/
return fd;
}
......
......@@ -30,12 +30,6 @@ extern "C" {
#include <ast_common.h>
#include <errno.h>
/* ast doesn't do threads yet */
#if defined(_PACKAGE_ast) && !defined(vt_threaded)
#define vt_threaded 0
#endif
#if !defined(vt_threaded) || (defined(vt_threaded) && vt_threaded == 1)
#define _may_use_threads 1
#else
......
......@@ -143,11 +143,7 @@ static int createfile(char *file)
}
*next = '\0';
#if defined(_PACKAGE_ast)
return open(buf, O_WRONLY | O_CREAT | O_TRUNC, CREAT_MODE);
#else
return creat(buf, CREAT_MODE);
#endif
}
static void pfprint(void)
......
......@@ -25,11 +25,7 @@ extern "C" {
#define VMALLOC_VERSION 19990805L
#if defined(_PACKAGE_ast)
#include <ast_std.h>
#else
#include <ast_common.h>
#endif
typedef struct _vmalloc_s Vmalloc_t;
typedef struct _vmstat_s Vmstat_t;
......
......@@ -17,7 +17,7 @@
** Any required functions for process exiting.
** Written by Kiem-Phong Vo, kpv@research.att.com (05/25/93).
*/
#if defined(_PACKAGE_ast) || _lib_atexit
#if _lib_atexit
int Vm_atexit_already_defined;
#else
......@@ -64,4 +64,4 @@ void exit(int type)
#endif /* _lib_onexit || _lib_on_exit */
#endif /*!PACKAGE_ast */
#endif /*_lib_atexit */
......@@ -31,30 +31,9 @@ extern "C" {
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/
#if defined(_PACKAGE_ast)
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getpagesize
#else
#define getpagesize ______getpagesize
#endif
#include <ast.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getpagesize
#else
#undef getpagesize
#endif
#else
#include <ast_common.h>
#include "FEATURE/vmalloc"
#endif /*defined(_PACKAGE_ast)*/
#undef free
#undef malloc
#undef realloc
......@@ -432,9 +411,6 @@ extern "C" {
extern Vmextern_t _Vmextern;
#if !defined(_PACKAGE_ast)
extern size_t getpagesize(void);
#ifndef WIN32
......@@ -463,8 +439,6 @@ extern "C" {
#endif
extern void _cleanup(void);
#endif /*!PACKAGE_ast */
/* for vmdcsbrk.c */
#if !_typ_ssize_t
typedef int ssize_t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment