]> ocean-lang.org Git - ocean/commitdiff
mdcode: rename code_print to code_node_print and export it.
authorNeilBrown <neilb@suse.de>
Fri, 12 Jul 2013 21:13:55 +0000 (07:13 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 12 Jul 2013 21:13:55 +0000 (07:13 +1000)
Signed-off-by: NeilBrown <neilb@suse.de>
csrc/mdcode.mdc

index f49ee83e6775d5441ee05385385bae67ba198914..afd2b29bac424428205bda9d4b454b0478019b73 100644 (file)
@@ -93,6 +93,7 @@ will "do the right thing".
 
 ### File: mdcode.h
 
+       #include <stdio.h>
        ## exported types
        ## exported functions
 
@@ -118,6 +119,7 @@ will "do the right thing".
 
        #include <unistd.h>
        #include <stdlib.h>
+       #include <stdio.h>
 
        #include "mdcode.h"
 
@@ -775,10 +777,10 @@ record some extra state in each `code_node`.  For now we won't bother.
 The indents we insert will all be spaces.  This might not work well
 for `Makefiles`.
 
-##### client functions
+##### internal functions
 
-       static void code_print(FILE *out, struct code_node *node,
-                              char *fname)
+       void code_node_print(FILE *out, struct code_node *node,
+                            char *fname)
        {
                for (; node; node = node->next) {
                        char *c = node->code.txt;
@@ -809,6 +811,9 @@ for `Makefiles`.
                }
        }
 
+###### exported functions
+       void code_node_print(FILE *out, struct code_node *node, char *fname);
+
 ### Bringing it all together
 
 We are just about ready for the `main` function of the tool which will
@@ -856,7 +861,6 @@ we are done.
        #include <errno.h>
        #include <sys/mman.h>
        #include <string.h>
-       #include <stdio.h>
 
 ##### client functions
 
@@ -915,7 +919,7 @@ we are done.
                                errs++;
                                continue;
                        }
-                       code_print(fl, s->code, argv[1]);
+                       code_node_print(fl, s->code, argv[1]);
                        fclose(fl);
                }
                exit(!!errs);