diff options
| author | Richard Brooksby | 2013-05-09 12:46:59 +0100 |
|---|---|---|
| committer | Richard Brooksby | 2013-05-09 12:46:59 +0100 |
| commit | 60ae2d01bef98a16fd249d63c9045ca311980524 (patch) | |
| tree | f7bc6ed9ba1f75a0193323fd6f5450363a6f80c6 /mps/code | |
| parent | 3815e622a8c13730e9a67e2d4ede962a65806bd2 (diff) | |
| download | emacs-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.h | 12 | ||||
| -rw-r--r-- | mps/code/mpmst.h | 10 |
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 */ | ||
| 19 | typedef 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 | |||
| 20 | extern Bool KeyCheck(Key key); | 30 | extern Bool KeyCheck(Key key); |
| 21 | extern Bool ArgCheck(Arg arg); | 31 | extern Bool ArgCheck(Arg arg); |
| 22 | extern Bool ArgListCheck(ArgList args); | 32 | extern Bool ArgListCheck(ArgList args); |
| 33 | |||
| 23 | extern Bool ArgPick(ArgStruct *argOut, ArgList args, Key key); | 34 | extern Bool ArgPick(ArgStruct *argOut, ArgList args, Key key); |
| 35 | |||
| 24 | extern Bool ArgCheckCant(Arg arg); | 36 | extern Bool ArgCheckCant(Arg arg); |
| 25 | extern Bool ArgCheckFormat(Arg arg); | 37 | extern Bool ArgCheckFormat(Arg arg); |
| 26 | extern Bool ArgCheckChain(Arg arg); | 38 | extern 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 */ | ||
| 706 | typedef 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 | ||