sometimes, I feel pretty stupid
separate the backslash+newline things out of the *.opt files, logically not 100% clean, but better as it is not generated content anyway (keeping the one-liners in there for now, even though more consistent would be shifting them out as well)
This commit is contained in:
parent
a9e1101145
commit
7f48503c66
22
funcs.c
22
funcs.c
@ -38,7 +38,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.271 2015/04/29 20:44:34 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.272 2015/05/01 23:16:29 tg Exp $");
|
||||||
|
|
||||||
#if HAVE_KILLPG
|
#if HAVE_KILLPG
|
||||||
/*
|
/*
|
||||||
@ -3424,7 +3424,27 @@ ptest_error(Test_env *te, int ofs, const char *msg)
|
|||||||
# error nonsensical v ulimit
|
# error nonsensical v ulimit
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct limits {
|
||||||
|
/* limit resource */
|
||||||
|
int resource;
|
||||||
|
/* multiply by to get rlim_{cur,max} values */
|
||||||
|
unsigned int factor;
|
||||||
|
/* getopts char */
|
||||||
|
char optchar;
|
||||||
|
/* limit name */
|
||||||
|
char name[1];
|
||||||
|
};
|
||||||
|
|
||||||
#define RLIMITS_DEFNS
|
#define RLIMITS_DEFNS
|
||||||
|
#define FN(lname,lid,lfac,lopt) \
|
||||||
|
static const struct { \
|
||||||
|
int resource; \
|
||||||
|
unsigned int factor; \
|
||||||
|
char optchar; \
|
||||||
|
char name[sizeof(lname)]; \
|
||||||
|
} rlimits_ ## lid = { \
|
||||||
|
lid, lfac, lopt, lname \
|
||||||
|
};
|
||||||
#include "rlimits.gen"
|
#include "rlimits.gen"
|
||||||
|
|
||||||
static void print_ulimit(const struct limits *, int);
|
static void print_ulimit(const struct limits *, int);
|
||||||
|
13
misc.c
13
misc.c
@ -30,7 +30,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.231 2015/04/29 20:21:35 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.232 2015/05/01 23:16:30 tg Exp $");
|
||||||
|
|
||||||
#define KSH_CHVT_FLAG
|
#define KSH_CHVT_FLAG
|
||||||
#ifdef MKSH_SMALL
|
#ifdef MKSH_SMALL
|
||||||
@ -122,6 +122,17 @@ Xcheck_grow(XString *xsp, const char *xp, size_t more)
|
|||||||
|
|
||||||
|
|
||||||
#define SHFLAGS_DEFNS
|
#define SHFLAGS_DEFNS
|
||||||
|
#define FN(sname,cname,flags,ochar) \
|
||||||
|
static const struct { \
|
||||||
|
/* character flag (if any) */ \
|
||||||
|
char c; \
|
||||||
|
/* OF_* */ \
|
||||||
|
unsigned char optflags; \
|
||||||
|
/* long name of option */ \
|
||||||
|
char name[sizeof(sname)]; \
|
||||||
|
} shoptione_ ## cname = { \
|
||||||
|
ochar, flags, sname \
|
||||||
|
};
|
||||||
#include "sh_flags.gen"
|
#include "sh_flags.gen"
|
||||||
|
|
||||||
#define OFC(i) (options[i][-2])
|
#define OFC(i) (options[i][-2])
|
||||||
|
24
rlimits.opt
24
rlimits.opt
@ -1,27 +1,7 @@
|
|||||||
@RLIMITS_DEFNS
|
@RLIMITS_DEFNS
|
||||||
__RCSID("$MirOS: src/bin/mksh/rlimits.opt,v 1.1 2013/11/17 22:21:18 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/rlimits.opt,v 1.2 2015/05/01 23:16:31 tg Exp $");
|
||||||
struct limits {
|
|
||||||
/* limit resource */
|
|
||||||
int resource;
|
|
||||||
/* multiply by to get rlim_{cur,max} values */
|
|
||||||
unsigned int factor;
|
|
||||||
/* getopts char */
|
|
||||||
char optchar;
|
|
||||||
/* limit name */
|
|
||||||
char name[1];
|
|
||||||
};
|
|
||||||
#define FN(lname,lid,lfac,lopt) \
|
|
||||||
static const struct { \
|
|
||||||
int resource; \
|
|
||||||
unsigned int factor; \
|
|
||||||
char optchar; \
|
|
||||||
char name[sizeof(lname)]; \
|
|
||||||
} rlimits_ ## lid = { \
|
|
||||||
lid, lfac, lopt, lname \
|
|
||||||
};
|
|
||||||
@RLIMITS_ITEMS
|
@RLIMITS_ITEMS
|
||||||
#define FN(lname,lid,lfac,lopt) \
|
#define FN(lname,lid,lfac,lopt) (const struct limits *)(&rlimits_ ## lid),
|
||||||
(const struct limits *)(&rlimits_ ## lid),
|
|
||||||
@@
|
@@
|
||||||
|
|
||||||
/* generic options for the ulimit builtin */
|
/* generic options for the ulimit builtin */
|
||||||
|
16
sh_flags.opt
16
sh_flags.opt
@ -1,22 +1,10 @@
|
|||||||
@SHFLAGS_DEFNS
|
@SHFLAGS_DEFNS
|
||||||
__RCSID("$MirOS: src/bin/mksh/sh_flags.opt,v 1.2 2014/06/09 12:28:19 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/sh_flags.opt,v 1.3 2015/05/01 23:16:31 tg Exp $");
|
||||||
#define FN(sname,cname,flags,ochar) \
|
|
||||||
static const struct { \
|
|
||||||
/* character flag (if any) */ \
|
|
||||||
char c; \
|
|
||||||
/* OF_* */ \
|
|
||||||
unsigned char optflags; \
|
|
||||||
/* long name of option */ \
|
|
||||||
char name[sizeof(sname)]; \
|
|
||||||
} shoptione_ ## cname = { \
|
|
||||||
ochar, flags, sname \
|
|
||||||
};
|
|
||||||
@SHFLAGS_ENUMS
|
@SHFLAGS_ENUMS
|
||||||
#define FN(sname,cname,flags,ochar) cname,
|
#define FN(sname,cname,flags,ochar) cname,
|
||||||
#define F0(sname,cname,flags,ochar) cname = 0,
|
#define F0(sname,cname,flags,ochar) cname = 0,
|
||||||
@SHFLAGS_ITEMS
|
@SHFLAGS_ITEMS
|
||||||
#define FN(sname,cname,flags,ochar) \
|
#define FN(sname,cname,flags,ochar) ((const char *)(&shoptione_ ## cname)) + 2,
|
||||||
((const char *)(&shoptione_ ## cname)) + 2,
|
|
||||||
@@
|
@@
|
||||||
|
|
||||||
/* special cases */
|
/* special cases */
|
||||||
|
Loading…
Reference in New Issue
Block a user