From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id EC389383F400; Wed, 26 Jan 2022 17:24:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC389383F400 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/modula-2] cgetopt.c correct symbol names to reflect module stem. X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/devel/modula-2 X-Git-Oldrev: 07395a6e22ebd4a9378dfac9c66000a3514ac999 X-Git-Newrev: faff2e5af16adc43df3588742d0a777462631ae6 Message-Id: <20220126172442.EC389383F400@sourceware.org> Date: Wed, 26 Jan 2022 17:24:42 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2022 17:24:43 -0000 https://gcc.gnu.org/g:faff2e5af16adc43df3588742d0a777462631ae6 commit faff2e5af16adc43df3588742d0a777462631ae6 Author: Gaius Mulley 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 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) { }