Skip to content

Commit

Permalink
Unused symbol cleanup
Browse files Browse the repository at this point in the history
Previous changes, such as to remove support for "universes", left some
unused symbol definitions and headers. Eliminate them.
  • Loading branch information
krader1961 committed Aug 11, 2019
1 parent 856e095 commit 5981a47
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 157 deletions.
10 changes: 0 additions & 10 deletions src/lib/libast/include/ast_regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,8 @@

/* regsub flags */

#define REG_SUB_ALL 0x00000001 /* substitute all occurrences */
#define REG_SUB_LOWER 0x00000002 /* substitute to lower case */
#define REG_SUB_UPPER 0x00000004 /* substitute to upper case */
#define REG_SUB_PRINT 0x00000010 /* internal no-op */
#define REG_SUB_NUMBER 0x00000020 /* internal no-op */
#define REG_SUB_STOP 0x00000040 /* internal no-op */
#define REG_SUB_WRITE 0x00000080 /* internal no-op */
#define REG_SUB_LAST 0x00000100 /* last substitution option */
#define REG_SUB_FULL 0x00000200 /* fully delimited */

/* regex error codes */

Expand Down Expand Up @@ -199,8 +192,5 @@ extern int regrexec(const regex_t *, const char *, size_t, size_t, regmatch_t *,
void *, regrecord_t);
extern regstat_t *regstat(const regex_t *);
extern regex_t *regcache(const char *, regflags_t, int *);
extern int regsubflags(regex_t *, const char *, char **, int, const regflags_t *, int *,
regflags_t *);
extern void regsubfree(regex_t *);

