public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/modula-2] cgetopt.c correct symbol names to reflect module stem.
@ 2022-01-26 17:24 Gaius Mulley
  0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2022-01-26 17:24 UTC (permalink / raw)
  To: gcc-cvs

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)
 {
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-26 17:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 17:24 [gcc/devel/modula-2] cgetopt.c correct symbol names to reflect module stem Gaius Mulley

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).