Преглед изворни кода

Move header inclusions, macros into appropriate files

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40842 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements пре 15 година
родитељ
комит
604a1fe33e

+ 19 - 0
lib/gis/parser.c

@@ -73,8 +73,27 @@
  * \author Soeren Gebbert added Dec. 2009 WPS process_description document
  */
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <grass/gis.h>
+#include <grass/spawn.h>
+#include <grass/glocale.h>
+
 #include "parser_local_proto.h"
 
+enum opt_error {
+    BAD_SYNTAX    = 1,
+    OUT_OF_RANGE  = 2,
+    MISSING_VALUE = 3,
+    AMBIGUOUS     = 4,
+    REPLACED      = 5
+};
+
+#define KEYLENGTH 64
+
 /* initialize the global struct */
 struct state state;
 struct state *st = &state;

+ 6 - 0
lib/gis/parser_help.c

@@ -12,6 +12,12 @@
  * \author Soeren Gebbert added Dec. 2009 WPS process_description document
  */
 
+#include <stdio.h>
+#include <string.h>
+
+#include <grass/gis.h>
+#include <grass/glocale.h>
+
 #include "parser_local_proto.h"
 
 static void show_options(int, const char *);

+ 5 - 0
lib/gis/parser_html.c

@@ -1,3 +1,8 @@
+#include <stdio.h>
+
+#include <grass/gis.h>
+#include <grass/glocale.h>
+
 #include "parser_local_proto.h"
 
 static void print_escaped_for_html(FILE * f, const char *str);

+ 1 - 26
lib/gis/parser_local_proto.h

@@ -1,25 +1,8 @@
 #ifndef __PARSER_LOCAL_PROTO_H__
 #define __PARSER_LOCAL_PROTO_H__
 
-#include <grass/config.h>
-
-#if defined(HAVE_LANGINFO_H)
-#include <langinfo.h>
-#endif
-#if defined(__MINGW32__) && defined(USE_NLS)
-#include <localcharset.h>
-#endif
-
 #include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <stdarg.h>
-#include <sys/types.h>
 #include <grass/gis.h>
-#include <grass/glocale.h>
-#include <grass/spawn.h>
 
 struct Item
 {
@@ -54,16 +37,8 @@ struct state {
     int n_items;
 };
 
-
 extern struct state *st;
 
-#define BAD_SYNTAX    1
-#define OUT_OF_RANGE  2
-#define MISSING_VALUE 3
-#define AMBIGUOUS     4
-#define REPLACED      5
-#define KEYLENGTH 64
-
 /* functions which are used by several parser functions in different files */
 
 void G__usage_xml(void);
@@ -71,7 +46,7 @@ void G__usage_html(void);
 void G__script(void);
 void G__wps_print_process_description(void);
 int  G__uses_new_gisprompt(void);
-void G__print_keywords(FILE *fd, void (*format)(FILE *, const char *));
+void G__print_keywords(FILE *, void (*)(FILE *, const char *));
 
 #endif
 

+ 4 - 0
lib/gis/parser_script.c

@@ -12,6 +12,10 @@
  * \author Soeren Gebbert added Dec. 2009 WPS process_description document
  */
 
+#include <stdio.h>
+
+#include <grass/gis.h>
+
 #include "parser_local_proto.h"
 
 void G__script(void)

+ 3 - 0
lib/gis/parser_standard_options.c

@@ -12,6 +12,9 @@
  * \author Soeren Gebbert added Dec. 2009 WPS process_description document
  */
 
+#include <grass/gis.h>
+#include <grass/glocale.h>
+
 #include "parser_local_proto.h"
 
 /*!

+ 17 - 0
lib/gis/parser_wps.c

@@ -1,3 +1,20 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <grass/config.h>
+#include <grass/gis.h>
+#include <grass/glocale.h>
+
+#if defined(HAVE_LANGINFO_H)
+#include <langinfo.h>
+#endif
+#if defined(__MINGW32__) && defined(USE_NLS)
+#include <localcharset.h>
+#endif
+
 #include "parser_local_proto.h"
 
 /* Defines and prototypes for WPS process_description XML document generation