#endif // _REGEX_H
1 change: 0 additions & 1 deletion src/lib/libast/include/cdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ struct _dtstat_s {
/* the actual event will be this bit */
/* combined with the operation bit */
#define DT_OPTIMIZE 0100000000 /* optimizing data structure */
#define DT_USER 0200000000 /* an announcement on user's behalf */

/* events for discipline and method event-handling functions */
#define DT_OPEN 1 /* a dictionary is being opened */
Expand Down
2 changes: 0 additions & 2 deletions src/lib/libast/include/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
#define ERROR_SILENT 0x0002 /* context is silent */
#define ERROR_NOTIFY 0x0004 /* main(-sig,0,ctx) on signal */

#define ERROR_FREE 0x0010 /* free context on pop */
#define ERROR_POP 0x0020 /* pop context */
#define ERROR_PUSH 0x0040 /* push context */
// #define ERROR_SET 0x0080 /* set context */

Expand Down
12 changes: 0 additions & 12 deletions src/lib/libast/include/modecanon.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@
#ifndef _MODECANON_H
#define _MODECANON_H 1

#define X_IFMT 0170000
// #define X_IFWHT 0160000
// #define X_IFDOOR 0150000
#define X_IFSOCK 0140000
#define X_IFLNK 0120000
#define X_IFREG 0100000
#define X_IFBLK 0060000
#define X_IFDIR 0040000
#define X_IFCHR 0020000
#define X_IFIFO 0010000

#define X_IPERM 0007777
#define X_ISUID 0004000
#define X_ISGID 0002000
#define X_ISVTX 0001000
Expand Down
10 changes: 1 addition & 9 deletions src/lib/libast/include/proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@

#define PROC_ARG_NULL ((1 << PROC_ARG_BIT) - 1)

#define PROC_fd_dup 0x4
#define PROC_FD_CHILD 0x1
#define PROC_FD_PARENT 0x2

#define PROC_fd_dup 0x4
#define PROC_sig_dfl 0x8
#define PROC_sig_ign 0x9

Expand All @@ -70,14 +70,6 @@
#define PROC_op2(o, a, b) \
(((o) << (2 * PROC_ARG_BIT)) | (((b)&PROC_ARG_NULL) << PROC_ARG_BIT) | ((a)&PROC_ARG_NULL))

#define PROC_FD_DUP(p, c, f) PROC_op2(PROC_fd_dup | (f), p, c)
// #define PROC_FD_CLOSE(p, f) PROC_op2(PROC_fd_dup | (f), p, PROC_ARG_NULL)
// #define PROC_FD_CTTY(f) PROC_op1(PROC_fd_ctty, f)
// #define PROC_SIG_DFL(s) PROC_op1(PROC_sig_dfl, s, 0)
// #define PROC_SIG_IGN(s) PROC_op1(PROC_sig_ign, s, 0)
// #define PROC_SYS_PGRP(g) PROC_op1(PROC_sys_pgrp, g)
// #define PROC_SYS_UMASK(m) PROC_op1(PROC_sys_umask, m, 0)

#define PROC_OP(x) (((x) >> (2 * PROC_ARG_BIT)) & ((1 << PROC_OP_BIT) - 1))
//
// This is the original definition of PROC_ARG. It's hard to read and results in lint warnings since
Expand Down
3 changes: 1 addition & 2 deletions src/lib/libast/include/shcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ struct Shbltin_s {

// The following symbols used to have a `sh_` prefix and were meant to mask the functions of the
// same name when used in a builtin (e.g., code in src/lib/libcmd). That has been changed because
// that sort or redirection obfuscates what is actually happening and makes reasoning about the
// that sort of redirection obfuscates what is actually happening and makes reasoning about the
// code harder.
#define bltin_run(c, ac, av) (c ? (*c->shrun)(c->shp, ac, av) : -1)
#define bltin_checksig(c) (c && c->sigset)

extern int cmdinit(int, char **, Shbltin_t *, int);
Expand Down
49 changes: 0 additions & 49 deletions src/lib/libast/include/univlib.h

This file was deleted.

10 changes: 0 additions & 10 deletions src/lib/libast/man/proc.3
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,6 @@ The file descriptor
is closed in
.IR context .
.TP
\f5PROC_FD_DUP(\fIfrom\fP,\fIto\fP,\fIcontext\fP)\fR
The file descriptor
.I from
is
.IR dup (2)'d
into the file descriptor
.I to
in
.IR context .
.TP
\f5PROC_SIG_DFL(\fIsig\fP)\fR
The signal handler for
.I sig
Expand Down
2 changes: 0 additions & 2 deletions src/lib/libast/man/regex.3
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ int regnexec(const regex_t* \fIre\fP, const char* \fIsubject\fP, size_t \
int regrecord(const regex_t* \fIre\fP);
int regrexec(const regex_t* \fIre\fP, const char* \fIbuf\fP, size_t \fIsize\fP, size_t \fInmatch\fP, regmatch_t* \fImatch\fP, regflags_t \fIflags\fP, int \fIsep\fP, void* \fIhandle\fP, regrecord_t \fIrecordf\fP);
int regsubflags(regex_t* \fIre\fP, const char* \fIstr\fP, char** \fIend\fP, int \fIdelim\fP, const regflags_t* \fImap\fP, int* \fIpm\fP, regflags_t* \fIpf\fP);
void regsubfree(regex_t* \fIre\fP);
.EE

.SH DESCRIPTION
Expand Down
1 change: 0 additions & 1 deletion src/lib/libast/misc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ libast_files += [
'misc/state.c',
'misc/stk.c',
'misc/translate.c',
'misc/univdata.c',
'misc/vmbusy.c',
]

Expand Down
58 changes: 0 additions & 58 deletions src/lib/libast/misc/univdata.c

This file was deleted.

1 change: 0 additions & 1 deletion src/lib/libcmd/cmdext.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ extern int b_chmod(int, char **, Shbltin_t *);
extern int b_cmp(int, char **, Shbltin_t *);
extern int b_cut(int, char **, Shbltin_t *);
extern int b_dirname(int, char **, Shbltin_t *);
extern int b_getconf(int, char **, Shbltin_t *);
extern int b_head(int, char **, Shbltin_t *);
extern int b_logname(int, char **, Shbltin_t *);
extern int b_mkdir(int, char **, Shbltin_t *);
Expand Down

0 comments on commit 5981a47

Please sign in to comment.