public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Gaius Mulley <gaius@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/modula-2] cgetopt.c correct symbol names to reflect module stem. Date: Wed, 26 Jan 2022 17:24:42 +0000 (GMT) [thread overview] Message-ID: <20220126172442.EC389383F400@sourceware.org> (raw) https://gcc.gnu.org/g:faff2e5af16adc43df3588742d0a777462631ae6 commit faff2e5af16adc43df3588742d0a777462631ae6 Author: Gaius Mulley <gaius.mulley@southwales.ac.uk> Date: Wed Jan 26 17:23:49 2022 +0000 cgetopt.c correct symbol names to reflect module stem. This patch corrects the symbol names within cgetopt which mimics a Modula-2 module. The external symbols must be named in the same way module_variablename, module_functionname or module_typename as gm2. libgm2/ChangeLog: * libm2pim/cgetopt.c (getopt_Options_s): Renamed to getopt_Options_s. (getopt_Options) Renamed as cgetopt_Options. (getopt_InitOptions) Renamed as cgetopt_InitOptions. (getopt_KillOptions) Renamed as cgetopt_KillOptions. (getopt_SetOption) Renamed as cgetopt_SetOption. (getopt_GetLongOptionArray) Renamed as cgetopt_GetLongOptionArray. (_M2_getopt_init) Renamed as c_M2_getopt_init. (_M2_getopt_finish) Renamed as c_M2_getopt_finish. Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk> Diff: --- libgm2/libm2pim/cgetopt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libgm2/libm2pim/cgetopt.c b/libgm2/libm2pim/cgetopt.c index 0b69379a766..7435118b73b 100644 --- a/libgm2/libm2pim/cgetopt.c +++ b/libgm2/libm2pim/cgetopt.c @@ -76,18 +76,18 @@ cgetopt_getopt_long_only (int argc, char *argv[], char *optstring, return r; } -typedef struct getopt_Options_s +typedef struct cgetopt_Options_s { struct option *cinfo; unsigned int high; -} getopt_Options; +} cgetopt_Options; /* InitOptions a constructor for Options. */ -getopt_Options * -getopt_InitOptions (void) +cgetopt_Options * +cgetopt_InitOptions (void) { - getopt_Options *o = (getopt_Options *)malloc (sizeof (getopt_Options)); + cgetopt_Options *o = (cgetopt_Options *)malloc (sizeof (cgetopt_Options)); o->cinfo = (struct option *)malloc (sizeof (struct option)); o->high = 0; return o; @@ -96,8 +96,8 @@ getopt_InitOptions (void) /* KillOptions a deconstructor for Options. Returns NULL after freeing up all allocated memory associated with o. */ -getopt_Options * -getopt_KillOptions (getopt_Options *o) +cgetopt_Options * +cgetopt_KillOptions (cgetopt_Options *o) { free (o->cinfo); free (o); @@ -107,8 +107,8 @@ getopt_KillOptions (getopt_Options *o) /* SetOption set option[index] with {name, has_arg, flag, val}. */ void -getopt_SetOption (getopt_Options *o, unsigned int index, char *name, - unsigned int has_arg, int *flag, int val) +cgetopt_SetOption (cgetopt_Options *o, unsigned int index, char *name, + unsigned int has_arg, int *flag, int val) { if (index > o->high) { @@ -126,7 +126,7 @@ getopt_SetOption (getopt_Options *o, unsigned int index, char *name, long options. */ struct option * -getopt_GetLongOptionArray (getopt_Options *o) +cgetopt_GetLongOptionArray (cgetopt_Options *o) { return o->cinfo; } @@ -134,11 +134,11 @@ getopt_GetLongOptionArray (getopt_Options *o) /* GNU Modula-2 linking fodder. */ void -_M2_getopt_init (void) +_M2_cgetopt_init (void) { } void -_M2_getopt_finish (void) +_M2_cgetopt_finish (void) { }
reply other threads:[~2022-01-26 17:24 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220126172442.EC389383F400@sourceware.org \ --to=gaius@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).