aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorRichard Brooksby2013-05-09 12:46:59 +0100
committerRichard Brooksby2013-05-09 12:46:59 +0100
commit60ae2d01bef98a16fd249d63c9045ca311980524 (patch)
treef7bc6ed9ba1f75a0193323fd6f5450363a6f80c6 /mps/code
parent3815e622a8c13730e9a67e2d4ede962a65806bd2 (diff)
downloademacs-60ae2d01bef98a16fd249d63c9045ca311980524.tar.gz
emacs-60ae2d01bef98a16fd249d63c9045ca311980524.zip
Moving definition of keystruct to arg.h, since this mechanism is largely separable from the rest of the mps.
Copied from Perforce Change: 181664 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/arg.h12
-rw-r--r--mps/code/mpmst.h10
2 files changed, 12 insertions, 10 deletions
diff --git a/mps/code/arg.h b/mps/code/arg.h
index 58bbf98c85e..2a1385a8dfb 100644
--- a/mps/code/arg.h
+++ b/mps/code/arg.h
@@ -11,16 +11,28 @@
11 11
12#include "mpmtypes.h" 12#include "mpmtypes.h"
13 13
14/* KeyStruct -- keyword argument structure */
15
14/* FIXME: Whether to have a check field should be conditional on variety */ 16/* FIXME: Whether to have a check field should be conditional on variety */
15 17
18#define KeySig ((Sig)0x519CE111) /* SIGnature KEYyy */
19typedef struct mps_key_s {
20 Sig sig;
21 const char *name;
22 Bool (*check)(Arg arg);
23} KeyStruct;
24
16#define ARG_DEFINE_KEY(id, type) \ 25#define ARG_DEFINE_KEY(id, type) \
17 const KeyStruct _mps_key_##id = {KeySig, #id, ArgCheck##type} 26 const KeyStruct _mps_key_##id = {KeySig, #id, ArgCheck##type}
18 27
19#define argsNone mps_args_none 28#define argsNone mps_args_none
29
20extern Bool KeyCheck(Key key); 30extern Bool KeyCheck(Key key);
21extern Bool ArgCheck(Arg arg); 31extern Bool ArgCheck(Arg arg);
22extern Bool ArgListCheck(ArgList args); 32extern Bool ArgListCheck(ArgList args);
33
23extern Bool ArgPick(ArgStruct *argOut, ArgList args, Key key); 34extern Bool ArgPick(ArgStruct *argOut, ArgList args, Key key);
35
24extern Bool ArgCheckCant(Arg arg); 36extern Bool ArgCheckCant(Arg arg);
25extern Bool ArgCheckFormat(Arg arg); 37extern Bool ArgCheckFormat(Arg arg);
26extern Bool ArgCheckChain(Arg arg); 38extern Bool ArgCheckChain(Arg arg);
diff --git a/mps/code/mpmst.h b/mps/code/mpmst.h
index 410f50f963b..98e421ad823 100644
--- a/mps/code/mpmst.h
+++ b/mps/code/mpmst.h
@@ -700,16 +700,6 @@ typedef struct AllocPatternStruct {
700} AllocPatternStruct; 700} AllocPatternStruct;
701 701
702 702
703/* KeyStruct -- keyword argument structure */
704
705#define KeySig ((Sig)0x519CE111) /* SIGnature KEYyy */
706typedef struct mps_key_s {
707 Sig sig;
708 const char *name;
709 Bool (*check)(Arg arg);
710} KeyStruct;
711
712
713#endif /* mpmst_h */ 703#endif /* mpmst_h */
714 704
715 705