فهرست منبع

move prototypes from include/ to include/defs

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49183 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 سال پیش
والد
کامیت
9f261a7fd6
100فایلهای تغییر یافته به همراه2008 افزوده شده و 1575 حذف شده
  1. 0 1
      db/db.columns/main.c
  2. 0 1
      db/db.connect/main.c
  3. 0 1
      db/db.copy/main.c
  4. 0 1
      db/db.createdb/main.c
  5. 0 1
      db/db.databases/main.c
  6. 0 1
      db/db.describe/main.c
  7. 0 2
      db/db.drivers/main.c
  8. 0 1
      db/db.dropdb/main.c
  9. 0 1
      db/db.execute/main.c
  10. 0 1
      db/db.select/main.c
  11. 0 1
      db/db.tables/main.c
  12. 7 1
      include/Makefile
  13. 3 133
      include/Paintlib.h
  14. 5 10
      include/arraystats.h
  15. 5 23
      include/bitmap.h
  16. 2 2
      include/blas.h
  17. 5 16
      include/btree.h
  18. 4 35
      include/cdhc.h
  19. 1 48
      include/cluster.h
  20. 0 3
      include/codes.h
  21. 1 5
      include/colors.h
  22. 1 1
      include/datetime.h
  23. 5 1
      include/dbmi.h
  24. 141 0
      include/defs/Paintlib.h
  25. 16 0
      include/defs/arraystats.h
  26. 24 0
      include/defs/bitmap.h
  27. 22 0
      include/defs/btree.h
  28. 35 0
      include/defs/cdhc.h
  29. 53 0
      include/defs/cluster.h
  30. 10 0
      include/defs/colors.h
  31. 3 4
      include/P_datetime.h
  32. 2 2
      include/dbmidefs.h
  33. 66 0
      include/defs/devlib.h
  34. 59 0
      include/defs/dig_atts.h
  35. 165 0
      include/defs/display.h
  36. 25 0
      include/defs/dlg.h
  37. 11 0
      include/defs/form.h
  38. 0 0
      include/defs/gis.h
  39. 7 0
      include/defs/glocale.h
  40. 180 0
      include/defs/gmath.h
  41. 51 0
      include/defs/gprojects.h
  42. 14 0
      include/defs/ibtree.h
  43. 14 0
      include/defs/icon.h
  44. 0 0
      include/defs/imagery.h
  45. 51 0
      include/defs/la.h
  46. 22 0
      include/defs/libtrans.h
  47. 26 0
      include/defs/linkm.h
  48. 46 0
      include/defs/manage.h
  49. 90 0
      include/defs/neta.h
  50. 105 0
      include/defs/nviz.h
  51. 3 35
      include/ogsf_proto.h
  52. 74 0
      include/defs/ortholib.h
  53. 0 0
      include/defs/raster.h
  54. 0 0
      include/defs/raster3d.h
  55. 19 0
      include/defs/rbtree.h
  56. 13 0
      include/defs/rowio.h
  57. 19 0
      include/defs/segment.h
  58. 26 3
      include/P_site.h
  59. 133 0
      include/defs/sitelib.h
  60. 9 0
      include/defs/spawn.h
  61. 41 0
      include/defs/sqlp.h
  62. 54 0
      include/defs/stats.h
  63. 7 0
      include/defs/symbol.h
  64. 21 0
      include/defs/transform.h
  65. 67 0
      include/defs/vedit.h
  66. 1 160
      include/display.h
  67. 6 20
      include/dlg.h
  68. 2 2
      include/fontcap.h
  69. 6 6
      include/form.h
  70. 0 4
      include/geom.h
  71. 1 1
      include/gis.h
  72. 1 2
      include/glocale.h
  73. 4 180
      include/gmath.h
  74. 4 44
      include/gprojects.h
  75. 0 121
      include/gsurf.h
  76. 6 9
      include/ibtree.h
  77. 3 11
      include/icon.h
  78. 1 1
      include/imagery.h
  79. 0 27
      include/keyframe.h
  80. 0 36
      include/kftypes.h
  81. 4 52
      include/la.h
  82. 4 20
      include/libtrans.h
  83. 2 22
      include/linkm.h
  84. 5 0
      include/lock.h
  85. 1 41
      include/manage.h
  86. 3 86
      include/neta.h
  87. 2 102
      include/nviz.h
  88. 163 6
      include/gstypes.h
  89. 4 67
      include/ortholib.h
  90. 1 1
      include/raster.h
  91. 1 1
      include/raster3d.h
  92. 5 13
      include/rbtree.h
  93. 0 18
      include/readsites.h
  94. 1 8
      include/rowio.h
  95. 0 3
      include/search.h
  96. 1 14
      include/segment.h
  97. 10 31
      include/site.h
  98. 2 127
      include/sitelib.h
  99. 1 5
      include/spawn.h
  100. 0 0
      include/sqlp.h

+ 0 - 1
db/db.columns/main.c

@@ -15,7 +15,6 @@
 
 #include <grass/gis.h>
 #include <grass/dbmi.h>
-#include <grass/codes.h>
 #include <stdlib.h>
 #include <grass/glocale.h>
 

+ 0 - 1
db/db.connect/main.c

@@ -21,7 +21,6 @@
 #include <string.h>
 #include <grass/gis.h>
 #include <grass/dbmi.h>
-#include <grass/codes.h>
 #include <grass/glocale.h>
 
 /* database for DBF can be written with variables:

+ 0 - 1
db/db.copy/main.c

@@ -16,7 +16,6 @@
 #include <stdlib.h>
 #include <grass/gis.h>
 #include <grass/dbmi.h>
-#include <grass/codes.h>
 #include <grass/glocale.h>
 
 

+ 0 - 1
db/db.createdb/main.c

@@ -16,7 +16,6 @@
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include <grass/gis.h>
-#include <grass/codes.h>
 #include <grass/glocale.h>
 
 

+ 0 - 1
db/db.databases/main.c

@@ -16,7 +16,6 @@
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include <grass/gis.h>
-#include <grass/codes.h>
 #include <grass/glocale.h>
 
 

+ 0 - 1
db/db.describe/main.c

@@ -19,7 +19,6 @@
 #include <string.h>
 #include <grass/gis.h>
 #include <grass/dbmi.h>
-#include <grass/codes.h>
 #include <grass/glocale.h>
 #include "local_proto.h"
 

+ 0 - 2
db/db.drivers/main.c

@@ -14,9 +14,7 @@
  *****************************************************************************/
 
 #include <stdlib.h>
-#include <grass/codes.h>
 #include <grass/dbmi.h>
-#include <grass/codes.h>
 #include <grass/gis.h>
 #include <grass/glocale.h>
 

+ 0 - 1
db/db.dropdb/main.c

@@ -16,7 +16,6 @@
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include <grass/gis.h>
-#include <grass/codes.h>
 #include <grass/glocale.h>
 
 

+ 0 - 1
db/db.execute/main.c

@@ -23,7 +23,6 @@
 #include <errno.h>
 #include <grass/gis.h>
 #include <grass/dbmi.h>
-#include <grass/codes.h>
 #include <grass/glocale.h>
 
 struct

+ 0 - 1
db/db.select/main.c

@@ -22,7 +22,6 @@
 
 #include <grass/gis.h>
 #include <grass/dbmi.h>
-#include <grass/codes.h>
 #include <grass/glocale.h>
 #include "local_proto.h"
 

+ 0 - 1
db/db.tables/main.c

@@ -16,7 +16,6 @@
 #include <stdlib.h>
 #include <grass/gis.h>
 #include <grass/dbmi.h>
-#include <grass/codes.h>
 #include <grass/glocale.h>
 
 

+ 7 - 1
include/Makefile

@@ -3,7 +3,7 @@ MODULE_TOPDIR = ..
 include $(MODULE_TOPDIR)/include/Make/Vars.make
 include $(MODULE_TOPDIR)/include/Make/Rules.make
 
-SRCH := $(wildcard ../include/*.h ../include/vect/*.h ../include/iostream/*.h)
+SRCH := $(wildcard ../include/*.h ../include/defs/*.h ../include/vect/*.h ../include/iostream/*.h)
 DSTH := $(patsubst ../include/%.h,$(ARCH_INCDIR)/%.h,$(SRCH))
 DSTH_EXTRA = $(ARCH_INCDIR)/copying.h $(ARCH_INCDIR)/confparms.h
 
@@ -15,6 +15,9 @@ default: $(DSTH) $(DSTH_EXTRA) $(DSTMAKE)
 # cancel rule from Rules.make
 $(ARCH_INCDIR)/%.h: %.h
 
+$(ARCH_INCDIR)/defs/%.h: defs/%.h | $(ARCH_INCDIR)/defs
+	$(INSTALL_DATA) $< $@
+
 $(ARCH_INCDIR)/vect/%.h: vect/%.h | $(ARCH_INCDIR)/vect
 	$(INSTALL_DATA) $< $@
 
@@ -24,6 +27,9 @@ $(ARCH_INCDIR)/iostream/%.h: iostream/%.h | $(ARCH_INCDIR)/iostream
 $(ARCH_INCDIR)/%.h: %.h | $(ARCH_INCDIR)
 	$(INSTALL_DATA) $< $@
 
+$(ARCH_INCDIR)/defs: | $(ARCH_INCDIR)
+	$(MKDIR) $@
+
 $(ARCH_INCDIR)/vect: | $(ARCH_INCDIR)
 	$(MKDIR) $@
 

+ 3 - 133
include/Paintlib.h

@@ -1,136 +1,6 @@
-/* From applib */
-/* alpha.c */
-int Palpha(void);
+#ifndef GRASS_PAINTLIB_H
+#define GRASS_PAINTLIB_H
 
-/* close.c */
-int Pclose(void);
+#include <grass/defs/paintlib.h>
 
-/* colorlevel.c */
-int Pcolorlevels(int *, int *, int *);
-
-/* colormult.c */
-int Pcolormultipliers(int *, int *, int *);
-
-/* colornum.c */
-int Pcolornum(double, double, double);
-
-/* colortable.c */
-int Pcolortable(unsigned char *, unsigned char *, unsigned char *,
-		unsigned char *, int);
-/* colorvalue.c */
-int Pcolorvalue(int, float *, float *, float *);
-
-/* connect.c */
-int Pconnect(void);
-int Pdisconnect(void);
-
-/* data.c */
-int Pdata_begin(void);
-int Pdata(unsigned char *, int);
-int Pdata_end(void);
-
-/* device.c */
-int P__closedev(void);
-int P__errordev(char *);
-int P__flushdev(void);
-int P__opendev(char *, char *[], char *);
-int P__readdev(void *, int);
-int P__writedev(void *, int);
-
-/* flush.c */
-int Pflush(void);
-
-/* hres.c */
-double Phres(void);
-
-/* io.c */
-int P__opcode(int);
-int P__get(char *, int);
-int P__gets(char *);
-int P__geti(void);
-double P__getf(void);
-int P__send(char *, int);
-int P__sendi(int);
-int P__sendf(double);
-int P__sends(char *);
-int P__transparent(int);
-
-/* lock.c */
-int Plock(void);
-
-/* misc.c */
-int Pblockspace(void);
-int Pblocksize(void);
-int Pnblocks(void);
-int Ptextspace(void);
-int Ptextfudge(void);
-double Ptextscale(void);
-
-/* nchars.c */
-int Pnchars(void);
-
-/* ncolors.c */
-int Pncolors(void);
-
-/* npixels.c */
-int Pnpixels(int *, int *);
-
-/* painter.c */
-char *Ppainter_name(void);
-
-/* pictsize.c */
-int Ppictsize(int, int);
-
-/* raster.c */
-int Praster(void);
-
-/* rle.c */
-int Prle_begin(void);
-int Prle_end(void);
-int Prle_set_cols(int);
-
-/* text.c */
-int Ptext(char *);
-
-/* vres.c */
-double Pvres(void);
-
-/* From Driver/{whatever} code */
-/* init.c */
-int Pinit(void);
-
-/* finish.c */
-int Pfinish(void);
-
-/* From driverlib */
-/* interface.c */
-int paint_interface(int, char **);
-int paint_error(char *);
-int paint_delay(int);
-int paint_lock(char *, int);
-int paint_unlock(void);
-int paint_colortable(int);
-
-/* colors.c */
-int Pset_color_levels(int);
-int Pcolorlevels(int *, int *, int *);
-int Pcolormultipliers(int *, int *, int *);
-int Pcolornum(double, double, double);
-int Pcolorvalue(int, float *, float *, float *);
-int Pncolors(void);
-
-/* io.c */
-int Pclose(void);
-int Pflush(void);
-int Pout(char *, int);
-int Poutc(int);
-int Pouts(char *);
-
-#ifdef PAINT_DRIVERLIB
-int Popen(char *);
-int Prle(unsigned char *, int);
-#else
-/* open.c */
-int Popen(void);
-int Prle(unsigned char, int);
 #endif

+ 5 - 10
include/arraystats.h

@@ -1,3 +1,6 @@
+#ifndef GRASS_ARRAYSTATS_H
+#define GRASS_ARRAYSTATS_H
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
@@ -19,14 +22,6 @@ struct GASTATS
     double stdev;
 };
 
-double class_apply_algorithm(char *, double *, int, int *, double *);
-int class_interval(double *, int, int, double *);
-int class_quant(double *, int, int, double *);
-double class_discont(double *, int, int, double *);
-double class_stdev(double *, int, int, double *);
-int class_equiprob(double *, int, int *, double *);
-
-int class_frequencies(double *, int, int, double *, int *);
+#include <grass/defs/arraystats.h>
 
-void eqdrt(double[], double[], int, int, double *);
-void basic_stats(double *, int, struct GASTATS *);
+#endif

+ 5 - 23
include/bitmap.h

@@ -1,5 +1,5 @@
-#ifndef __GRASS_BITMAP__
-#define __GRASS_BITMAP__
+#ifndef GRASS_BITMAP_H
+#define GRASS_BITMAP_H
 
 #define BM_MAGIC  2
 
@@ -37,24 +37,6 @@ struct BMlink
 #include <stdio.h>
 #endif
 
-/* bitmap.c */
-struct BM *BM_create(int, int);
-int BM_destroy(struct BM *);
-int BM_set_mode(int, int);
-int BM_set(struct BM *, int, int, int);
-int BM_get(struct BM *, int, int);
-int BM_get_map_size(struct BM *);
-int BM_file_write(FILE *, struct BM *);
-struct BM *BM_file_read(FILE *);
-
-/* sparse.c */
-struct BM *BM_create_sparse(int, int);
-int BM_destroy_sparse(struct BM *);
-int BM_set_sparse(struct BM *, int, int, int);
-int BM_get_sparse(struct BM *, int, int);
-int BM_get_map_size_sparse(struct BM *);
-int BM_dump_map_sparse(struct BM *);
-int BM_dump_map_row_sparse(struct BM *, int);
-int BM_file_write_sparse(FILE *, struct BM *);
-
-#endif /*  __GRASS_BITMAP__  */
+#include <grass/defs/bitmap.h>
+
+#endif /*  GRASS_BITMAP_H  */

+ 2 - 2
include/blas.h

@@ -1,5 +1,5 @@
-#ifndef BLAS_WRAP_
-#define BLAS_WRAP_
+#ifndef BLAS_WRAP_H
+#define BLAS_WRAP_H
 
 extern int caxpy_(integer * n, complex * ca, complex * cx, integer * incx,
 		  complex * cy, integer * incy);

+ 5 - 16
include/btree.h

@@ -1,3 +1,6 @@
+#ifndef GRASS_BTREE_H
+#define GRASS_BTREE_H
+
 typedef struct
 {
     void *key;
@@ -16,20 +19,6 @@ typedef struct
     int (*cmp) (const void *, const void *);	/* routine to compare keys */
 } BTREE;
 
-/* create.c */
-int btree_create(BTREE *, int (*)(const void *, const void *), int);
-
-/* find.c */
-int btree_find(const BTREE *, const void *, void **);
-
-/* free.c */
-int btree_free(BTREE *);
-
-/* next.c */
-int btree_next(BTREE *, void **, void **);
-
-/* rewind.c */
-int btree_rewind(BTREE *);
+#include <grass/defs/btree.h>
 
-/* update.c */
-int btree_update(BTREE *, const void *, int, const void *, int);
+#endif

+ 4 - 35
include/cdhc.h

@@ -1,37 +1,6 @@
-#ifndef __CDHC_H__
-#define __CDHC_H__
+#ifndef CDHC_H
+#define CDHC_H
 
+#include <grass/defs/cdhc.h>
 
-double enormp(double);
-double normp(double);
-double xinormal(double);
-double *dmax(double *, int);
-double *dmax_exp(double *, int);
-double *omnibus_moments(double *, int);
-double *geary_test(double *, int);
-double *dagostino_d(double *, int);
-double *extreme(double *, int);
-double *kuipers_v(double *, int);
-double *watson_u2(double *, int);
-double *durbins_exact(double *, int);
-double *anderson_darling(double *, int);
-double *cramer_von_mises(double *, int);
-double *kolmogorov_smirnov(double *, int);
-double *chi_square(double *, int);
-double *shapiro_wilk(double *, int);
-double *shapiro_francia(double *, int);
-double *weisberg_bingham(double *, int);
-double *royston(double *, int);
-double *shapiro_wilk_exp(double *, int);
-double *kolmogorov_smirnov_exp(double *, int);
-double *cramer_von_mises_exp(double *, int);
-double *kuipers_v_exp(double *, int);
-double *watson_u2_exp(double *, int);
-double *anderson_darling_exp(double *, int);
-double *chi_square_exp(double *, int);
-double *mod_maxlik_ratio(double *, int);
-double *coeff_variation(double *, int);
-double *kotz_families(double *, int);
-
-
-#endif /* __CDHC_H__ */
+#endif /* CDHC_H */

+ 1 - 48
include/cluster.h

@@ -30,53 +30,6 @@ struct Cluster
     double percent_stable;      /* percentage stable */
 };
 
-/* c_assign.c */
-int I_cluster_assign(struct Cluster *, int *);
-
-/* c_begin.c */
-int I_cluster_begin(struct Cluster *, int);
-
-/* c_clear.c */
-int I_cluster_clear(struct Cluster *);
-
-/* c_distinct.c */
-int I_cluster_distinct(struct Cluster *, double);
-
-/* c_exec.c */
-int I_cluster_exec(struct Cluster *, int, int, double, double, int, int (*)(),
-		   int *);
-/* c_execmem.c */
-int I_cluster_exec_allocate(struct Cluster *);
-int I_cluster_exec_free(struct Cluster *);
-
-/* c_means.c */
-int I_cluster_means(struct Cluster *);
-
-/* c_merge.c */
-int I_cluster_merge(struct Cluster *);
-
-/* c_nclasses.c */
-int I_cluster_nclasses(struct Cluster *, int);
-
-/* c_point.c */
-int I_cluster_point(struct Cluster *, DCELL *);
-int I_cluster_begin_point_set(struct Cluster *, int);
-int I_cluster_point_part(struct Cluster *, DCELL, int, int);
-int I_cluster_end_point_set(struct Cluster *, int);
-
-/* c_reassign.c */
-int I_cluster_reassign(struct Cluster *, int *);
-
-/* c_reclass.c */
-int I_cluster_reclass(struct Cluster *, int);
-
-/* c_sep.c */
-double I_cluster_separation(struct Cluster *, int, int);
-
-/* c_sig.c */
-int I_cluster_signatures(struct Cluster *);
-
-/* c_sum2.c */
-int I_cluster_sum2(struct Cluster *);
+#include <grass/defs/cluster.h>
 
 #endif

+ 0 - 3
include/codes.h

@@ -1,3 +0,0 @@
-/* exit codes */
-#define OK 0
-#define ERROR 1

+ 1 - 5
include/colors.h

@@ -41,10 +41,6 @@ struct color_name
     int number;
 };
 
-int G_num_standard_colors(void);
-struct color_rgb G_standard_color_rgb(int);
-int G_num_standard_color_names(void);
-const struct color_name *G_standard_color_name(int);
-int G_str_to_color(const char *, int *, int *, int *);
+#include <grass/defs/colors.h>
 
 #endif

+ 1 - 1
include/datetime.h

@@ -25,6 +25,6 @@ typedef struct DateTime
 } DateTime;
 
 /* prototype of functions */
-#include <grass/P_datetime.h>
+#include <grass/defs/datetime.h>
 
 #endif

+ 5 - 1
include/dbmi.h

@@ -15,6 +15,10 @@
 #include <stdio.h>
 #include <grass/gis.h>
 
+/* exit codes */
+#define OK 0
+#define ERROR 1
+
 #define DB_VERSION "0"
 
 #define DB_DEFAULT_DRIVER "sqlite"
@@ -311,6 +315,6 @@ typedef struct
     char **label;		/* array of new category labels */
 } dbRclsRule;
 
-#include <grass/dbmidefs.h>
+#include <grass/defs/dbmi.h>
 
 #endif

+ 141 - 0
include/defs/Paintlib.h

@@ -0,0 +1,141 @@
+#ifndef GRASS_PAINTLIBDEFS_H
+#define GRASS_PAINTLIBDEFS_H
+
+/* From applib */
+/* alpha.c */
+int Palpha(void);
+
+/* close.c */
+int Pclose(void);
+
+/* colorlevel.c */
+int Pcolorlevels(int *, int *, int *);
+
+/* colormult.c */
+int Pcolormultipliers(int *, int *, int *);
+
+/* colornum.c */
+int Pcolornum(double, double, double);
+
+/* colortable.c */
+int Pcolortable(unsigned char *, unsigned char *, unsigned char *,
+		unsigned char *, int);
+/* colorvalue.c */
+int Pcolorvalue(int, float *, float *, float *);
+
+/* connect.c */
+int Pconnect(void);
+int Pdisconnect(void);
+
+/* data.c */
+int Pdata_begin(void);
+int Pdata(unsigned char *, int);
+int Pdata_end(void);
+
+/* device.c */
+int P__closedev(void);
+int P__errordev(char *);
+int P__flushdev(void);
+int P__opendev(char *, char *[], char *);
+int P__readdev(void *, int);
+int P__writedev(void *, int);
+
+/* flush.c */
+int Pflush(void);
+
+/* hres.c */
+double Phres(void);
+
+/* io.c */
+int P__opcode(int);
+int P__get(char *, int);
+int P__gets(char *);
+int P__geti(void);
+double P__getf(void);
+int P__send(char *, int);
+int P__sendi(int);
+int P__sendf(double);
+int P__sends(char *);
+int P__transparent(int);
+
+/* lock.c */
+int Plock(void);
+
+/* misc.c */
+int Pblockspace(void);
+int Pblocksize(void);
+int Pnblocks(void);
+int Ptextspace(void);
+int Ptextfudge(void);
+double Ptextscale(void);
+
+/* nchars.c */
+int Pnchars(void);
+
+/* ncolors.c */
+int Pncolors(void);
+
+/* npixels.c */
+int Pnpixels(int *, int *);
+
+/* painter.c */
+char *Ppainter_name(void);
+
+/* pictsize.c */
+int Ppictsize(int, int);
+
+/* raster.c */
+int Praster(void);
+
+/* rle.c */
+int Prle_begin(void);
+int Prle_end(void);
+int Prle_set_cols(int);
+
+/* text.c */
+int Ptext(char *);
+
+/* vres.c */
+double Pvres(void);
+
+/* From Driver/{whatever} code */
+/* init.c */
+int Pinit(void);
+
+/* finish.c */
+int Pfinish(void);
+
+/* From driverlib */
+/* interface.c */
+int paint_interface(int, char **);
+int paint_error(char *);
+int paint_delay(int);
+int paint_lock(char *, int);
+int paint_unlock(void);
+int paint_colortable(int);
+
+/* colors.c */
+int Pset_color_levels(int);
+int Pcolorlevels(int *, int *, int *);
+int Pcolormultipliers(int *, int *, int *);
+int Pcolornum(double, double, double);
+int Pcolorvalue(int, float *, float *, float *);
+int Pncolors(void);
+
+/* io.c */
+int Pclose(void);
+int Pflush(void);
+int Pout(char *, int);
+int Poutc(int);
+int Pouts(char *);
+
+#ifdef PAINT_DRIVERLIB
+int Popen(char *);
+int Prle(unsigned char *, int);
+#else
+/* open.c */
+int Popen(void);
+int Prle(unsigned char, int);
+#endif
+
+#endif

+ 16 - 0
include/defs/arraystats.h

@@ -0,0 +1,16 @@
+#ifndef GRASS_ARRAYSTATSDEFS_H
+#define GRASS_ARRAYSTATSDEFS_H
+
+double class_apply_algorithm(char *, double *, int, int *, double *);
+int class_interval(double *, int, int, double *);
+int class_quant(double *, int, int, double *);
+double class_discont(double *, int, int, double *);
+double class_stdev(double *, int, int, double *);
+int class_equiprob(double *, int, int *, double *);
+
+int class_frequencies(double *, int, int, double *, int *);
+
+void eqdrt(double[], double[], int, int, double *);
+void basic_stats(double *, int, struct GASTATS *);
+
+#endif

+ 24 - 0
include/defs/bitmap.h

@@ -0,0 +1,24 @@
+#ifndef GRASS_BITMAPDEFS_H
+#define GRASS_BITMAPDEFS_H
+
+/* bitmap.c */
+struct BM *BM_create(int, int);
+int BM_destroy(struct BM *);
+int BM_set_mode(int, int);
+int BM_set(struct BM *, int, int, int);
+int BM_get(struct BM *, int, int);
+int BM_get_map_size(struct BM *);
+int BM_file_write(FILE *, struct BM *);
+struct BM *BM_file_read(FILE *);
+
+/* sparse.c */
+struct BM *BM_create_sparse(int, int);
+int BM_destroy_sparse(struct BM *);
+int BM_set_sparse(struct BM *, int, int, int);
+int BM_get_sparse(struct BM *, int, int);
+int BM_get_map_size_sparse(struct BM *);
+int BM_dump_map_sparse(struct BM *);
+int BM_dump_map_row_sparse(struct BM *, int);
+int BM_file_write_sparse(FILE *, struct BM *);
+
+#endif /*  GRASS_BITMAPDEFS_H  */

+ 22 - 0
include/defs/btree.h

@@ -0,0 +1,22 @@
+#ifndef GRASS_BTREEDEFS_H
+#define GRASS_BTREEDEFS_H
+
+/* create.c */
+int btree_create(BTREE *, int (*)(const void *, const void *), int);
+
+/* find.c */
+int btree_find(const BTREE *, const void *, void **);
+
+/* free.c */
+int btree_free(BTREE *);
+
+/* next.c */
+int btree_next(BTREE *, void **, void **);
+
+/* rewind.c */
+int btree_rewind(BTREE *);
+
+/* update.c */
+int btree_update(BTREE *, const void *, int, const void *, int);
+
+#endif

+ 35 - 0
include/defs/cdhc.h

@@ -0,0 +1,35 @@
+#ifndef CDHCDEFS_H
+#define CDHCDEFS_H
+
+double enormp(double);
+double normp(double);
+double xinormal(double);
+double *dmax(double *, int);
+double *dmax_exp(double *, int);
+double *omnibus_moments(double *, int);
+double *geary_test(double *, int);
+double *dagostino_d(double *, int);
+double *extreme(double *, int);
+double *kuipers_v(double *, int);
+double *watson_u2(double *, int);
+double *durbins_exact(double *, int);
+double *anderson_darling(double *, int);
+double *cramer_von_mises(double *, int);
+double *kolmogorov_smirnov(double *, int);
+double *chi_square(double *, int);
+double *shapiro_wilk(double *, int);
+double *shapiro_francia(double *, int);
+double *weisberg_bingham(double *, int);
+double *royston(double *, int);
+double *shapiro_wilk_exp(double *, int);
+double *kolmogorov_smirnov_exp(double *, int);
+double *cramer_von_mises_exp(double *, int);
+double *kuipers_v_exp(double *, int);
+double *watson_u2_exp(double *, int);
+double *anderson_darling_exp(double *, int);
+double *chi_square_exp(double *, int);
+double *mod_maxlik_ratio(double *, int);
+double *coeff_variation(double *, int);
+double *kotz_families(double *, int);
+
+#endif /* CDHCDEFS_H */

+ 53 - 0
include/defs/cluster.h

@@ -0,0 +1,53 @@
+#ifndef GRASS_CLUSTERDEFS_H
+#define GRASS_CLUSTERDEFS_H
+
+/* c_assign.c */
+int I_cluster_assign(struct Cluster *, int *);
+
+/* c_begin.c */
+int I_cluster_begin(struct Cluster *, int);
+
+/* c_clear.c */
+int I_cluster_clear(struct Cluster *);
+
+/* c_distinct.c */
+int I_cluster_distinct(struct Cluster *, double);
+
+/* c_exec.c */
+int I_cluster_exec(struct Cluster *, int, int, double, double, int, int (*)(),
+		   int *);
+/* c_execmem.c */
+int I_cluster_exec_allocate(struct Cluster *);
+int I_cluster_exec_free(struct Cluster *);
+
+/* c_means.c */
+int I_cluster_means(struct Cluster *);
+
+/* c_merge.c */
+int I_cluster_merge(struct Cluster *);
+
+/* c_nclasses.c */
+int I_cluster_nclasses(struct Cluster *, int);
+
+/* c_point.c */
+int I_cluster_point(struct Cluster *, DCELL *);
+int I_cluster_begin_point_set(struct Cluster *, int);
+int I_cluster_point_part(struct Cluster *, DCELL, int, int);
+int I_cluster_end_point_set(struct Cluster *, int);
+
+/* c_reassign.c */
+int I_cluster_reassign(struct Cluster *, int *);
+
+/* c_reclass.c */
+int I_cluster_reclass(struct Cluster *, int);
+
+/* c_sep.c */
+double I_cluster_separation(struct Cluster *, int, int);
+
+/* c_sig.c */
+int I_cluster_signatures(struct Cluster *);
+
+/* c_sum2.c */
+int I_cluster_sum2(struct Cluster *);
+
+#endif

+ 10 - 0
include/defs/colors.h

@@ -0,0 +1,10 @@
+#ifndef GRASS_COLORSDEFS_H
+#define GRASS_COLORSDEFS_H
+
+int G_num_standard_colors(void);
+struct color_rgb G_standard_color_rgb(int);
+int G_num_standard_color_names(void);
+const struct color_name *G_standard_color_name(int);
+int G_str_to_color(const char *, int *, int *, int *);
+
+#endif

+ 3 - 4
include/P_datetime.h

@@ -1,6 +1,5 @@
-
-#ifndef GRASS_P_DATETIME_H
-#define GRASS_P_DATETIME_H
+#ifndef GRASS_DATETIMEDEFS_H
+#define GRASS_DATETIMEDEFS_H
 
 /* between.c */
 int datetime_is_between(int x, int a, int b);
@@ -104,4 +103,4 @@ int datetime_set_second(DateTime * dt, double second);
 int datetime_get_fracsec(const DateTime * dt, int *fracsec);
 int datetime_set_fracsec(DateTime * dt, int fracsec);
 
-#endif /* GRASS_P_DATETIME_H */
+#endif /* GRASS_DATETIMEDEFS_H */

+ 2 - 2
include/dbmidefs.h

@@ -1,5 +1,5 @@
-#ifndef _PROTO_DBMI_H_
-#define _PROTO_DBMI_H_
+#ifndef GRASS_DBMIDEFS_H
+#define GRASS_DBMIDEFS_H
 
 void db_Cstring_to_lowercase(char *);
 void db_Cstring_to_uppercase(char *);

+ 66 - 0
include/defs/devlib.h

@@ -0,0 +1,66 @@
+int Box_abs(int, int, int, int);
+int Box_rel(int, int);
+int Color_table_float(void);
+int Color_table_fixed(void);
+int _get_lookup_for_color(int, int, int);
+int get_table_type(void);
+int Color(int);
+int RGB_color(unsigned char, unsigned char, unsigned char);
+int _get_color_index(int);
+int _get_color_index_array(int *, int);
+int Standard_color(int);
+int Color_offset(int);
+int get_color_offset(void);
+int Cont_abs(int, int);
+int Cont_rel(int, int);
+int Erase(void);
+int Font(char *);
+int Get_text_box(char *, int *, int *, int *, int *);
+int Linemod(char *);
+int Move_abs(int, int);
+int Get_current_xy(int *, int *);
+int Move_rel(int, int);
+int Number_of_colors(int *);
+int Polydots_abs(int *, int *, int);
+int Polydots_rel(int *, int *, int);
+int Polyline_abs(int *, int *, int);
+int Polyline_rel(int *, int *, int);
+int Polygon_rel(int *, int *, int);
+int Set_RGB_color(unsigned char, unsigned char, unsigned char);
+int RGB_raster(int, int, register unsigned char *, register unsigned char *,
+	       register unsigned char *, int);
+int Raster_char(int, int, unsigned char *, int, int);
+int Raster_int_def(int, int, int *, int, int);
+int Raster_int(int, int, int *, int, int);
+int Reset_colors(int, int, unsigned char *, unsigned char *, unsigned char *);
+int Reset_color(unsigned char, unsigned char, unsigned char, int);
+void close_mon(void);
+int Set_window(int, int, int, int);
+int window_clip(double *, double *, double *, double *);
+int window_box_clip(double *, double *, double *, double *);
+int Text(char *);
+int Text_size(int, int);
+int Text_rotation(float);
+int clip(register double, register double, register double, register double,
+	 register double *, register double *, register double *,
+	 register double *);
+int assign_fixed_color(int, int);
+int get_fixed_color(int);
+int get_fixed_color_array(register int *, register int);
+int assign_standard_color(int, int);
+int get_standard_color(int);
+int get_max_std_colors(void);
+int get_connection(char *, int *, int *);
+int prepare_connection(void);
+int check_connection(char *, char *;
+		     int init_font(char *);
+		     int get_char_vects(unsigned char, int *,
+					unsigned char **, unsigned char **);
+		     int drawchar(double, double, register double,
+				  register double, char);
+		     int soft_text_ext(int, int, double, double, double,
+				       char *);
+		     int get_text_ext(int *, int *, int *, int *);
+		     int soft_text(int, int, double, double, double, char *);
+		     int onechar(int, int, double, double, double,
+				 register char);

+ 59 - 0
include/defs/dig_atts.h

@@ -0,0 +1,59 @@
+#ifndef _STDIO_H
+#include <stdio.h>
+#endif
+
+/*
+   #define              WRITE_ATT_FORMAT        "%c  %12.2lf  %12.2lf  %8d"
+   #define              WRITE_ATT_FORMAT        "%c %14.2lf %14.2lf %7d"
+ */
+#define		WRITE_ATT_FORMAT	"%c %14s %14s %10d"
+#define FlSIZ 14
+#define		READ_ATT_FORMAT		"%c %lf %lf %d"
+
+/*  only types allowed in atts file 
+ *      A - area, L - line, P - point
+ */
+#define		ATT_TYPES		"LAP"
+
+/*      removed Jun 25 1991  dpg
+   #define LINE 0
+   #define AREA 1
+   #define DOT 2
+   #define DEAD_LINE 4
+   #define DEAD_AREA 5
+   #define DEAD_DOT 6
+ */
+
+struct attribute
+{
+    char type;
+    double x;
+    double y;
+    int cat;
+    long offset;
+};
+
+
+struct atts_index
+{
+    long *area_off;
+    long *line_off;
+    long *point_off;
+    int area_alloc;
+    int line_alloc;
+    int point_alloc;
+    int max_areas;
+    int max_lines;
+    int max_points;
+    int max_atts;
+};
+
+int atts_init(FILE *, struct atts_index *);
+int free_atts(struct atts_index *);
+int read_area_att(FILE *, struct atts_index *, struct attribute *, int);
+int read_line_att(FILE *, struct atts_index *, struct attribute *, int);
+int read_att_struct(FILE *, struct attribute *);
+int read_att(FILE *, char *, double *, double *, int *, long *);
+int write_att(FILE *, char, double, double, int);
+int write_att_struct(FILE *, struct attribute *);
+int write_att_line(FILE *, double *, double *, int, int);

+ 165 - 0
include/defs/display.h

@@ -0,0 +1,165 @@
+#ifndef GRASS_DISPLAYDEFS_H
+#define GRASS_DISPLAYDEFS_H
+
+/* cnversions.c */
+void D_update_conversions(void);
+void D_fit_d_to_u(void);
+void D_fit_u_to_d(void);
+void D_show_conversions(void);
+
+void D_do_conversions(const struct Cell_head *, double, double, double, double);
+
+int D_is_lat_lon(void);
+
+double D_get_d_to_a_xconv(void);
+double D_get_d_to_a_yconv(void);
+double D_get_d_to_u_xconv(void);
+double D_get_d_to_u_yconv(void);
+double D_get_a_to_u_xconv(void);
+double D_get_a_to_u_yconv(void);
+double D_get_a_to_d_xconv(void);
+double D_get_a_to_d_yconv(void);
+double D_get_u_to_d_xconv(void);
+double D_get_u_to_d_yconv(void);
+double D_get_u_to_a_xconv(void);
+double D_get_u_to_a_yconv(void);
+
+double D_get_ns_resolution(void);
+double D_get_ew_resolution(void);
+
+double D_get_u_west(void);
+double D_get_u_east(void);
+double D_get_u_north(void);
+double D_get_u_south(void);
+double D_get_a_west(void);
+double D_get_a_east(void);
+double D_get_a_north(void);
+double D_get_a_south(void);
+double D_get_d_west(void);
+double D_get_d_east(void);
+double D_get_d_north(void);
+double D_get_d_south(void);
+
+void D_set_region(const struct Cell_head *);
+void D_set_src(double, double, double, double);
+void D_get_src(double *, double *, double *, double *);
+void D_set_grid(int, int, int, int);
+void D_get_grid(int *, int *, int *, int *);
+void D_set_dst(double, double, double, double);
+void D_get_dst(double *, double *, double *, double *);
+
+void D_get_u(double [2][2]);
+void D_get_a(int [2][2]);
+void D_get_d(double [2][2]);
+
+double D_d_to_a_row(double);
+double D_d_to_a_col(double);
+double D_d_to_u_row(double);
+double D_d_to_u_col(double);
+double D_a_to_u_row(double);
+double D_a_to_u_col(double);
+double D_a_to_d_row(double);
+double D_a_to_d_col(double);
+double D_u_to_d_row(double);
+double D_u_to_d_col(double);
+double D_u_to_a_row(double);
+double D_u_to_a_col(double);
+
+/* draw2.c */
+
+void D_set_clip(double, double, double, double);
+void D_clip_to_map(void);
+void D_set_clip_mode(int);
+void D_set_reduction(double);
+
+void D_line_width(double);
+void D_get_text_box(const char *, double *, double *, double *, double *);
+
+void D_pos_abs(double, double);
+void D_pos_rel(double, double);
+void D_move_abs(double, double);
+void D_move_rel(double, double);
+void D_cont_abs(double, double);
+void D_cont_rel(double, double);
+void D_line_abs(double, double, double, double);
+void D_line_rel(double, double, double, double);
+void D_polydots_abs(const double *, const double *, int);
+void D_polydots_rel(const double *, const double *, int);
+void D_polyline_abs(const double *, const double *, int);
+void D_polyline_rel(const double *, const double *, int);
+void D_polygon_abs(const double *, const double *, int);
+void D_polygon_rel(const double *, const double *, int);
+void D_box_abs(double, double, double, double);
+void D_box_rel(double, double);
+
+void D_begin(void);
+void D_end(void);
+void D_close(void);
+void D_stroke(void);
+void D_fill(void);
+void D_dots(void);
+
+/* icon.c */
+void D_plot_icon(double, double, int, double, double);
+
+/* raster.c */
+int D_draw_raster(int, const void *, struct Colors *, RASTER_MAP_TYPE);
+int D_draw_d_raster(int, const DCELL *, struct Colors *);
+int D_draw_f_raster(int, const FCELL *, struct Colors *);
+int D_draw_c_raster(int, const CELL *, struct Colors *);
+int D_draw_cell(int, const CELL *, struct Colors *);
+void D_cell_draw_begin(void);
+int D_draw_raster_RGB(int, const void *, const void *, const void *,
+		      struct Colors *, struct Colors *, struct Colors *,
+		      RASTER_MAP_TYPE, RASTER_MAP_TYPE, RASTER_MAP_TYPE);
+void D_cell_draw_end(void);
+
+/* raster2.c */
+int D_set_overlay_mode(int);
+int D_color(CELL, struct Colors *);
+int D_c_color(CELL, struct Colors *);
+int D_d_color(DCELL, struct Colors *);
+int D_f_color(FCELL, struct Colors *);
+int D_color_of_type(const void *, struct Colors *, RASTER_MAP_TYPE);
+
+/* setup.c */
+void D_setup(int);
+void D_setup_unity(int);
+void D_setup2(int, int, double, double, double, double);
+
+/* symbol.c */
+void D_symbol(const SYMBOL *, double, double, const RGBA_Color *,
+	      const RGBA_Color *);
+void D_symbol2(const SYMBOL *, double, double, const RGBA_Color *,
+	       const RGBA_Color *);
+
+/* tran_colr.c */
+int D_translate_color(const char *);
+int D_parse_color(const char *, int);
+int D_use_color(int);
+int D_color_number_to_RGB(int, int *, int *, int *);
+void D_RGB_color(int, int, int);
+
+/* window.c */
+void D_erase(const char *);
+
+/* r_raster.c */
+
+int D_open_driver(void);
+void D_close_driver(void);
+int D_save_command(const char *);
+
+void D_get_window(double *, double *, double *, double *);
+
+void D__erase(void);
+
+void D_text_size(double, double);
+void D_text_rotation(double);
+void D_text(const char *);
+
+void D_font(const char *);
+void D_encoding(const char *);
+void D_font_list(char ***, int *);
+void D_font_info(char ***, int *);
+
+#endif /* GRASS_DISPLAYDEFS_H */

+ 25 - 0
include/defs/dlg.h

@@ -0,0 +1,25 @@
+#ifndef GRASS_DLGDEFS_H
+#define GRASS_DLGDEFS_H
+
+int dlg_init(FILE *, struct dlg *);
+int dlg_read(FILE *, struct dlg *);
+int _dlg_read_node(struct dlg_node *, FILE *);
+int _dlg_read_area(struct dlg_area *, FILE *);
+int _dlg_read_line(struct dlg_line *, FILE *);
+int _dlg_write_area(struct dlg_area *, FILE *);
+int dlg_write_header(FILE *, struct dlg *);
+int _dlg_write_line(struct dlg_line *, FILE *);
+int _dlg_write_node(struct dlg_node *, FILE *);
+int dlg_read_whole_area(FILE *, struct dlg *, int, double **, double **,
+			int *, int *);
+int dlg_read_area(FILE *, struct dlg *, int);
+int dlg_read_line(FILE *, struct dlg *, int);
+int dlg_read_node(FILE *, struct dlg *, int);
+int dlg_read_int(FILE *, int, int **);
+int dlg_write_int(FILE *, int, int *);
+int dlg_write_double(FILE *, int, double *);
+int dlg_write_area(FILE *, struct dlg *, int);
+int dlg_write_line(FILE *, struct dlg *, int);
+int dlg_write_node(FILE *, struct dlg *, int);
+
+#endif

+ 11 - 0
include/defs/form.h

@@ -0,0 +1,11 @@
+#ifndef GRASS_FORMDEFS_H
+#define GRASS_FORMDEFS_H
+
+int F_generate(char *driver, char *database, char *table, char *key,
+	       int keyval, char *frmname, char *frmmapset, int edit_mode,
+	       int format, char **form);
+int F_open(char *title, char *html);
+void F_clear(void);
+void F_close(void);
+
+#endif

include/gisdefs.h → include/defs/gis.h


+ 7 - 0
include/defs/glocale.h

@@ -0,0 +1,7 @@
+#ifndef GRASS_GLOCALEDEFS_H
+#define GRASS_GLOCALEDEFS_H
+
+extern void G_init_locale(void);
+extern char *G_gettext(const char *, const char *);
+
+#endif

+ 180 - 0
include/defs/gmath.h

@@ -0,0 +1,180 @@
+#ifndef GRASS_GMATHDEFS_H
+#define GRASS_GMATHDEFS_H
+
+/* dalloc.c */
+double *G_alloc_vector(size_t);
+double **G_alloc_matrix(int, int);
+float  *G_alloc_fvector(size_t);
+float  **G_alloc_fmatrix(int, int);
+void G_free_vector(double *);
+void G_free_matrix(double **);
+void G_free_fvector(float *);
+void G_free_fmatrix(float **);
+
+/* ialloc.c */
+int *G_alloc_ivector(size_t);
+int **G_alloc_imatrix(int, int);
+void G_free_ivector(int *);
+void G_free_imatrix(int **);
+
+/* fft.c */
+extern int fft(int, double *[2], int, int, int);
+extern int fft2(int, double (*)[2], int, int, int);
+
+/* gauss.c */
+extern double G_math_rand_gauss(int, double);
+
+/* max_pow2.c */
+extern long G_math_max_pow2 (long n);
+extern long G_math_min_pow2 (long n);
+
+/* rand1.c */
+extern float G_math_rand(int);
+
+/* del2g.c */
+extern int del2g(double *[2], int, double);
+
+/* getg.c */
+extern int getg(double, double *[2], int);
+
+/* eigen_tools.c */
+extern int G_math_egvorder(double *, double **, long);
+
+/* mult.c */
+extern int G_math_complex_mult (double *v1[2], int size1, double *v2[2], int size2, double *v3[2], int size3);
+
+/* lu.c*/
+extern int G_ludcmp(double **, int, int *, double *);
+extern void G_lubksb(double **a, int n, int *indx, double b[]);
+
+/* findzc.c */
+extern int G_math_findzc(double conv[], int size, double zc[], double thresh, int num_orients);
+
+
+/* *************************************************************** */
+/* ***** WRAPPER FOR CCMATH FUNCTIONS USED IN GRASS ************** */
+/* *************************************************************** */
+extern int G_math_solv(double **,double *,int);
+extern int G_math_solvps(double **,double *,int);
+extern void G_math_solvtd(double *,double *,double *,double *,int);
+extern int G_math_solvru(double **,double *,int);
+extern int G_math_minv(double **,int);
+extern int G_math_psinv(double **,int);
+extern int G_math_ruinv(double **,int);
+extern void G_math_eigval(double **,double *,int);
+extern void G_math_eigen(double **,double *,int);
+extern double G_math_evmax(double **,double *,int);
+extern int G_math_svdval(double *,double **,int,int);
+extern int G_math_sv2val(double *,double **,int,int);
+extern int G_math_svduv(double *,double **,double **, int,double **,int);
+extern int G_math_sv2uv(double *,double **,double **,int,double **,int);
+extern int G_math_svdu1v(double *,double **,int,double **,int);
+
+/* *************************************************************** */
+/* *************** LINEARE EQUATION SYSTEM PART ****************** */
+/* *************************************************************** */
+
+/* Sparse matrix and sparse vector functions
+ * */
+extern G_math_spvector *G_math_alloc_spvector(int );
+extern G_math_spvector **G_math_alloc_spmatrix(int );
+extern void G_math_free_spmatrix(G_math_spvector ** , int );
+extern void G_math_free_spvector(G_math_spvector * );
+extern int G_math_add_spvector(G_math_spvector **, G_math_spvector * , int );
+extern G_math_spvector **G_math_A_to_Asp(double **, int, double);
+extern double **G_math_Asp_to_A(G_math_spvector **, int);
+extern double **G_math_Asp_to_sband_matrix(G_math_spvector **, int, int);
+extern G_math_spvector **G_math_sband_matrix_to_Asp(double **, int, int, double);
+extern void G_math_print_spmatrix(G_math_spvector **, int);
+extern void G_math_Ax_sparse(G_math_spvector **, double *, double *, int );
+
+/*Symmetric band matrix handling */
+extern double **G_math_matrix_to_sband_matrix(double **, int, int);
+extern double **G_math_sband_matrix_to_matrix(double **, int, int);
+extern void G_math_Ax_sband(double ** A, double *x, double *y, int rows, int bandwidth);
+
+/*linear equation solver, most of them are multithreaded wih OpenMP*/
+extern int G_math_solver_gauss(double **, double *, double *, int );
+extern int G_math_solver_lu(double **, double *, double *, int );
+extern int G_math_solver_cholesky(double **, double *, double *, int , int );
+extern void G_math_solver_cholesky_sband(double **, double *, double *, int, int);
+extern int G_math_solver_jacobi(double **, double *, double *, int , int , double , double );
+extern int G_math_solver_gs(double **, double *, double *, int , int , double , double );
+
+extern int G_math_solver_pcg(double **, double *, double *, int , int , double , int );
+extern int G_math_solver_cg(double **, double *, double *, int , int , double );
+extern int G_math_solver_cg_sband(double **, double *, double *, int, int, int, double);
+extern int G_math_solver_bicgstab(double **, double *, double *, int , int , double );
+extern int G_math_solver_sparse_jacobi(G_math_spvector **, double *, double *, int , int , double , double );
+extern int G_math_solver_sparse_gs(G_math_spvector **, double *, double *, int , int , double , double );
+extern int G_math_solver_sparse_pcg(G_math_spvector **, double *, double *, int , int , double , int );
+extern int G_math_solver_sparse_cg(G_math_spvector **, double *, double *, int , int , double );
+extern int G_math_solver_sparse_bicgstab(G_math_spvector **, double *, double *, int , int , double );
+
+/* solver algoithms and helper functions*/
+extern void G_math_gauss_elimination(double **, double *, int );
+extern void G_math_lu_decomposition(double **, double *, int );
+extern int G_math_cholesky_decomposition(double **, int , int );
+extern void G_math_cholesky_sband_decomposition(double **, double **, int, int);
+extern void G_math_backward_substitution(double **, double *, double *, int );
+extern void G_math_forward_substitution(double **, double *, double *, int );
+extern void G_math_cholesky_sband_substitution(double **, double *, double *, int, int);
+
+/*BLAS like level 1,2 and 3 functions*/
+
+/*level 1 vector - vector grass implementation with OpenMP thread support*/
+extern void G_math_d_x_dot_y(double *, double *, double *, int );
+extern void G_math_d_asum_norm(double *, double *, int );
+extern void G_math_d_euclid_norm(double *, double *, int );
+extern void G_math_d_max_norm(double *, double *, int );
+extern void G_math_d_ax_by(double *, double *, double *, double , double , int );
+extern void G_math_d_copy(double *, double *, int );
+
+extern void G_math_f_x_dot_y(float *, float *, float *, int );
+extern void G_math_f_asum_norm(float *, float *, int );
+extern void G_math_f_euclid_norm(float *, float *, int );
+extern void G_math_f_max_norm(float *, float *, int );
+extern void G_math_f_ax_by(float *, float *, float *, float , float , int );
+extern void G_math_f_copy(float *, float *, int );
+
+extern void G_math_i_x_dot_y(int *, int *,  double *, int );
+extern void G_math_i_asum_norm(int *,  double *, int );
+extern void G_math_i_euclid_norm(int *,  double *,int );
+extern void G_math_i_max_norm(int *,  int *, int );
+extern void G_math_i_ax_by(int *, int *, int *, int , int , int );
+extern void G_math_i_copy(int *, int *, int );
+
+/*ATLAS blas level 1 wrapper*/
+extern double G_math_ddot(double *, double *, int );
+extern float G_math_sdot(float *, float *, int );
+extern float G_math_sdsdot(float *, float *, float , int );
+extern double G_math_dnrm2(double *, int );
+extern double G_math_dasum(double *, int );
+extern double G_math_idamax(double *, int );
+extern float  G_math_snrm2(float *, int );
+extern float  G_math_sasum(float *, int );
+extern float  G_math_isamax(float *, int );
+extern void G_math_dscal(double *, double , int );
+extern void G_math_sscal(float *, float , int );
+extern void G_math_dcopy(double *, double *, int );
+extern void G_math_scopy(float *, float *, int );
+extern void G_math_daxpy(double *, double *, double , int );
+extern void G_math_saxpy(float *, float *, float , int );
+
+/*level 2 matrix - vector grass implementation with OpenMP thread support*/
+extern void G_math_d_Ax(double **, double *, double *, int , int );
+extern void G_math_f_Ax(float **, float *, float *, int , int );
+extern void G_math_d_x_dyad_y(double *, double *, double **, int, int );
+extern void G_math_f_x_dyad_y(float *, float *, float **, int, int );
+extern void G_math_d_aAx_by(double **, double *, double *, double , double , double *, int , int );
+extern void G_math_f_aAx_by(float **, float *, float *, float , float , float *, int , int );
+extern int G_math_d_A_T(double **A, int rows);
+extern int G_math_f_A_T(float **A, int rows);
+
+/*level 3 matrix - matrix grass implementation with OpenMP thread support*/
+extern void G_math_d_aA_B(double **, double **, double , double **, int , int );
+extern void G_math_f_aA_B(float **, float **, float , float **, int , int );
+extern void G_math_d_AB(double **, double **, double **, int , int , int );
+extern void G_math_f_AB(float **,  float **,  float **,  int , int , int );
+
+#endif /* GRASS_GMATHDEFS_H */

+ 51 - 0
include/defs/gprojects.h

@@ -0,0 +1,51 @@
+#ifndef GRASS_GPROJECTSDEFS_H
+#define GRASS_GPROJECTSDEFS_H
+
+/* do_proj.c */
+int pj_do_proj(double *, double *, struct pj_info *, struct pj_info *);
+int pj_do_transform(int, double *, double *, double *,
+		    struct pj_info *, struct pj_info *);
+
+/* get_proj.c */
+int pj_get_kv(struct pj_info *, struct Key_Value *, struct Key_Value *);
+int pj_get_string(struct pj_info *, char *);
+int GPJ_get_equivalent_latlong(struct pj_info *, struct pj_info *);
+const char *set_proj_lib(const char *);
+int pj_print_proj_params(struct pj_info *, struct pj_info *);
+
+/* convert.c */
+#ifdef HAVE_OGR
+char *GPJ_grass_to_wkt(struct Key_Value *, struct Key_Value *, int, int);
+OGRSpatialReferenceH GPJ_grass_to_osr(struct Key_Value *, struct Key_Value *);
+int GPJ_wkt_to_grass(struct Cell_head *, struct Key_Value **,
+		     struct Key_Value **, const char *, int);
+int GPJ_osr_to_grass(struct Cell_head *, struct Key_Value **,
+		     struct Key_Value **, OGRSpatialReferenceH, int);
+const char *GPJ_set_csv_loc(const char *);
+#endif
+
+/* datum.c */
+int GPJ_get_datum_by_name(const char *, struct gpj_datum *);
+int GPJ_get_default_datum_params_by_name(const char *, char **);
+int GPJ_get_datum_params(char **, char **);
+int GPJ__get_datum_params(struct Key_Value *, char **, char **);
+void GPJ_free_datum(struct gpj_datum *);
+struct gpj_datum_transform_list *GPJ_get_datum_transform_by_name(const char *);
+void GPJ_free_datum_transform(struct gpj_datum_transform_list *);
+
+/* ellipse.c */
+int GPJ_get_ellipsoid_by_name(const char *, struct gpj_ellps *);
+int GPJ_get_ellipsoid_params(double *, double *, double *);
+int GPJ__get_ellipsoid_params(struct Key_Value *,
+			      double *, double *, double *);
+void GPJ_free_ellps(struct gpj_ellps *);
+
+
+/* PROJ.4's private datastructures copied from projects.h as removed
+   from upstream; pending better solution. see:
+   http://trac.osgeo.org/proj/ticket/98 */
+
+int pj_factors(LP, void *, double, struct FACTORS *);
+/* end of copy */
+
+#endif

+ 14 - 0
include/defs/ibtree.h

@@ -0,0 +1,14 @@
+#ifndef GRASS_IBTREEDEFS_H
+#define GRASS_IBTREEDEFS_H
+
+int ibtree_create(IBTREE *, int (*)(), int);
+int ibtree_find(IBTREE *, int, int *);
+int ibtree_free(IBTREE *);
+int ibtree_next(IBTREE *, int *, int *);
+int ibtree_rewind(IBTREE *);
+int Btree_init();
+int Btree_add(int);
+int Btree_report();
+int ibtree_update(IBTREE *, int, int);
+
+#endif

+ 14 - 0
include/defs/icon.h

@@ -0,0 +1,14 @@
+#ifndef GRASS_ICONDEFS_H
+#define GRASS_ICONDEFS_H
+
+char *ask_icon_any(char *, char *, int);
+char *ask_icon_new(char *, char *);
+char *ask_icon_old(char *, char *);
+int get_icon(char *, char *, ICON *);
+int get_default_icon(ICON *);
+int put_icon(char *, ICON *);
+int read_icon(FILE *, ICON *);
+int release_icon(ICON *);
+int scale_icon(ICON *, ICON *, float);
+int write_icon(FILE *, ICON *, int);
+#endif

include/imagedefs.h → include/defs/imagery.h


+ 51 - 0
include/defs/la.h

@@ -0,0 +1,51 @@
+#ifndef GRASS_LADEFSDEFS_H
+#define GRASS_LADEFSDEFS_H
+
+/* Matrix routines corresponding to BLAS Level III */
+
+mat_struct *G_matrix_init(int, int, int);
+int G_matrix_zero(mat_struct *);
+int G_matrix_set(mat_struct *, int, int, int);
+mat_struct *G_matrix_copy(const mat_struct *);
+mat_struct *G_matrix_add(mat_struct *, mat_struct *);
+mat_struct *G_matrix_subtract(mat_struct *, mat_struct *);
+mat_struct *G_matrix_scale(mat_struct *, const double);
+mat_struct *G__matrix_add(mat_struct *, mat_struct *, const double,
+			  const double);
+mat_struct *G_matrix_product(mat_struct *, mat_struct *);
+mat_struct *G_matrix_transpose(mat_struct *);
+int G_matrix_LU_solve(const mat_struct *, mat_struct **, const mat_struct *,
+		      mat_type);
+mat_struct *G_matrix_inverse(mat_struct *);
+void G_matrix_free(mat_struct *);
+void G_matrix_print(mat_struct *);
+int G_matrix_set_element(mat_struct *, int, int, double);
+double G_matrix_get_element(mat_struct *, int, int);
+
+
+/* Matrix-vector routines corresponding to BLAS Level II */
+
+vec_struct *G_matvect_get_column(mat_struct *, int);
+vec_struct *G_matvect_get_row(mat_struct *, int);
+int G_matvect_extract_vector(mat_struct *, vtype, int);
+int G_matvect_retrieve_matrix(vec_struct *);
+
+
+/* Vector routines corresponding to BLAS Level I */
+
+vec_struct *G_vector_init(int, int, vtype);
+int G_vector_set(vec_struct *, int, int, vtype, int);
+double G_vector_norm_euclid(vec_struct *);
+double G_vector_norm_maxval(vec_struct *, int);
+vec_struct *G_vector_copy(const vec_struct *, int);
+
+/* Matrix and vector routines corresponding to ?? */
+
+void G_vector_free(vec_struct *);
+vec_struct *G_vector_sub(vec_struct *, vec_struct *, vec_struct *);
+double G_vector_norm1(vec_struct *);
+int G_matrix_read(FILE *, mat_struct *);
+int G_matrix_stdin(mat_struct *);
+int G_matrix_eigen_sort(vec_struct *, mat_struct *);
+
+#endif /* GRASS_LADEFS_H */

+ 22 - 0
include/defs/libtrans.h

@@ -0,0 +1,22 @@
+#ifndef GRASS_LIBTRANSDEFS_H
+#define GRASS_LIBTRANSDEFS_H
+
+/* inverse.c */
+int inverse(double[DIM_matrix][DIM_matrix]);
+int isnull(double[DIM_matrix][DIM_matrix]);
+
+/* m_mult.c */
+int m_mult(double[DIM_matrix][DIM_matrix], double *, double *);
+
+/* transform.c */
+int compute_transformation_coef(double *, double *, double *, double *, int *,
+				int);
+int transform_a_into_b(double, double, double *, double *);
+int transform_b_into_a(double, double, double *, double *);
+int residuals_a_predicts_b(double *, double *, double *, double *, int *, int,
+			   double *, double *);
+int residuals_b_predicts_a(double *, double *, double *, double *, int *, int,
+			   double *, double *);
+int print_transform_matrix(void);
+
+#endif /* GRASS_LIBTRANSDEFS_H */

+ 26 - 0
include/defs/linkm.h

@@ -0,0 +1,26 @@
+#ifndef GRASS_LINKMDEFS_H
+#define GRASS_LINKMDEFS_H
+
+/* destroy.c */
+void link_destroy(struct link_head *, VOID_T *);
+
+/* dispose.c */
+void link_dispose(struct link_head *, VOID_T *);
+
+/* init.c */
+void link_set_chunk_size(int);
+void link_exit_on_error(int);
+struct link_head *link_init(int);
+void link_cleanup(struct link_head *);
+
+/* new.c */
+struct link_head *link_new(struct link_head *);
+
+/* next.c */
+VOID_T *link__get_next(VOID_T *);
+void link__set_next(VOID_T *, VOID_T *);
+
+/* oom.c */
+int link_out_of_memory(void);
+
+#endif

+ 46 - 0
include/defs/manage.h

@@ -0,0 +1,46 @@
+#ifndef GRASS_MANAGEDEFS_H
+#define GRASS_MANAGEDEFS_H
+
+/* add_elem.c */
+void M__add_element(const char *, const char *);
+
+/* do_copy.c */
+int M_do_copy(int, const char *, const char *, const char *);
+
+/* do_list.c */
+void M_do_list(int, const char *);
+
+/* do_remove.c */
+int M_do_remove(int, const char *);
+
+/* do_rename.c */
+int M_do_rename(int, const char *, const char *);
+
+/* empty.c */
+int M__empty(char *);
+
+/* find.c */
+const char *M_find(int, char *, const char *);
+
+/* get_len.c */
+int M__get_description_len(int);
+
+/* list.c */
+int M_get_element(const char *);
+const struct list *M_get_list(int);
+
+/* read_list.c */
+int M_read_list(int, int *);
+
+/* option.c */
+struct Option* M_define_option(int, const char *, int);
+const char *M_get_options(int);
+const char *M_get_option_desc(int);
+
+/* show_elem.c */
+void M_show_elements(void);
+
+/* sighold.c */
+int M__hold_signals(int);
+
+#endif

+ 90 - 0
include/defs/neta.h

@@ -0,0 +1,90 @@
+#ifndef GRASS_NETADEFS_H
+#define GRASS_NETADEFS_H
+
+/*bridge.c */
+int NetA_compute_bridges(dglGraph_s * graph, struct ilist *bridge_list);
+int NetA_articulation_points(dglGraph_s * graph,
+			     struct ilist *articulation_list);
+
+/*components.c */
+int NetA_weakly_connected_components(dglGraph_s * graph, int *component);
+int NetA_strongly_connected_components(dglGraph_s * graph, int *component);
+
+/*spanningtree.c */
+int NetA_spanning_tree(dglGraph_s * graph, struct ilist *tree_list);
+
+/*allpairs.c */
+int NetA_allpairs(dglGraph_s * graph, dglInt32_t ** dist);
+
+/*neta_flow.c */
+int NetA_flow(dglGraph_s * graph, struct ilist *source_list,
+	      struct ilist *sink_list, int *flow);
+int NetA_min_cut(dglGraph_s * graph, struct ilist *source_list,
+		 struct ilist *sink_list, int *flow, struct ilist *cut);
+int NetA_split_vertices(dglGraph_s * in, dglGraph_s * out, int *node_costs);
+
+/*utils.c */
+void NetA_add_point_on_node(struct Map_info *In, struct Map_info *Out, int node,
+			    struct line_cats *Cats);
+void NetA_points_to_nodes(struct Map_info *In, struct ilist *point_list);
+int NetA_get_node_costs(struct Map_info *In, int layer, char *column,
+			int *node_costs);
+void NetA_varray_to_nodes(struct Map_info *map, struct varray * varray,
+			  struct ilist *nodes, int *nodes_to_features);
+int NetA_initialise_varray(struct Map_info *In, int layer, int mask_type,
+			   char *where, char *cat, struct varray ** varray);
+/*centrality.c */
+void NetA_degree_centrality(dglGraph_s * graph, double *degree);
+int NetA_eigenvector_centrality(dglGraph_s * graph, int iterations,
+				double error, double *eigenvector);
+int NetA_betweenness_closeness(dglGraph_s * graph, double *betweenness,
+			       double *closeness);
+
+/*path.c */
+int NetA_distance_from_points(dglGraph_s * graph, struct ilist *from, int *dst,
+			      dglInt32_t ** prev);
+int NetA_find_path(dglGraph_s * graph, int from, int to, int *edges,
+		   struct ilist *list);
+
+/*timetables.c */
+
+/*Structure containing all information about a timetable.
+ * Everything in indexed from 0.
+ */
+typedef struct
+{
+    int routes;			/*Number of different routes. Two routes are different even if they differ only in time. */
+    int *route_length;		/*Length of each route, i.e., number of stops */
+    int **route_stops;		/*list of stops on each route in order (time increases) */
+    int **route_times;		/*stop arrival times on overy route. Stops are given in the same order as above */
+    int stops;			/*number of stops */
+    int *stop_length;		/*Number of routes stopping at each stop */
+    int **stop_routes;		/*List of routes for each stop. Routes are in increasing order */
+    int **stop_times;		/*arrival times of routes for each stop. Routes are given in the same order as above */
+    int *walk_length;		/*number of stops with "walking connection" for each stop */
+    int **walk_stops;		/*list of stops within walking distance for each stop */
+    int **walk_times;		/*walking times between stops as given above */
+} neta_timetable;
+
+typedef struct
+{
+    int **dst;
+    int **prev_stop;
+    int **prev_route;
+    int **prev_conn;
+    int rows, routes;
+} neta_timetable_result;
+int NetA_init_timetable_from_db(struct Map_info *In, int route_layer,
+				int walk_layer, char *route_id, char *times,
+				char *to_stop, char *walk_length,
+				neta_timetable * timetable, int **route_ids,
+				int **stop_ids);
+int NetA_timetable_shortest_path(neta_timetable * timetable, int from_stop,
+				 int to_stop, int start_time, int min_change,
+				 int max_changes, int walking_change,
+				 neta_timetable_result * result);
+int NetA_timetable_get_route_time(neta_timetable * timetable, int stop,
+				  int route);
+void NetA_timetable_result_release(neta_timetable_result * result);
+
+#endif

+ 105 - 0
include/defs/nviz.h

@@ -0,0 +1,105 @@
+#ifndef GRASS_NVIZDEFS_H
+#define GRASS_NVIZDEFS_H
+
+/* change_view.c */
+int Nviz_resize_window(int, int);
+int Nviz_update_ranges(nv_data *);
+int Nviz_set_viewpoint_position(double, double);
+int Nviz_set_viewpoint_height(double);
+int Nviz_set_viewpoint_persp(int);
+int Nviz_set_viewpoint_twist(int);
+int Nviz_change_exag(nv_data *, double);
+int Nviz_look_here(double, double);
+void Nviz_get_modelview(double *);
+void Nviz_set_rotation(double, double, double, double);
+void Nviz_unset_rotation(void);
+void Nviz_init_rotation(void);
+void Nviz_flythrough(nv_data *, float *, int *, int);
+
+/* cplanes_obj.c */
+int Nviz_new_cplane(nv_data *, int);
+int Nviz_on_cplane(nv_data *, int);
+int Nviz_off_cplane(nv_data *, int);
+int Nviz_draw_cplane(nv_data *, int, int);
+int Nviz_num_cplanes(nv_data *);
+int Nviz_get_current_cplane(nv_data *);
+int Nviz_set_cplane_rotation(nv_data *, int, float, float, float);
+int Nviz_get_cplane_rotation(nv_data *, int, float *, float *, float *);
+int Nviz_set_cplane_translation(nv_data *, int, float, float, float);
+int Nviz_get_cplane_translation(nv_data *, int, float *, float *, float *);
+int Nviz_set_fence_color(nv_data *, int);
+int Nviz_set_cplane_here(nv_data *, int, float, float);
+
+
+/* draw.c */
+int Nviz_draw_all_surf(nv_data *);
+int Nviz_draw_all_vect();
+int Nviz_draw_all_site();
+int Nviz_draw_all_vol();
+int Nviz_draw_all(nv_data *);
+int Nviz_draw_quick(nv_data *, int);
+int Nviz_load_image(GLubyte *, int, int, int);
+void Nviz_draw_image(int, int, int, int, int);
+void Nviz_set_2D(int, int);
+void Nviz_del_texture(int);
+void Nviz_get_max_texture(int *);
+
+/* exag.c */
+int Nviz_get_exag_height(double *, double *, double *);
+double Nviz_get_exag();
+
+/* lights.c */
+int Nviz_set_light_position(nv_data *, int, double, double, double, double);
+int Nviz_set_light_bright(nv_data *, int, double);
+int Nviz_set_light_color(nv_data *, int, int, int, int);
+int Nviz_set_light_ambient(nv_data *, int, double);
+int Nviz_init_light(nv_data *, int);
+int Nviz_new_light(nv_data *);
+void Nviz_draw_model(nv_data *);
+
+/* map_obj.c */
+int Nviz_new_map_obj(int, const char *, double, nv_data *);
+int Nviz_set_attr(int, int, int, int, const char *, double, nv_data *);
+void Nviz_set_surface_attr_default();
+int Nviz_set_vpoint_attr_default();
+int Nviz_set_volume_attr_default();
+int Nviz_unset_attr(int, int, int);
+
+/* nviz.c */
+void Nviz_init_data(nv_data *);
+void Nviz_destroy_data(nv_data *);
+void Nviz_set_bgcolor(nv_data *, int);
+int Nviz_get_bgcolor(nv_data *);
+int Nviz_color_from_str(const char *);
+struct fringe_data *Nviz_new_fringe(nv_data *, int, unsigned long,
+				    double, int, int, int, int);
+struct fringe_data *Nviz_set_fringe(nv_data *, int, unsigned long,
+				    double, int, int, int, int);
+void Nviz_draw_fringe(nv_data *data);
+int Nviz_draw_arrow(nv_data *);
+int Nviz_set_arrow(nv_data *, int, int, float, unsigned int);
+void Nviz_delete_arrow(nv_data *);
+struct scalebar_data * Nviz_new_scalebar(nv_data *, int, float *, float, unsigned int);
+struct scalebar_data * Nviz_set_scalebar(nv_data *, int , int, int, float, unsigned int);
+void Nviz_draw_scalebar(nv_data *);
+void Nviz_delete_scalebar(nv_data *, int);
+
+/* position.c */
+void Nviz_init_view(nv_data *);
+int Nviz_set_focus_state(int);
+int Nviz_set_focus_map(int, int);
+int Nviz_has_focus(nv_data *);
+int Nviz_set_focus(nv_data *, float, float, float);
+int Nviz_get_focus(nv_data *, float *, float *, float *);
+float Nviz_get_xyrange(nv_data *);
+int Nviz_get_zrange(nv_data *, float *, float *);
+float Nviz_get_longdim(nv_data *);
+
+/* render.c */
+struct render_window *Nviz_new_render_window();
+void Nviz_init_render_window(struct render_window *);
+void Nviz_destroy_render_window(struct render_window *);
+int Nviz_create_render_window(struct render_window *, void *, int, int);
+int Nviz_make_current_render_window(const struct render_window *);
+
+#endif /* GRASS_NVIZDEFS_H */

+ 3 - 35
include/ogsf_proto.h

@@ -1,37 +1,5 @@
-/*
- ****************************************************************************
- *
- * MODULE:       GRASS ogsf library
- * AUTHOR(S):    Justin Hickey - Bangkok Thailand - jhickey@hpcc.nectec.or.th
- * PURPOSE:      To list the prototypes for all accessible functions in this
- *               library. The prototypes are listed by the file in which their
- *               function definitions reside.
- * COPYRIGHT:    (C) 2000-2008 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- *****************************************************************************/
-
-#ifndef _OGSF_LOCAL_PROTO_H
-#define _OGSF_LOCAL_PROTO_H
-
-/*========================= Required Include Files =========================*/
-
-#include <grass/gis.h>
-#include <grass/gstypes.h>
-#include <grass/kftypes.h>
-
-/*===================== User Visible Constants/Defines =====================*/
-
-/* none */
-
-/*====================== Internal Types and Structures =====================*/
-
-/* none */
-
-/*========================== Function Prototypes ===========================*/
+#ifndef GRASS_OGSFDEFS_H
+#define GRASS_OGSFDEFS_H
 
 /* GK2.c */
 int GK_set_interpmode(int);
@@ -770,4 +738,4 @@ void gsd_bgn_legend_viewport(GLint, GLint, GLint, GLint);
 void gsd_end_legend_viewport(void);
 int gsd_make_nice_number(float *);
 
-#endif /* _OGSF_LOCAL_PROTO_H */
+#endif /* GRASS_OGSFDEFS_H */

+ 74 - 0
include/defs/ortholib.h

@@ -0,0 +1,74 @@
+#ifndef GRASS_ORTHODEFS_H
+#define GRASS_ORTHODEFS_H
+
+/* from imagery/libes */
+/* ask_camera.c */
+int I_ask_camera_old(char *, char *);
+int I_ask_camera_new(char *, char *);
+int I_ask_camera_any(char *, char *);
+
+/* ask_initial.c */
+int I_ask_camera_old(char *, char *);
+int I_ask_camera_new(char *, char *);
+int I_ask_camera_any(char *, char *);
+
+/* cam.c */
+FILE *I_fopen_group_camera_new(char *);
+FILE *I_fopen_group_camera_old(char *);
+
+/* camera.c */
+int I_put_group_camera(char *, char *);
+int I_get_group_camera(char *, char *);
+
+/* elev.c */
+int I_put_group_elev(char *, char *, char *, char *, char *, char *, char *);
+int I_get_group_elev(char *, char *, char *, char *, char *, char *, char *);
+
+/* find_camera.c */
+int I_find_camera(char *);
+int I_find_camera_file(char *, char *);
+
+/* find_init.c */
+int I_find_initial(char *);
+
+/* fopen_camera.c */
+FILE *I_fopen_cam_file_new(char *);
+FILE *I_fopen_cam_file_append(char *);
+FILE *I_fopen_cam_file_old(char *);
+int I_georef(double, double, double *, double *, double[3], double[3]);
+
+/* group_elev.c */
+FILE *I_fopen_group_elev_new(char *);
+FILE *I_fopen_group_elev_old(char *);
+int I_find_group_elev_file(char *);
+
+/* init.c */
+FILE *I_fopen_group_init_new(char *);
+FILE *I_fopen_group_init_old(char *);
+
+/* initial.c */
+int I_get_camera(char *);
+int I_put_camera(char *);
+int I_put_group_camera(char *, char *);
+int I_get_group_camera(char *, char *);
+
+/* ls_cameras.c */
+int I_list_cameras(int);
+
+/* ls_elev.c */
+int I_list_elev(int);
+
+/* open_camera.c */
+int I_open_cam_file_new(char *, char *);
+int I_open_cam_file_old(char *, char *);
+
+/* title_camera.c */
+int I_get_cam_title(char *, char *, int);
+int I_put_camera_title(char *, char *);
+
+/* vask_block.c */
+int I_vask_block_new(char **, char *, char *);
+int I_vask_block_old(char **, char *, char *);
+int I_vask_subblock_new(char **, char *, char *, int, char *);
+
+#endif

include/rasterdefs.h → include/defs/raster.h


include/raster3ddefs.h → include/defs/raster3d.h


+ 19 - 0
include/defs/rbtree.h

@@ -0,0 +1,19 @@
+#ifndef GRASS_RBTREEDEFS_H
+#define GRASS_RBTREEDEFS_H
+
+/* tree functions */
+struct RB_TREE *rbtree_create(rb_compare_fn *, size_t);
+void rbtree_destroy(struct RB_TREE *);
+int rbtree_insert(struct RB_TREE *, void *);
+int rbtree_remove(struct RB_TREE *, const void *);
+void *rbtree_find(struct RB_TREE *, const void *);
+
+/* tree traversal functions */
+int rbtree_init_trav(struct RB_TRAV *, struct RB_TREE *);
+void* rbtree_traverse(struct RB_TRAV *);
+void *rbtree_traverse_start(struct RB_TRAV *, const void *);
+
+/* debug tree from given node downwards */
+int rbtree_debug(struct RB_TREE *, struct RB_NODE *);
+
+#endif

+ 13 - 0
include/defs/rowio.h

@@ -0,0 +1,13 @@
+#ifndef GRASS_ROWIODEFS_H
+#define GRASS_ROWIODEFS_H
+
+int Rowio_fileno(const ROWIO *);
+void Rowio_forget(ROWIO *, int);
+void *Rowio_get(ROWIO *, int);
+void Rowio_flush(ROWIO *);
+int Rowio_put(ROWIO *, const void *, int);
+void Rowio_release(ROWIO *);
+int Rowio_setup(ROWIO *, int, int, int, int (*)(int, void *, int, int),
+		int (*)(int, const void *, int, int));
+
+#endif

+ 19 - 0
include/defs/segment.h

@@ -0,0 +1,19 @@
+#ifndef GRASS_SEGMENTDEFS_H
+#define GRASS_SEGMENTDEFS_H
+
+int segment_address(const SEGMENT *, int, int, int *, int *);
+int segment_flush(SEGMENT *);
+int segment_format(int, int, int, int, int, int);
+int segment_format_nofill(int, int, int, int, int, int);
+int segment_get(SEGMENT *, void *, int, int);
+int segment_get_row(const SEGMENT *, void *, int);
+int segment_init(SEGMENT *, int, int);
+int segment_pagein(SEGMENT *, int);
+int segment_pageout(SEGMENT *, int);
+int segment_put(SEGMENT *, const void *, int, int);
+int segment_put_row(const SEGMENT *, const void *, int);
+int segment_release(SEGMENT *);
+int segment_seek(const SEGMENT *, int, int);
+int segment_setup(SEGMENT *);
+
+#endif /* GRASS_SEGMENTDEFS_H */

+ 26 - 3
include/P_site.h

@@ -1,8 +1,31 @@
+#ifndef GRASS_SITEDEFS_H
+#define GRASS_SITEDEFS_H
 
-#ifndef GRASS_P_SITE_H
-#define GRASS_P_SITE_H
+/* Allocate 'num' SITE_XYZ structs. Returns NULL on failure */
+SITE_XYZ *G_alloc_site_xyz(size_t);
 
-struct Map_info;
+/* Free the array of SITE_XYZ struct */
+void G_free_site_xyz(SITE_XYZ *);
+
+/* G_readsites_xyz: Reads a sites file converting to a site struct of xyz
+ * values and the cat value.  The Z value can come from one of the
+ * n-dimensions, a double attribute, or a string attribute converted to a
+ * double with strtod().  The 'size' must not be greater than the number
+ * of elements in the SITE_XYZ array, or bad things will happen. The number 
+ * of records read is returned or EOF on end of file. NOTE: EOF won't be
+ * returned unless no records are read and the EOF bit is set. It's safe
+ * to assume that if the number of records read is less than the size of
+ * the array, that there aren't any more records.
+ */
+int G_readsites_xyz(FILE *,	/* The FILE stream to the sites file               */
+		    int,	/* Attribute type: SITE_COL_DIM, etc...            */
+		    int,	/* The field index (1 based) for the attribute     */
+		    int,	/* Size of the array                               */
+		    struct Cell_head *,	/* Respect region if not NULL */
+		    SITE_XYZ * xyz	/* The site array of size 'size'                   */
+    );
+
+int G_readsites(FILE *, int, int, int, struct Cell_head *, Z **);
 
 /* The same for old and new, format independent */
 Site *G_site_new_struct(RASTER_MAP_TYPE cattype, int ndim, int ns, int nd);

+ 133 - 0
include/defs/sitelib.h

@@ -0,0 +1,133 @@
+#ifndef GRASS_SITELIBDEFS_H
+#define GRASS_SITELIBDEFS_H
+
+/* announce.c */
+int announce(char *);
+
+/* ask_quad.c */
+int ask_quad(int *);
+
+/* center.c */
+int center(char *, int);
+
+/* chain.c */
+int chain(char *);
+
+/* copy_sites.c */
+int copy_sites(SITE_LIST *, SITE_LIST *, int);
+
+/* copyfile.c */
+int copyfile(char *, char *);
+
+/* count_site.c */
+int count_sites(SITE_LIST *, int);
+
+/* counter.c */
+int counter_reset(char *, int);
+int counter(int);
+
+/* die.c */
+int die(char *);
+
+/* eq_sites.c */
+int equal_sites(SITE_LIST *, SITE_LIST *);
+
+/* execute.c */
+int execute(char *);
+
+/* hitreturn.c */
+int hitreturn(void);
+
+/* maximum.c */
+int maximum(register int *, int);
+
+/* memcopy.c */
+int memcopy(char *, char *, int);
+
+#ifdef MENU
+/* menu_hndlr.c */
+int menu_handler(MENU, char *);
+#endif
+
+/* meta_reprt.c */
+int meta_report(char *, char *, char *, int, int);
+
+/* parse.c */
+int parse(char *, char *[], int, char *);
+
+/* read_sites.c */
+int read_site_list(SITE_LIST *, FILE *);
+int get_site_list(SITE_LIST *, char *);
+
+/* region.c */
+char *format_res(double, char *, int);
+char *format_east(double, char *, int);
+char *format_north(double, char *, int);
+int scan_north(char *, double *);
+int scan_east(char *, double *);
+int scan_res(char *, double *);
+
+#ifdef REPORT
+/* report.c */
+REPORT *report_open(char *);
+REPORT *report_open_ref(char *, REPORT *);
+int report_close(REPORT *);
+int report_read(REPORT *);
+int report_record(REPORT *, char *);
+int report_read_record(REPORT *, char *);
+int report_scan(REPORT *);
+int report_matrix(REPORT *);
+
+/* rprt_finds.c */
+rprt_finds.c:int report_find_layer(REPORT *, int);
+rprt_finds.c:int report_find_cat(REPORT *, int, int);
+rprt_finds.c:int report_find_point(REPORT *, int);
+rprt_finds.c:int report_find_data(REPORT *, int, int);
+
+/* rprt_seeks.c */
+rprt_seeks.c:int report_seek_layers(REPORT *);
+rprt_seeks.c:int report_seek_points(REPORT *);
+rprt_seeks.c:int report_seek_cats(REPORT *);
+rprt_seeks.c:int report_seek_data(REPORT *);
+#endif
+
+/* rpt_screen.c */
+int new_report_screen(void);
+
+/* scan_int.c */
+int scan_int(char *, int *);
+
+/* scn_double.c */
+int scan_double(char *, double *);
+
+/* scopy.c */
+int scopy(char *, char *, int);
+
+/* site.c */
+int add_site(SITE_LIST *, double, double, char *);
+int initialize_site_list(SITE_LIST *);
+int rewind_site_list(SITE_LIST *);
+int next_site(SITE_LIST *, double *, double *, char **);
+int free_site_list(SITE_LIST *);
+
+/* sort_int.c */
+int sort_int(int[], int, int);
+
+/* trace.c */
+int trace(int);
+
+/* ut_to_cell.c */
+float northing_to_row(double, struct Cell_head *);
+float easting_to_col(double, struct Cell_head *);
+
+/* within_wnd.c */
+int within_window(double, double, struct Cell_head *);
+
+/* write_site.c */
+int put_site_list(SITE_LIST *, char *, int, int);
+int write_site_list(SITE_LIST *, FILE *, int, int);
+
+/* yes.c */
+int yes(char *);
+
+#endif

+ 9 - 0
include/defs/spawn.h

@@ -0,0 +1,9 @@
+#ifndef GRASS_SPAWNDEFS_H
+#define GRASS_SPAWNDEFS_H
+
+extern int G_spawn(const char *command, ...);
+extern int G_vspawn_ex(const char *command, const char **args);
+extern int G_spawn_ex(const char *command, ...);
+extern int G_wait(int i_pid);
+
+#endif

+ 41 - 0
include/defs/sqlp.h

@@ -0,0 +1,41 @@
+#ifndef GRASS_SQLPDEFS_H
+#define GRASS_SQLPDEFS_H
+
+int my_yyinput(char *buf, int max_size);
+void yyerror(char *s);
+int yyparse();
+int yywrap();
+
+int sqpSaveStr(SQLPVALUE * st, char *c);
+void sqpInitValue(SQLPVALUE * val);
+void sqpCopyValue(SQLPVALUE * from, SQLPVALUE * to);
+
+SQLPSTMT *sqpInitStmt(void);
+int sqpFreeStmt(SQLPSTMT * st);
+int sqpPrintStmt(SQLPSTMT * st);
+int sqpAllocCol(SQLPSTMT * st, int n);
+int sqpAllocVal(SQLPSTMT * st, int n);
+int sqpAllocCom(SQLPSTMT * st, int n);
+int sqpInitParser(SQLPSTMT * st);
+
+
+void sqpCommand(int command);
+void sqpTable(char *table);
+void sqpColumn(char *column);
+void sqpColumnDef(char *column, int type, int width, int decimals);
+void sqpValue(char *strval, int intval, double dblval, int type);
+void sqpAssignment(char *column, char *strval, int intval, double dblval,
+		   SQLPNODE * expr, int type);
+void sqpOrderColumn(char *col, int dir);
+int sqpOperatorCode(char *);
+char *sqpOperatorName(int);
+
+SQLPNODE *sqpNewNode(void);
+
+SQLPNODE *sqpNewExpressionNode(int oper, SQLPNODE * left, SQLPNODE * right);
+SQLPNODE *sqpNewColumnNode(char *name);
+SQLPNODE *sqpNewValueNode(char *strval, int intval, double dblval, int type);
+
+void sqpFreeNode(SQLPNODE *);
+
+#endif

+ 54 - 0
include/defs/stats.h

@@ -0,0 +1,54 @@
+#ifndef GRASS_STATSDEFS_H
+#define GRASS_STATSDEFS_H
+
+typedef void stat_func(DCELL *, DCELL *, int, const void *);
+typedef void stat_func_w(DCELL *, DCELL(*)[2], int, const void *);
+
+extern stat_func c_ave;
+extern stat_func c_count;
+extern stat_func c_divr;
+extern stat_func c_intr;
+extern stat_func c_max;
+extern stat_func c_maxx;
+extern stat_func c_median;
+extern stat_func c_min;
+extern stat_func c_minx;
+extern stat_func c_mode;
+extern stat_func c_stddev;
+extern stat_func c_sum;
+extern stat_func c_thresh;
+extern stat_func c_var;
+extern stat_func c_range;
+extern stat_func c_reg_m;
+extern stat_func c_reg_c;
+extern stat_func c_reg_r2;
+extern stat_func c_quart1;
+extern stat_func c_quart3;
+extern stat_func c_perc90;
+extern stat_func c_quant;
+extern stat_func c_skew;
+extern stat_func c_kurt;
+
+extern stat_func_w w_ave;
+extern stat_func_w w_count;
+extern stat_func_w w_median;
+extern stat_func_w w_min;
+extern stat_func_w w_max;
+extern stat_func_w w_mode;
+extern stat_func_w w_quart1;
+extern stat_func_w w_quart3;
+extern stat_func_w w_perc90;
+extern stat_func_w w_quant;
+extern stat_func_w w_reg_m;
+extern stat_func_w w_reg_c;
+extern stat_func_w w_reg_r2;
+extern stat_func_w w_stddev;
+extern stat_func_w w_sum;
+extern stat_func_w w_var;
+extern stat_func_w w_skew;
+extern stat_func_w w_kurt;
+
+extern int sort_cell(DCELL *, int);
+extern int sort_cell_w(DCELL(*)[2], int);
+
+#endif

+ 7 - 0
include/defs/symbol.h

@@ -0,0 +1,7 @@
+#ifndef GRASS_SYMBOLDEFS_H
+#define GRASS_SYMBOLDEFS_H
+
+SYMBOL *S_read(const char *sname);
+void S_stroke(SYMBOL * symb, double size, double rotation, int tolerance);
+
+#endif

+ 21 - 0
include/defs/transform.h

@@ -0,0 +1,21 @@
+#ifndef GRASS_TRANSFORMDEFS_H
+#define GRASS_TRANSFORMDEFS_H
+
+/* inverse.c */
+int inverse(double[DIM_matrix][DIM_matrix]);
+int isnull(double[DIM_matrix][DIM_matrix]);
+
+/* m_mult.c */
+int m_mult(double[DIM_matrix][DIM_matrix], double *, double *);
+
+/* transform.c */
+int compute_transformation_coef(double *, double *, double *, double *, int *,
+				int);
+int transform_a_into_b(double, double, double *, double *);
+int transform_b_into_a(double, double, double *, double *);
+int residuals_a_predicts_b(double *, double *, double *, double *, int *, int,
+			   double *, double *);
+int residuals_b_predicts_a(double *, double *, double *, double *, int *, int,
+			   double *, double *);
+
+#endif

+ 67 - 0
include/defs/vedit.h

@@ -0,0 +1,67 @@
+#ifndef GRASS_VEDITDEFS_H
+#define GRASS_VEDITDEFS_H
+
+/* break.c */
+int Vedit_split_lines(struct Map_info *, struct ilist *,
+		      struct line_pnts *, double, struct ilist *);
+int Vedit_connect_lines(struct Map_info *, struct ilist *, double);
+
+/* cats.c */
+int Vedit_modify_cats(struct Map_info *, struct ilist *,
+		      int, int, struct cat_list *);
+
+/* copy.c */
+int Vedit_copy_lines(struct Map_info *, struct Map_info *, struct ilist *);
+
+/* chtype.c */
+int Vedit_chtype_lines(struct Map_info *, struct ilist *);
+
+/* delete.c */
+
+int Vedit_delete_lines(struct Map_info *, struct ilist *);
+
+/* distance.c */
+double Vedit_get_min_distance(struct line_pnts *, struct line_pnts *,
+			      int, int *);
+
+/* flip.c */
+int Vedit_flip_lines(struct Map_info *, struct ilist *);
+
+/* merge.c */
+int Vedit_merge_lines(struct Map_info *, struct ilist *);
+
+/* move.c */
+int Vedit_move_lines(struct Map_info *, struct Map_info **, int,
+		     struct ilist *, double, double, double, int, double);
+
+/* render.c */
+struct robject_list *Vedit_render_map(struct Map_info *, struct bound_box *, int,
+				      double, double, int, int, double);
+
+/* select.c */
+int Vedit_select_by_query(struct Map_info *,
+			  int, int, double, int, struct ilist *);
+
+/* snap.c */
+int Vedit_snap_point(struct Map_info *,
+		     int, double *, double *, double *, double, int);
+int Vedit_snap_line(struct Map_info *, struct Map_info **, int,
+		    int, struct line_pnts *, double, int);
+int Vedit_snap_lines(struct Map_info *, struct Map_info **, int,
+		     struct ilist *, double, int);
+
+/* vertex.c */
+int Vedit_move_vertex(struct Map_info *, struct Map_info **, int,
+		      struct ilist *,
+		      struct line_pnts *, double, double,
+		      double, double, double, int, int);
+int Vedit_add_vertex(struct Map_info *Map, struct ilist *,
+		     struct line_pnts *, double);
+int Vedit_remove_vertex(struct Map_info *, struct ilist *,
+			struct line_pnts *, double);
+
+/* zbulk.c */
+int Vedit_bulk_labeling(struct Map_info *, struct ilist *,
+			double, double, double, double, double, double);
+
+#endif /* GRASS_VEDITDEFS_H */

+ 1 - 160
include/display.h

@@ -12,165 +12,6 @@ enum clip_mode
     M_CLIP,
 };
 
-/* cnversions.c */
-void D_update_conversions(void);
-void D_fit_d_to_u(void);
-void D_fit_u_to_d(void);
-void D_show_conversions(void);
-
-void D_do_conversions(const struct Cell_head *, double, double, double, double);
-
-int D_is_lat_lon(void);
-
-double D_get_d_to_a_xconv(void);
-double D_get_d_to_a_yconv(void);
-double D_get_d_to_u_xconv(void);
-double D_get_d_to_u_yconv(void);
-double D_get_a_to_u_xconv(void);
-double D_get_a_to_u_yconv(void);
-double D_get_a_to_d_xconv(void);
-double D_get_a_to_d_yconv(void);
-double D_get_u_to_d_xconv(void);
-double D_get_u_to_d_yconv(void);
-double D_get_u_to_a_xconv(void);
-double D_get_u_to_a_yconv(void);
-
-double D_get_ns_resolution(void);
-double D_get_ew_resolution(void);
-
-double D_get_u_west(void);
-double D_get_u_east(void);
-double D_get_u_north(void);
-double D_get_u_south(void);
-double D_get_a_west(void);
-double D_get_a_east(void);
-double D_get_a_north(void);
-double D_get_a_south(void);
-double D_get_d_west(void);
-double D_get_d_east(void);
-double D_get_d_north(void);
-double D_get_d_south(void);
-
-void D_set_region(const struct Cell_head *);
-void D_set_src(double, double, double, double);
-void D_get_src(double *, double *, double *, double *);
-void D_set_grid(int, int, int, int);
-void D_get_grid(int *, int *, int *, int *);
-void D_set_dst(double, double, double, double);
-void D_get_dst(double *, double *, double *, double *);
-
-void D_get_u(double [2][2]);
-void D_get_a(int [2][2]);
-void D_get_d(double [2][2]);
-
-double D_d_to_a_row(double);
-double D_d_to_a_col(double);
-double D_d_to_u_row(double);
-double D_d_to_u_col(double);
-double D_a_to_u_row(double);
-double D_a_to_u_col(double);
-double D_a_to_d_row(double);
-double D_a_to_d_col(double);
-double D_u_to_d_row(double);
-double D_u_to_d_col(double);
-double D_u_to_a_row(double);
-double D_u_to_a_col(double);
-
-/* draw2.c */
-
-void D_set_clip(double, double, double, double);
-void D_clip_to_map(void);
-void D_set_clip_mode(int);
-void D_set_reduction(double);
-
-void D_line_width(double);
-void D_get_text_box(const char *, double *, double *, double *, double *);
-
-void D_pos_abs(double, double);
-void D_pos_rel(double, double);
-void D_move_abs(double, double);
-void D_move_rel(double, double);
-void D_cont_abs(double, double);
-void D_cont_rel(double, double);
-void D_line_abs(double, double, double, double);
-void D_line_rel(double, double, double, double);
-void D_polydots_abs(const double *, const double *, int);
-void D_polydots_rel(const double *, const double *, int);
-void D_polyline_abs(const double *, const double *, int);
-void D_polyline_rel(const double *, const double *, int);
-void D_polygon_abs(const double *, const double *, int);
-void D_polygon_rel(const double *, const double *, int);
-void D_box_abs(double, double, double, double);
-void D_box_rel(double, double);
-
-void D_begin(void);
-void D_end(void);
-void D_close(void);
-void D_stroke(void);
-void D_fill(void);
-void D_dots(void);
-
-/* icon.c */
-void D_plot_icon(double, double, int, double, double);
-
-/* raster.c */
-int D_draw_raster(int, const void *, struct Colors *, RASTER_MAP_TYPE);
-int D_draw_d_raster(int, const DCELL *, struct Colors *);
-int D_draw_f_raster(int, const FCELL *, struct Colors *);
-int D_draw_c_raster(int, const CELL *, struct Colors *);
-int D_draw_cell(int, const CELL *, struct Colors *);
-void D_cell_draw_begin(void);
-int D_draw_raster_RGB(int, const void *, const void *, const void *,
-		      struct Colors *, struct Colors *, struct Colors *,
-		      RASTER_MAP_TYPE, RASTER_MAP_TYPE, RASTER_MAP_TYPE);
-void D_cell_draw_end(void);
-
-/* raster2.c */
-int D_set_overlay_mode(int);
-int D_color(CELL, struct Colors *);
-int D_c_color(CELL, struct Colors *);
-int D_d_color(DCELL, struct Colors *);
-int D_f_color(FCELL, struct Colors *);
-int D_color_of_type(const void *, struct Colors *, RASTER_MAP_TYPE);
-
-/* setup.c */
-void D_setup(int);
-void D_setup_unity(int);
-void D_setup2(int, int, double, double, double, double);
-
-/* symbol.c */
-void D_symbol(const SYMBOL *, double, double, const RGBA_Color *,
-	      const RGBA_Color *);
-void D_symbol2(const SYMBOL *, double, double, const RGBA_Color *,
-	       const RGBA_Color *);
-
-/* tran_colr.c */
-int D_translate_color(const char *);
-int D_parse_color(const char *, int);
-int D_use_color(int);
-int D_color_number_to_RGB(int, int *, int *, int *);
-void D_RGB_color(int, int, int);
-
-/* window.c */
-void D_erase(const char *);
-
-/* r_raster.c */
-
-int D_open_driver(void);
-void D_close_driver(void);
-int D_save_command(const char *);
-
-void D_get_window(double *, double *, double *, double *);
-
-void D__erase(void);
-
-void D_text_size(double, double);
-void D_text_rotation(double);
-void D_text(const char *);
-
-void D_font(const char *);
-void D_encoding(const char *);
-void D_font_list(char ***, int *);
-void D_font_info(char ***, int *);
+#include <grass/defs/display.h>
 
 #endif /* GRASS_DISPLAY_H */

+ 6 - 20
include/dlg.h

@@ -1,3 +1,6 @@
+#ifndef GRASS_DLG_H
+#define GRASS_DLG_H
+
 struct dlg_node
 {
     double x;
@@ -124,23 +127,6 @@ struct dlg
 /* Need a definition for FILE   */
 #include <stdio.h>
 
-int dlg_init(FILE *, struct dlg *);
-int dlg_read(FILE *, struct dlg *);
-int _dlg_read_node(struct dlg_node *, FILE *);
-int _dlg_read_area(struct dlg_area *, FILE *);
-int _dlg_read_line(struct dlg_line *, FILE *);
-int _dlg_write_area(struct dlg_area *, FILE *);
-int dlg_write_header(FILE *, struct dlg *);
-int _dlg_write_line(struct dlg_line *, FILE *);
-int _dlg_write_node(struct dlg_node *, FILE *);
-int dlg_read_whole_area(FILE *, struct dlg *, int, double **, double **,
-			int *, int *);
-int dlg_read_area(FILE *, struct dlg *, int);
-int dlg_read_line(FILE *, struct dlg *, int);
-int dlg_read_node(FILE *, struct dlg *, int);
-int dlg_read_int(FILE *, int, int **);
-int dlg_write_int(FILE *, int, int *);
-int dlg_write_double(FILE *, int, double *);
-int dlg_write_area(FILE *, struct dlg *, int);
-int dlg_write_line(FILE *, struct dlg *, int);
-int dlg_write_node(FILE *, struct dlg *, int);
+#include <grass/defs/dlg.h>
+
+#endif

+ 2 - 2
include/fontcap.h

@@ -1,5 +1,5 @@
-#ifndef _GRASS_FREETYPECAP_H
-#define _GRASS_FREETYPECAP_H
+#ifndef GRASS_FONTCAP_H
+#define GRASS_FONTCAP_H
 
 struct GFONT_CAP
 {

+ 6 - 6
include/form.h

@@ -1,3 +1,6 @@
+#ifndef GRASS_FORM_H
+#define GRASS_FORM_H
+
 #define F_VIEW 1
 #define F_EDIT 2
 
@@ -10,9 +13,6 @@
 #define F_KEY_FNAME "_grass_internal_key_name"
 #define F_ENCODING "_grass_internal_database_encoding"
 
-int F_generate(char *driver, char *database, char *table, char *key,
-	       int keyval, char *frmname, char *frmmapset, int edit_mode,
-	       int format, char **form);
-int F_open(char *title, char *html);
-void F_clear(void);
-void F_close(void);
+#include <grass/defs/form.h>
+
+#endif

+ 0 - 4
include/geom.h

@@ -1,4 +0,0 @@
-#include "geom/optri.h"
-#include "geom/lia.h"
-#include "geom/basic.h"
-#include "geom/sos.h"

+ 1 - 1
include/gis.h

@@ -470,6 +470,6 @@ struct Colors
 
 /* Since there are so many prototypes for the gis library they are stored */
 /* in the file gisdefs.h */
-#include <grass/gisdefs.h>
+#include <grass/defs/gis.h>
 
 #endif /* GRASS_GIS_H */

+ 1 - 2
include/glocale.h

@@ -3,8 +3,7 @@
 
 #include <grass/config.h>
 
-extern void G_init_locale(void);
-extern char *G_gettext(const char *, const char *);
+#include <grass/defs/glocale.h>
 
 #if defined(HAVE_LIBINTL_H) && defined(USE_NLS)
 #include <libintl.h>

+ 4 - 180
include/gmath.h

@@ -20,8 +20,8 @@
 
  ******************************************************************************/
 
-#ifndef GMATH_H_
-#define GMATH_H_
+#ifndef GRASS_GMATH_H
+#define GRASS_GMATH_H
 
 #include <grass/config.h>
 #if defined(HAVE_LIBLAPACK) && defined(HAVE_LIBBLAS) && defined(HAVE_G2C_H)
@@ -46,80 +46,6 @@
 #define G_MATH_ROWSCALE_EUKLIDNORM_PRECONDITION 3
 #define G_MATH_ROWSCALE_MAXNORM_PRECONDITION 4
 
-/* dalloc.c */
-double *G_alloc_vector(size_t);
-double **G_alloc_matrix(int, int);
-float  *G_alloc_fvector(size_t);
-float  **G_alloc_fmatrix(int, int);
-void G_free_vector(double *);
-void G_free_matrix(double **);
-void G_free_fvector(float *);
-void G_free_fmatrix(float **);
-
-/* ialloc.c */
-int *G_alloc_ivector(size_t);
-int **G_alloc_imatrix(int, int);
-void G_free_ivector(int *);
-void G_free_imatrix(int **);
-
-/* fft.c */
-extern int fft(int, double *[2], int, int, int);
-extern int fft2(int, double (*)[2], int, int, int);
-
-/* gauss.c */
-extern double G_math_rand_gauss(int, double);
-
-/* max_pow2.c */
-extern long G_math_max_pow2 (long n);
-extern long G_math_min_pow2 (long n);
-
-/* rand1.c */
-extern float G_math_rand(int);
-
-/* del2g.c */
-extern int del2g(double *[2], int, double);
-
-/* getg.c */
-extern int getg(double, double *[2], int);
-
-/* eigen_tools.c */
-extern int G_math_egvorder(double *, double **, long);
-
-/* mult.c */
-extern int G_math_complex_mult (double *v1[2], int size1, double *v2[2], int size2, double *v3[2], int size3);
-
-/* lu.c*/
-extern int G_ludcmp(double **, int, int *, double *);
-extern void G_lubksb(double **a, int n, int *indx, double b[]);
-
-/* findzc.c */
-extern int G_math_findzc(double conv[], int size, double zc[], double thresh, int num_orients);
-
-
-/* *************************************************************** */
-/* ***** WRAPPER FOR CCMATH FUNCTIONS USED IN GRASS ************** */
-/* *************************************************************** */
-extern int G_math_solv(double **,double *,int);
-extern int G_math_solvps(double **,double *,int);
-extern void G_math_solvtd(double *,double *,double *,double *,int);
-extern int G_math_solvru(double **,double *,int);
-extern int G_math_minv(double **,int);
-extern int G_math_psinv(double **,int);
-extern int G_math_ruinv(double **,int);
-extern void G_math_eigval(double **,double *,int);
-extern void G_math_eigen(double **,double *,int);
-extern double G_math_evmax(double **,double *,int);
-extern int G_math_svdval(double *,double **,int,int);
-extern int G_math_sv2val(double *,double **,int,int);
-extern int G_math_svduv(double *,double **,double **, int,double **,int);
-extern int G_math_sv2uv(double *,double **,double **,int,double **,int);
-extern int G_math_svdu1v(double *,double **,int,double **,int);
-
-
-/* *************************************************************** */
-/* *************** LINEARE EQUATION SYSTEM PART ****************** */
-/* *************************************************************** */
-
 /*!
  * \brief The row vector of the sparse matrix
  * */
@@ -130,108 +56,6 @@ typedef struct
     unsigned int *index;	/*the index number */
 } G_math_spvector;
 
-/* Sparse matrix and sparse vector functions
- * */
-extern G_math_spvector *G_math_alloc_spvector(int );
-extern G_math_spvector **G_math_alloc_spmatrix(int );
-extern void G_math_free_spmatrix(G_math_spvector ** , int );
-extern void G_math_free_spvector(G_math_spvector * );
-extern int G_math_add_spvector(G_math_spvector **, G_math_spvector * , int );
-extern G_math_spvector **G_math_A_to_Asp(double **, int, double);
-extern double **G_math_Asp_to_A(G_math_spvector **, int);
-extern double **G_math_Asp_to_sband_matrix(G_math_spvector **, int, int);
-extern G_math_spvector **G_math_sband_matrix_to_Asp(double **, int, int, double);
-extern void G_math_print_spmatrix(G_math_spvector **, int);
-extern void G_math_Ax_sparse(G_math_spvector **, double *, double *, int );
-
-/*Symmetric band matrix handling */
-extern double **G_math_matrix_to_sband_matrix(double **, int, int);
-extern double **G_math_sband_matrix_to_matrix(double **, int, int);
-extern void G_math_Ax_sband(double ** A, double *x, double *y, int rows, int bandwidth);
-
-/*linear equation solver, most of them are multithreaded wih OpenMP*/
-extern int G_math_solver_gauss(double **, double *, double *, int );
-extern int G_math_solver_lu(double **, double *, double *, int );
-extern int G_math_solver_cholesky(double **, double *, double *, int , int );
-extern void G_math_solver_cholesky_sband(double **, double *, double *, int, int);
-extern int G_math_solver_jacobi(double **, double *, double *, int , int , double , double );
-extern int G_math_solver_gs(double **, double *, double *, int , int , double , double );
-
-extern int G_math_solver_pcg(double **, double *, double *, int , int , double , int );
-extern int G_math_solver_cg(double **, double *, double *, int , int , double );
-extern int G_math_solver_cg_sband(double **, double *, double *, int, int, int, double);
-extern int G_math_solver_bicgstab(double **, double *, double *, int , int , double );
-extern int G_math_solver_sparse_jacobi(G_math_spvector **, double *, double *, int , int , double , double );
-extern int G_math_solver_sparse_gs(G_math_spvector **, double *, double *, int , int , double , double );
-extern int G_math_solver_sparse_pcg(G_math_spvector **, double *, double *, int , int , double , int );
-extern int G_math_solver_sparse_cg(G_math_spvector **, double *, double *, int , int , double );
-extern int G_math_solver_sparse_bicgstab(G_math_spvector **, double *, double *, int , int , double );
-
-/* solver algoithms and helper functions*/
-extern void G_math_gauss_elimination(double **, double *, int );
-extern void G_math_lu_decomposition(double **, double *, int );
-extern int G_math_cholesky_decomposition(double **, int , int );
-extern void G_math_cholesky_sband_decomposition(double **, double **, int, int);
-extern void G_math_backward_substitution(double **, double *, double *, int );
-extern void G_math_forward_substitution(double **, double *, double *, int );
-extern void G_math_cholesky_sband_substitution(double **, double *, double *, int, int);
-
-/*BLAS like level 1,2 and 3 functions*/
-
-/*level 1 vector - vector grass implementation with OpenMP thread support*/
-extern void G_math_d_x_dot_y(double *, double *, double *, int );
-extern void G_math_d_asum_norm(double *, double *, int );
-extern void G_math_d_euclid_norm(double *, double *, int );
-extern void G_math_d_max_norm(double *, double *, int );
-extern void G_math_d_ax_by(double *, double *, double *, double , double , int );
-extern void G_math_d_copy(double *, double *, int );
-
-extern void G_math_f_x_dot_y(float *, float *, float *, int );
-extern void G_math_f_asum_norm(float *, float *, int );
-extern void G_math_f_euclid_norm(float *, float *, int );
-extern void G_math_f_max_norm(float *, float *, int );
-extern void G_math_f_ax_by(float *, float *, float *, float , float , int );
-extern void G_math_f_copy(float *, float *, int );
-
-extern void G_math_i_x_dot_y(int *, int *,  double *, int );
-extern void G_math_i_asum_norm(int *,  double *, int );
-extern void G_math_i_euclid_norm(int *,  double *,int );
-extern void G_math_i_max_norm(int *,  int *, int );
-extern void G_math_i_ax_by(int *, int *, int *, int , int , int );
-extern void G_math_i_copy(int *, int *, int );
-
-/*ATLAS blas level 1 wrapper*/
-extern double G_math_ddot(double *, double *, int );
-extern float G_math_sdot(float *, float *, int );
-extern float G_math_sdsdot(float *, float *, float , int );
-extern double G_math_dnrm2(double *, int );
-extern double G_math_dasum(double *, int );
-extern double G_math_idamax(double *, int );
-extern float  G_math_snrm2(float *, int );
-extern float  G_math_sasum(float *, int );
-extern float  G_math_isamax(float *, int );
-extern void G_math_dscal(double *, double , int );
-extern void G_math_sscal(float *, float , int );
-extern void G_math_dcopy(double *, double *, int );
-extern void G_math_scopy(float *, float *, int );
-extern void G_math_daxpy(double *, double *, double , int );
-extern void G_math_saxpy(float *, float *, float , int );
-
-/*level 2 matrix - vector grass implementation with OpenMP thread support*/
-extern void G_math_d_Ax(double **, double *, double *, int , int );
-extern void G_math_f_Ax(float **, float *, float *, int , int );
-extern void G_math_d_x_dyad_y(double *, double *, double **, int, int );
-extern void G_math_f_x_dyad_y(float *, float *, float **, int, int );
-extern void G_math_d_aAx_by(double **, double *, double *, double , double , double *, int , int );
-extern void G_math_f_aAx_by(float **, float *, float *, float , float , float *, int , int );
-extern int G_math_d_A_T(double **A, int rows);
-extern int G_math_f_A_T(float **A, int rows);
-
-/*level 3 matrix - matrix grass implementation with OpenMP thread support*/
-extern void G_math_d_aA_B(double **, double **, double , double **, int , int );
-extern void G_math_f_aA_B(float **, float **, float , float **, int , int );
-extern void G_math_d_AB(double **, double **, double **, int , int , int );
-extern void G_math_f_AB(float **,  float **,  float **,  int , int , int );
-
-#endif /* GMATH_H_ */
+#include <grass/defs/gmath.h>
 
+#endif /* GRASS_GMATH_H */

+ 4 - 44
include/gprojects.h

@@ -14,8 +14,8 @@
  *
  *****************************************************************************/
 
-#ifndef _GPROJECTS_H
-#define _GPROJECTS_H
+#ifndef GRASS_GPROJECTS_H
+#define GRASS_GPROJECTS_H
 
 #include <grass/config.h>
 #include <proj_api.h>
@@ -66,46 +66,6 @@ struct gpj_ellps
     double a, es, rf;
 };
 
-/* do_proj.c */
-int pj_do_proj(double *, double *, struct pj_info *, struct pj_info *);
-int pj_do_transform(int, double *, double *, double *,
-		    struct pj_info *, struct pj_info *);
-
-/* get_proj.c */
-int pj_get_kv(struct pj_info *, struct Key_Value *, struct Key_Value *);
-int pj_get_string(struct pj_info *, char *);
-int GPJ_get_equivalent_latlong(struct pj_info *, struct pj_info *);
-const char *set_proj_lib(const char *);
-int pj_print_proj_params(struct pj_info *, struct pj_info *);
-
-/* convert.c */
-#ifdef HAVE_OGR
-char *GPJ_grass_to_wkt(struct Key_Value *, struct Key_Value *, int, int);
-OGRSpatialReferenceH GPJ_grass_to_osr(struct Key_Value *, struct Key_Value *);
-int GPJ_wkt_to_grass(struct Cell_head *, struct Key_Value **,
-		     struct Key_Value **, const char *, int);
-int GPJ_osr_to_grass(struct Cell_head *, struct Key_Value **,
-		     struct Key_Value **, OGRSpatialReferenceH, int);
-const char *GPJ_set_csv_loc(const char *);
-#endif
-
-/* datum.c */
-int GPJ_get_datum_by_name(const char *, struct gpj_datum *);
-int GPJ_get_default_datum_params_by_name(const char *, char **);
-int GPJ_get_datum_params(char **, char **);
-int GPJ__get_datum_params(struct Key_Value *, char **, char **);
-void GPJ_free_datum(struct gpj_datum *);
-struct gpj_datum_transform_list *GPJ_get_datum_transform_by_name(const char *);
-void GPJ_free_datum_transform(struct gpj_datum_transform_list *);
-
-/* ellipse.c */
-int GPJ_get_ellipsoid_by_name(const char *, struct gpj_ellps *);
-int GPJ_get_ellipsoid_params(double *, double *, double *);
-int GPJ__get_ellipsoid_params(struct Key_Value *,
-			      double *, double *, double *);
-void GPJ_free_ellps(struct gpj_ellps *);
-
-
 /* PROJ.4's private datastructures copied from projects.h as removed
    from upstream; pending better solution. see:
    http://trac.osgeo.org/proj/ticket/98 */
@@ -126,8 +86,8 @@ struct FACTORS {
 	double a, b;		/* max-min scale error */
 	int code;		/* info as to analytics, see following */
 };
-
-int pj_factors(LP, void *, double, struct FACTORS *);
 /* end of copy */
 
+#include <grass/defs/gprojects.h>
+
 #endif

+ 0 - 121
include/gsurf.h

@@ -1,121 +0,0 @@
-/*!
-   \file include/gsurf.h
-
-   \brief OGSF library - main header
-
-   (C) 1999-2008, 2011 by the GRASS Development Team
-
-   This program is free software under the GNU General Public License
-   (>=v2).  Read the file COPYING that comes with GRASS for details.
-
-   \author Bill Brown USACERL (January 1993)
- */
-
-#ifndef _GSURF_H
-#define _GSURF_H
-
-#define GS_UNIT_SIZE 1000.
-
-#define BETWEEN(x, a, b) (((x) > (a) && (x) < (b)) || ((x) > (b) && (x) < (a)))
-#define GS_NEAR_EQUAL(x, y, ratio) ((x) == (y) || ((x) == 0.0? \
-            GS_BETWEEN((x), (y)+(y)*(ratio), (y)-(y)*(ratio)):\
-            GS_BETWEEN((y), (x)+(x)*(ratio), (x)-(x)*(ratio))))
-
-/* current maximums */
-#define MAX_SURFS      12
-#define MAX_VECTS      50
-#define MAX_SITES      50
-#define MAX_VOLS       12	/* should match MAX_VOL_FILES below ? */
-#define MAX_DSP        12
-#define MAX_ATTS        7
-#define MAX_LIGHTS      3
-#define MAX_CPLANES     6
-#define MAX_ISOSURFS   12
-#define MAX_SLICES     12
-
-/* for gvl_file.c */
-#define MAX_VOL_SLICES         4
-#define MAX_VOL_FILES        100
-
-/* surface display modes */
-#define DM_GOURAUD   0x00000100
-#define DM_FLAT      0x00000200	/* defined for symmetry */
-
-#define DM_FRINGE    0x00000010
-
-#define DM_WIRE      0x00000001
-#define DM_COL_WIRE  0x00000002
-#define DM_POLY      0x00000004
-#define DM_WIRE_POLY 0x00000008
-
-#define DM_GRID_WIRE 0x00000400
-#define DM_GRID_SURF 0x00000800
-
-#define WC_COLOR_ATT 0xFF000000
-
-#define IFLAG unsigned int
-
-/* surface attribute ***descriptors***  */
-#define ATT_NORM      0		/* library use only */
-#define ATT_TOPO      1
-#define ATT_COLOR     2
-#define ATT_MASK      3
-#define ATT_TRANSP    4
-#define ATT_SHINE     5
-#define ATT_EMIT      6
-#define LEGAL_ATT(a) (a >= 0 && a < MAX_ATTS)
-
-/* surface attribute **sources**  */
-#define NOTSET_ATT   0
-#define MAP_ATT      1
-#define CONST_ATT    2
-#define FUNC_ATT     3
-#define LEGAL_SRC(s) (s==NOTSET_ATT||s==MAP_ATT||s==CONST_ATT||s==FUNC_ATT)
-
-/* site markers */
-#define ST_X          1
-#define ST_BOX        2
-#define ST_SPHERE     3
-#define ST_CUBE       4
-#define ST_DIAMOND    5
-#define ST_DEC_TREE   6
-#define ST_CON_TREE   7
-#define ST_ASTER      8
-#define ST_GYRO       9
-#define ST_HISTOGRAM  10
-
-/* Buffer modes */
-#define GSD_FRONT 1
-#define GSD_BACK  2
-#define GSD_BOTH  3
-
-/* fence colormodes */
-#define FC_OFF           0
-#define FC_ABOVE         1
-#define FC_BELOW         2
-#define FC_BLEND         3
-#define FC_GREY          4
-
-/* legend types */
-#define LT_DISCRETE      0x00000100
-#define LT_CONTINUOUS    0x00000200
-
-#define LT_LIST          0x00000010
-/* list automatically discrete */
-
-#define LT_RANGE_LOWSET  0x00000001
-#define LT_RANGE_HISET   0x00000002
-#define LT_RANGE_LOW_HI  0x00000003
-#define LT_INVERTED      0x00000008
-
-#define LT_SHOW_VALS     0x00001000
-#define LT_SHOW_LABELS   0x00002000
-
-/* types of volume files */
-#define VOL_FTYPE_RASTER3D        0
-
-/* types of volume values */
-#define VOL_DTYPE_FLOAT     0
-#define VOL_DTYPE_DOUBLE    1
-
-#endif /* _GSURF_H */

+ 6 - 9
include/ibtree.h

@@ -1,3 +1,6 @@
+#ifndef GRASS_IBTREE_H
+#define GRASS_IBTREE_H
+
 typedef struct
 {
     int key;
@@ -16,12 +19,6 @@ typedef struct
     int (*cmp) ();		/* routine to compare keys */
 } IBTREE;
 
-int ibtree_create(IBTREE *, int (*)(), int);
-int ibtree_find(IBTREE *, int, int *);
-int ibtree_free(IBTREE *);
-int ibtree_next(IBTREE *, int *, int *);
-int ibtree_rewind(IBTREE *);
-int Btree_init();
-int Btree_add(int);
-int Btree_report();
-int ibtree_update(IBTREE *, int, int);
+#include <grass/defs/ibtree.h>
+
+#endif

+ 3 - 11
include/icon.h

@@ -1,8 +1,8 @@
 #ifndef GRASS_ICON_H
+#define GRASS_ICON_H
 #ifndef _STDIO_H
 #include <stdio.h>
 #endif
-#define GRASS_ICON_H
 
 #define ICON struct _icon
 struct _icon
@@ -14,14 +14,6 @@ struct _icon
     char **map;
 };
 
-char *ask_icon_any(char *, char *, int);
-char *ask_icon_new(char *, char *);
-char *ask_icon_old(char *, char *);
-int get_icon(char *, char *, ICON *);
-int get_default_icon(ICON *);
-int put_icon(char *, ICON *);
-int read_icon(FILE *, ICON *);
-int release_icon(ICON *);
-int scale_icon(ICON *, ICON *, float);
-int write_icon(FILE *, ICON *, int);
+#include <grass/defs/icon.h>
+
 #endif

+ 1 - 1
include/imagery.h

@@ -109,6 +109,6 @@ struct SigSet
 #define GROUPFILE "CURGROUP"
 #define SUBGROUPFILE "CURSUBGROUP"
 
-#include <grass/imagedefs.h>
+#include <grass/defs/imagery.h>
 
 #endif

+ 0 - 27
include/keyframe.h

@@ -1,27 +0,0 @@
-#ifndef _KEYFRAME_H
-#define _KEYFRAME_H
-
-/* these have to be 1 << KF_id_index */
-
-#define KF_FROMX_MASK	0x00000001
-#define KF_FROMY_MASK	0x00000002
-#define KF_FROMZ_MASK	0x00000004
-#define KF_FROM_MASK	0x00000007
-
-#define KF_DIRX_MASK	0x00000008
-#define KF_DIRY_MASK	0x00000010
-#define KF_DIRZ_MASK	0x00000020
-#define KF_DIR_MASK	0x00000038
-
-#define KF_FOV_MASK	0x00000040
-#define KF_TWIST_MASK	0x00000080
-
-#define KF_ALL_MASK	0x000000FF
-
-#define KF_NUMFIELDS 8
-
-#define KF_LINEAR 111
-#define KF_SPLINE 222
-#define KF_LEGAL_MODE(m) (m == KF_LINEAR || m == KF_SPLINE)
-
-#endif /* _KEYFRAME_H */

+ 0 - 36
include/kftypes.h

@@ -1,36 +0,0 @@
-#ifndef _KFTYPES_H
-#define _KFTYPES_H
-
-#ifndef _KEYFRAME_H
-#include <grass/keyframe.h>
-#endif
-
-#define KF_FROMX 0
-#define KF_FROMY 1
-#define KF_FROMZ 2
-#define KF_DIRX 3
-#define KF_DIRY 4
-#define KF_DIRZ 5
-#define KF_FOV 6
-#define KF_TWIST 7
-
-#define FM_VECT 0x00000001
-#define FM_SITE 0x00000002
-#define FM_PATH 0x00000004
-#define FM_VOL  0x00000008
-#define FM_LABEL 0x00000010
-
-typedef struct view_node
-{
-    float fields[KF_NUMFIELDS];
-} Viewnode;
-
-typedef struct key_node
-{
-    float pos, fields[KF_NUMFIELDS];
-    int look_ahead;
-    unsigned long fieldmask;
-    struct key_node *next, *prior;
-} Keylist;
-
-#endif /* _KFTYPES_H */

+ 4 - 52
include/la.h

@@ -13,8 +13,8 @@
  * \date 2000-2007
  */
 
-#ifndef LA_H_
-#define LA_H_
+#ifndef GRASS_LA_H
+#define GRASS_LA_H
 
 /* QUESTION: On some systems there appears to be no default link
    to this. Do we create a symlink to
@@ -143,54 +143,6 @@ typedef struct matrix_
 
 typedef mat_struct vec_struct;
 
+#include <grass/defs/la.h>
 
-/* Prototypes */
-
-/* Matrix routines corresponding to BLAS Level III */
-
-mat_struct *G_matrix_init(int, int, int);
-int G_matrix_zero(mat_struct *);
-int G_matrix_set(mat_struct *, int, int, int);
-mat_struct *G_matrix_copy(const mat_struct *);
-mat_struct *G_matrix_add(mat_struct *, mat_struct *);
-mat_struct *G_matrix_subtract(mat_struct *, mat_struct *);
-mat_struct *G_matrix_scale(mat_struct *, const double);
-mat_struct *G__matrix_add(mat_struct *, mat_struct *, const double,
-			  const double);
-mat_struct *G_matrix_product(mat_struct *, mat_struct *);
-mat_struct *G_matrix_transpose(mat_struct *);
-int G_matrix_LU_solve(const mat_struct *, mat_struct **, const mat_struct *,
-		      mat_type);
-mat_struct *G_matrix_inverse(mat_struct *);
-void G_matrix_free(mat_struct *);
-void G_matrix_print(mat_struct *);
-int G_matrix_set_element(mat_struct *, int, int, double);
-double G_matrix_get_element(mat_struct *, int, int);
-
-
-/* Matrix-vector routines corresponding to BLAS Level II */
-
-vec_struct *G_matvect_get_column(mat_struct *, int);
-vec_struct *G_matvect_get_row(mat_struct *, int);
-int G_matvect_extract_vector(mat_struct *, vtype, int);
-int G_matvect_retrieve_matrix(vec_struct *);
-
-
-/* Vector routines corresponding to BLAS Level I */
-
-vec_struct *G_vector_init(int, int, vtype);
-int G_vector_set(vec_struct *, int, int, vtype, int);
-double G_vector_norm_euclid(vec_struct *);
-double G_vector_norm_maxval(vec_struct *, int);
-vec_struct *G_vector_copy(const vec_struct *, int);
-
-/* Matrix and vector routines corresponding to ?? */
-
-void G_vector_free(vec_struct *);
-vec_struct *G_vector_sub(vec_struct *, vec_struct *, vec_struct *);
-double G_vector_norm1(vec_struct *);
-int G_matrix_read(FILE *, mat_struct *);
-int G_matrix_stdin(mat_struct *);
-int G_matrix_eigen_sort(vec_struct *, mat_struct *);
-
-#endif /* LA_H_ */
+#endif /* GRASS_LA_H */

+ 4 - 20
include/libtrans.h

@@ -1,27 +1,11 @@
-#ifndef __LIBTRANS_H__
-#define __LIBTRANS_H__
+#ifndef GRASS_LIBTRANS_H
+#define GRASS_LIBTRANS_H
 
 /* to give the size of the multi-dim array parameter is necessary here,
    because DEC's cc V5.6-079 on Digital UNIX V4.0 (Rev. 878) seems to need it
  */
 #define DIM_matrix 3
 
-/* inverse.c */
-int inverse(double[DIM_matrix][DIM_matrix]);
-int isnull(double[DIM_matrix][DIM_matrix]);
+#include <grass/defs/libtrans.h>
 
-/* m_mult.c */
-int m_mult(double[DIM_matrix][DIM_matrix], double *, double *);
-
-/* transform.c */
-int compute_transformation_coef(double *, double *, double *, double *, int *,
-				int);
-int transform_a_into_b(double, double, double *, double *);
-int transform_b_into_a(double, double, double *, double *);
-int residuals_a_predicts_b(double *, double *, double *, double *, int *, int,
-			   double *, double *);
-int residuals_b_predicts_a(double *, double *, double *, double *, int *, int,
-			   double *, double *);
-int print_transform_matrix(void);
-
-#endif /* __LIBTRANS_H__ */
+#endif /* GRASS_LIBTRANS_H */

+ 2 - 22
include/linkm.h

@@ -20,26 +20,6 @@ struct link_head
     int exit_flag;		/* exit on error ? */
 };
 
-#endif
-
-/* destroy.c */
-void link_destroy(struct link_head *, VOID_T *);
-
-/* dispose.c */
-void link_dispose(struct link_head *, VOID_T *);
-
-/* init.c */
-void link_set_chunk_size(int);
-void link_exit_on_error(int);
-struct link_head *link_init(int);
-void link_cleanup(struct link_head *);
+#include <grass/defs/linkm.h>
 
-/* new.c */
-struct link_head *link_new(struct link_head *);
-
-/* next.c */
-VOID_T *link__get_next(VOID_T *);
-void link__set_next(VOID_T *, VOID_T *);
-
-/* oom.c */
-int link_out_of_memory(void);
+#endif

+ 5 - 0
include/lock.h

@@ -1,2 +1,7 @@
+#ifndef GRASS_LOCK_H
+#define GRASS_LOCK_H
+
 int lock_file(char *, int);
 int unlock_file(char *);
+
+#endif

+ 1 - 41
include/manage.h

@@ -20,46 +20,6 @@ struct list
 
 #include <grass/gis.h>
 
-/* add_elem.c */
-void M__add_element(const char *, const char *);
-
-/* do_copy.c */
-int M_do_copy(int, const char *, const char *, const char *);
-
-/* do_list.c */
-void M_do_list(int, const char *);
-
-/* do_remove.c */
-int M_do_remove(int, const char *);
-
-/* do_rename.c */
-int M_do_rename(int, const char *, const char *);
-
-/* empty.c */
-int M__empty(char *);
-
-/* find.c */
-const char *M_find(int, char *, const char *);
-
-/* get_len.c */
-int M__get_description_len(int);
-
-/* list.c */
-int M_get_element(const char *);
-const struct list *M_get_list(int);
-
-/* read_list.c */
-int M_read_list(int, int *);
-
-/* option.c */
-struct Option* M_define_option(int, const char *, int);
-const char *M_get_options(int);
-const char *M_get_option_desc(int);
-
-/* show_elem.c */
-void M_show_elements(void);
-
-/* sighold.c */
-int M__hold_signals(int);
+#include <grass/defs/manage.h>
 
 #endif

+ 3 - 86
include/neta.h

@@ -15,8 +15,8 @@
  *
  ****************************************************************/
 
-#ifndef _NETA_H_
-#define _NETA_H_
+#ifndef GRASS_NETA_H
+#define GRASS_NETA_H
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -26,89 +26,6 @@
 #include <grass/glocale.h>
 #include <grass/dgl/graph.h>
 
-/*bridge.c */
-int NetA_compute_bridges(dglGraph_s * graph, struct ilist *bridge_list);
-int NetA_articulation_points(dglGraph_s * graph,
-			     struct ilist *articulation_list);
+#include <grass/defs/neta.h>
 
-/*components.c */
-int NetA_weakly_connected_components(dglGraph_s * graph, int *component);
-int NetA_strongly_connected_components(dglGraph_s * graph, int *component);
-
-/*spanningtree.c */
-int NetA_spanning_tree(dglGraph_s * graph, struct ilist *tree_list);
-
-/*allpairs.c */
-int NetA_allpairs(dglGraph_s * graph, dglInt32_t ** dist);
-
-/*neta_flow.c */
-int NetA_flow(dglGraph_s * graph, struct ilist *source_list,
-	      struct ilist *sink_list, int *flow);
-int NetA_min_cut(dglGraph_s * graph, struct ilist *source_list,
-		 struct ilist *sink_list, int *flow, struct ilist *cut);
-int NetA_split_vertices(dglGraph_s * in, dglGraph_s * out, int *node_costs);
-
-/*utils.c */
-void NetA_add_point_on_node(struct Map_info *In, struct Map_info *Out, int node,
-			    struct line_cats *Cats);
-void NetA_points_to_nodes(struct Map_info *In, struct ilist *point_list);
-int NetA_get_node_costs(struct Map_info *In, int layer, char *column,
-			int *node_costs);
-void NetA_varray_to_nodes(struct Map_info *map, struct varray * varray,
-			  struct ilist *nodes, int *nodes_to_features);
-int NetA_initialise_varray(struct Map_info *In, int layer, int mask_type,
-			   char *where, char *cat, struct varray ** varray);
-/*centrality.c */
-void NetA_degree_centrality(dglGraph_s * graph, double *degree);
-int NetA_eigenvector_centrality(dglGraph_s * graph, int iterations,
-				double error, double *eigenvector);
-int NetA_betweenness_closeness(dglGraph_s * graph, double *betweenness,
-			       double *closeness);
-
-/*path.c */
-int NetA_distance_from_points(dglGraph_s * graph, struct ilist *from, int *dst,
-			      dglInt32_t ** prev);
-int NetA_find_path(dglGraph_s * graph, int from, int to, int *edges,
-		   struct ilist *list);
-
-/*timetables.c */
-
-/*Structure containing all information about a timetable.
- * Everything in indexed from 0.
- */
-typedef struct
-{
-    int routes;			/*Number of different routes. Two routes are different even if they differ only in time. */
-    int *route_length;		/*Length of each route, i.e., number of stops */
-    int **route_stops;		/*list of stops on each route in order (time increases) */
-    int **route_times;		/*stop arrival times on overy route. Stops are given in the same order as above */
-    int stops;			/*number of stops */
-    int *stop_length;		/*Number of routes stopping at each stop */
-    int **stop_routes;		/*List of routes for each stop. Routes are in increasing order */
-    int **stop_times;		/*arrival times of routes for each stop. Routes are given in the same order as above */
-    int *walk_length;		/*number of stops with "walking connection" for each stop */
-    int **walk_stops;		/*list of stops within walking distance for each stop */
-    int **walk_times;		/*walking times between stops as given above */
-} neta_timetable;
-
-typedef struct
-{
-    int **dst;
-    int **prev_stop;
-    int **prev_route;
-    int **prev_conn;
-    int rows, routes;
-} neta_timetable_result;
-int NetA_init_timetable_from_db(struct Map_info *In, int route_layer,
-				int walk_layer, char *route_id, char *times,
-				char *to_stop, char *walk_length,
-				neta_timetable * timetable, int **route_ids,
-				int **stop_ids);
-int NetA_timetable_shortest_path(neta_timetable * timetable, int from_stop,
-				 int to_stop, int start_time, int min_change,
-				 int max_changes, int walking_change,
-				 neta_timetable_result * result);
-int NetA_timetable_get_route_time(neta_timetable * timetable, int stop,
-				  int route);
-void NetA_timetable_result_release(neta_timetable_result * result);
 #endif

+ 2 - 102
include/nviz.h

@@ -33,8 +33,7 @@
 #  error Unsupported platform, or confused platform defines...
 #endif
 
-#include <grass/gsurf.h>
-#include <grass/gstypes.h>
+#include <grass/ogsf.h>
 
 #define MAP_OBJ_UNDEFINED 0
 #define MAP_OBJ_SURF 1
@@ -144,105 +143,6 @@ struct render_window
 #endif
 };
 
-/* change_view.c */
-int Nviz_resize_window(int, int);
-int Nviz_update_ranges(nv_data *);
-int Nviz_set_viewpoint_position(double, double);
-int Nviz_set_viewpoint_height(double);
-int Nviz_set_viewpoint_persp(int);
-int Nviz_set_viewpoint_twist(int);
-int Nviz_change_exag(nv_data *, double);
-int Nviz_look_here(double, double);
-void Nviz_get_modelview(double *);
-void Nviz_set_rotation(double, double, double, double);
-void Nviz_unset_rotation(void);
-void Nviz_init_rotation(void);
-void Nviz_flythrough(nv_data *, float *, int *, int);
-
-/* cplanes_obj.c */
-int Nviz_new_cplane(nv_data *, int);
-int Nviz_on_cplane(nv_data *, int);
-int Nviz_off_cplane(nv_data *, int);
-int Nviz_draw_cplane(nv_data *, int, int);
-int Nviz_num_cplanes(nv_data *);
-int Nviz_get_current_cplane(nv_data *);
-int Nviz_set_cplane_rotation(nv_data *, int, float, float, float);
-int Nviz_get_cplane_rotation(nv_data *, int, float *, float *, float *);
-int Nviz_set_cplane_translation(nv_data *, int, float, float, float);
-int Nviz_get_cplane_translation(nv_data *, int, float *, float *, float *);
-int Nviz_set_fence_color(nv_data *, int);
-int Nviz_set_cplane_here(nv_data *, int, float, float);
-
-
-/* draw.c */
-int Nviz_draw_all_surf(nv_data *);
-int Nviz_draw_all_vect();
-int Nviz_draw_all_site();
-int Nviz_draw_all_vol();
-int Nviz_draw_all(nv_data *);
-int Nviz_draw_quick(nv_data *, int);
-int Nviz_load_image(GLubyte *, int, int, int);
-void Nviz_draw_image(int, int, int, int, int);
-void Nviz_set_2D(int, int);
-void Nviz_del_texture(int);
-void Nviz_get_max_texture(int *);
-
-/* exag.c */
-int Nviz_get_exag_height(double *, double *, double *);
-double Nviz_get_exag();
-
-/* lights.c */
-int Nviz_set_light_position(nv_data *, int, double, double, double, double);
-int Nviz_set_light_bright(nv_data *, int, double);
-int Nviz_set_light_color(nv_data *, int, int, int, int);
-int Nviz_set_light_ambient(nv_data *, int, double);
-int Nviz_init_light(nv_data *, int);
-int Nviz_new_light(nv_data *);
-void Nviz_draw_model(nv_data *);
-
-/* map_obj.c */
-int Nviz_new_map_obj(int, const char *, double, nv_data *);
-int Nviz_set_attr(int, int, int, int, const char *, double, nv_data *);
-void Nviz_set_surface_attr_default();
-int Nviz_set_vpoint_attr_default();
-int Nviz_set_volume_attr_default();
-int Nviz_unset_attr(int, int, int);
-
-/* nviz.c */
-void Nviz_init_data(nv_data *);
-void Nviz_destroy_data(nv_data *);
-void Nviz_set_bgcolor(nv_data *, int);
-int Nviz_get_bgcolor(nv_data *);
-int Nviz_color_from_str(const char *);
-struct fringe_data *Nviz_new_fringe(nv_data *, int, unsigned long,
-				    double, int, int, int, int);
-struct fringe_data *Nviz_set_fringe(nv_data *, int, unsigned long,
-				    double, int, int, int, int);
-void Nviz_draw_fringe(nv_data *data);
-int Nviz_draw_arrow(nv_data *);
-int Nviz_set_arrow(nv_data *, int, int, float, unsigned int);
-void Nviz_delete_arrow(nv_data *);
-struct scalebar_data * Nviz_new_scalebar(nv_data *, int, float *, float, unsigned int);
-struct scalebar_data * Nviz_set_scalebar(nv_data *, int , int, int, float, unsigned int);
-void Nviz_draw_scalebar(nv_data *);
-void Nviz_delete_scalebar(nv_data *, int);
-
-/* position.c */
-void Nviz_init_view(nv_data *);
-int Nviz_set_focus_state(int);
-int Nviz_set_focus_map(int, int);
-int Nviz_has_focus(nv_data *);
-int Nviz_set_focus(nv_data *, float, float, float);
-int Nviz_get_focus(nv_data *, float *, float *, float *);
-float Nviz_get_xyrange(nv_data *);
-int Nviz_get_zrange(nv_data *, float *, float *);
-float Nviz_get_longdim(nv_data *);
-
-/* render.c */
-struct render_window *Nviz_new_render_window();
-void Nviz_init_render_window(struct render_window *);
-void Nviz_destroy_render_window(struct render_window *);
-int Nviz_create_render_window(struct render_window *, void *, int, int);
-int Nviz_make_current_render_window(const struct render_window *);
+#include <grass/defs/nviz.h>
 
 #endif /* GRASS_NVIZ_H */

+ 163 - 6
include/gstypes.h

@@ -1,5 +1,5 @@
 /*!
-  \file include/gstypes.c
+  \file include/ogsf.c
 
   \brief OGSF header file (structures)
 
@@ -13,11 +13,10 @@
   (C) 2011 by the GRASS Development Team
 */
 
-#ifndef _GSTYPES_H
-#define _GSTYPES_H
+#ifndef GRASS_OGSF_H
+#define GRASS_OGSF_H
 
 #include <grass/config.h>
-#include <grass/gsurf.h>
 #include <grass/bitmap.h>
 #if defined(OPENGL_X11) || defined(OPENGL_WINDOWS)
 #include <GL/gl.h>
@@ -26,6 +25,112 @@
 #include <OpenGL/gl.h>
 #endif
 
+#include <grass/gis.h>
+
+#define GS_UNIT_SIZE 1000.
+
+#define BETWEEN(x, a, b) (((x) > (a) && (x) < (b)) || ((x) > (b) && (x) < (a)))
+#define GS_NEAR_EQUAL(x, y, ratio) ((x) == (y) || ((x) == 0.0? \
+            GS_BETWEEN((x), (y)+(y)*(ratio), (y)-(y)*(ratio)):\
+            GS_BETWEEN((y), (x)+(x)*(ratio), (x)-(x)*(ratio))))
+
+/* current maximums */
+#define MAX_SURFS      12
+#define MAX_VECTS      50
+#define MAX_SITES      50
+#define MAX_VOLS       12	/* should match MAX_VOL_FILES below ? */
+#define MAX_DSP        12
+#define MAX_ATTS        7
+#define MAX_LIGHTS      3
+#define MAX_CPLANES     6
+#define MAX_ISOSURFS   12
+#define MAX_SLICES     12
+
+/* for gvl_file.c */
+#define MAX_VOL_SLICES         4
+#define MAX_VOL_FILES        100
+
+/* surface display modes */
+#define DM_GOURAUD   0x00000100
+#define DM_FLAT      0x00000200	/* defined for symmetry */
+
+#define DM_FRINGE    0x00000010
+
+#define DM_WIRE      0x00000001
+#define DM_COL_WIRE  0x00000002
+#define DM_POLY      0x00000004
+#define DM_WIRE_POLY 0x00000008
+
+#define DM_GRID_WIRE 0x00000400
+#define DM_GRID_SURF 0x00000800
+
+#define WC_COLOR_ATT 0xFF000000
+
+#define IFLAG unsigned int
+
+/* surface attribute ***descriptors***  */
+#define ATT_NORM      0		/* library use only */
+#define ATT_TOPO      1
+#define ATT_COLOR     2
+#define ATT_MASK      3
+#define ATT_TRANSP    4
+#define ATT_SHINE     5
+#define ATT_EMIT      6
+#define LEGAL_ATT(a) (a >= 0 && a < MAX_ATTS)
+
+/* surface attribute **sources**  */
+#define NOTSET_ATT   0
+#define MAP_ATT      1
+#define CONST_ATT    2
+#define FUNC_ATT     3
+#define LEGAL_SRC(s) (s==NOTSET_ATT||s==MAP_ATT||s==CONST_ATT||s==FUNC_ATT)
+
+/* site markers */
+#define ST_X          1
+#define ST_BOX        2
+#define ST_SPHERE     3
+#define ST_CUBE       4
+#define ST_DIAMOND    5
+#define ST_DEC_TREE   6
+#define ST_CON_TREE   7
+#define ST_ASTER      8
+#define ST_GYRO       9
+#define ST_HISTOGRAM  10
+
+/* Buffer modes */
+#define GSD_FRONT 1
+#define GSD_BACK  2
+#define GSD_BOTH  3
+
+/* fence colormodes */
+#define FC_OFF           0
+#define FC_ABOVE         1
+#define FC_BELOW         2
+#define FC_BLEND         3
+#define FC_GREY          4
+
+/* legend types */
+#define LT_DISCRETE      0x00000100
+#define LT_CONTINUOUS    0x00000200
+
+#define LT_LIST          0x00000010
+/* list automatically discrete */
+
+#define LT_RANGE_LOWSET  0x00000001
+#define LT_RANGE_HISET   0x00000002
+#define LT_RANGE_LOW_HI  0x00000003
+#define LT_INVERTED      0x00000008
+
+#define LT_SHOW_VALS     0x00001000
+#define LT_SHOW_LABELS   0x00002000
+
+/* types of volume files */
+#define VOL_FTYPE_RASTER3D        0
+
+/* types of volume values */
+#define VOL_DTYPE_FLOAT     0
+#define VOL_DTYPE_DOUBLE    1
+
 /*#define TRACE_FUNCS */
 /*#define DEBUG */
 
@@ -392,7 +497,59 @@ typedef struct
 extern void (*Cxl_func) ();
 extern void (*Swap_func) ();
 
+/* Key frames */
+/* these have to be 1 << KF_id_index */
+
+#define KF_FROMX_MASK	0x00000001
+#define KF_FROMY_MASK	0x00000002
+#define KF_FROMZ_MASK	0x00000004
+#define KF_FROM_MASK	0x00000007
+
+#define KF_DIRX_MASK	0x00000008
+#define KF_DIRY_MASK	0x00000010
+#define KF_DIRZ_MASK	0x00000020
+#define KF_DIR_MASK	0x00000038
+
+#define KF_FOV_MASK	0x00000040
+#define KF_TWIST_MASK	0x00000080
+
+#define KF_ALL_MASK	0x000000FF
+
+#define KF_NUMFIELDS 8
+
+#define KF_LINEAR 111
+#define KF_SPLINE 222
+#define KF_LEGAL_MODE(m) (m == KF_LINEAR || m == KF_SPLINE)
+
+#define KF_FROMX 0
+#define KF_FROMY 1
+#define KF_FROMZ 2
+#define KF_DIRX 3
+#define KF_DIRY 4
+#define KF_DIRZ 5
+#define KF_FOV 6
+#define KF_TWIST 7
+
+#define FM_VECT 0x00000001
+#define FM_SITE 0x00000002
+#define FM_PATH 0x00000004
+#define FM_VOL  0x00000008
+#define FM_LABEL 0x00000010
+
+typedef struct view_node
+{
+    float fields[KF_NUMFIELDS];
+} Viewnode;
+
+typedef struct key_node
+{
+    float pos, fields[KF_NUMFIELDS];
+    int look_ahead;
+    unsigned long fieldmask;
+    struct key_node *next, *prior;
+} Keylist;
+
 /* Bring all the function prototypes */
-#include "ogsf_proto.h"
+#include <grass/defs/ogsf.h>
 
-#endif /* _GSTYPES_H */
+#endif /* GRASS_OGSF_H */

+ 4 - 67
include/ortholib.h

@@ -1,69 +1,6 @@
-/* from imagery/libes */
-/* ask_camera.c */
-int I_ask_camera_old(char *, char *);
-int I_ask_camera_new(char *, char *);
-int I_ask_camera_any(char *, char *);
+#ifndef GRASS_ORTHO_H
+#define GRASS_ORTHO_H
 
-/* ask_initial.c */
-int I_ask_camera_old(char *, char *);
-int I_ask_camera_new(char *, char *);
-int I_ask_camera_any(char *, char *);
+#include <grass/defs/ortholib.h>
 
-/* cam.c */
-FILE *I_fopen_group_camera_new(char *);
-FILE *I_fopen_group_camera_old(char *);
-
-/* camera.c */
-int I_put_group_camera(char *, char *);
-int I_get_group_camera(char *, char *);
-
-/* elev.c */
-int I_put_group_elev(char *, char *, char *, char *, char *, char *, char *);
-int I_get_group_elev(char *, char *, char *, char *, char *, char *, char *);
-
-/* find_camera.c */
-int I_find_camera(char *);
-int I_find_camera_file(char *, char *);
-
-/* find_init.c */
-int I_find_initial(char *);
-
-/* fopen_camera.c */
-FILE *I_fopen_cam_file_new(char *);
-FILE *I_fopen_cam_file_append(char *);
-FILE *I_fopen_cam_file_old(char *);
-int I_georef(double, double, double *, double *, double[3], double[3]);
-
-/* group_elev.c */
-FILE *I_fopen_group_elev_new(char *);
-FILE *I_fopen_group_elev_old(char *);
-int I_find_group_elev_file(char *);
-
-/* init.c */
-FILE *I_fopen_group_init_new(char *);
-FILE *I_fopen_group_init_old(char *);
-
-/* initial.c */
-int I_get_camera(char *);
-int I_put_camera(char *);
-int I_put_group_camera(char *, char *);
-int I_get_group_camera(char *, char *);
-
-/* ls_cameras.c */
-int I_list_cameras(int);
-
-/* ls_elev.c */
-int I_list_elev(int);
-
-/* open_camera.c */
-int I_open_cam_file_new(char *, char *);
-int I_open_cam_file_old(char *, char *);
-
-/* title_camera.c */
-int I_get_cam_title(char *, char *, int);
-int I_put_camera_title(char *, char *);
-
-/* vask_block.c */
-int I_vask_block_new(char **, char *, char *);
-int I_vask_block_old(char **, char *, char *);
-int I_vask_subblock_new(char **, char *, char *, int, char *);
+#endif

+ 1 - 1
include/raster.h

@@ -235,6 +235,6 @@ typedef RGBA_Color RGB_Color;
 #define RGBA_COLOR_NONE         0
 
 /*** prototypes ***/
-#include <grass/rasterdefs.h>
+#include <grass/defs/raster.h>
 
 #endif /* GRASS_RASTER_H */

+ 1 - 1
include/raster3d.h

@@ -257,6 +257,6 @@ typedef int read_fn(int, void *, void *);
 
 /*============================== Prototypes ================================*/
 
-#include <grass/raster3ddefs.h>
+#include <grass/defs/raster3d.h>
 
 #endif /* #ifndef GRASS_RASTER3D_H */

+ 5 - 13
include/rbtree.h

@@ -60,6 +60,9 @@
  * 
  *************************************************************/
 
+#ifndef GRASS_RBTREE_H
+#define GRASS_RBTREE_H
+
 #include <stddef.h>
 
 /* maximum RB Tree height */
@@ -96,17 +99,6 @@ struct RB_TRAV
     int first;                      /* little helper flag */
 };
 
-/* tree functions */
-struct RB_TREE *rbtree_create(rb_compare_fn *, size_t);
-void rbtree_destroy(struct RB_TREE *);
-int rbtree_insert(struct RB_TREE *, void *);
-int rbtree_remove(struct RB_TREE *, const void *);
-void *rbtree_find(struct RB_TREE *, const void *);
-
-/* tree traversal functions */
-int rbtree_init_trav(struct RB_TRAV *, struct RB_TREE *);
-void* rbtree_traverse(struct RB_TRAV *);
-void *rbtree_traverse_start(struct RB_TRAV *, const void *);
+#include <grass/defs/rbtree.h>
 
-/* debug tree from given node downwards */
-int rbtree_debug(struct RB_TREE *, struct RB_NODE *);
+#endif

+ 0 - 18
include/readsites.h

@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <math.h>
-#include <grass/gis.h>
-#include <grass/site.h>
-
-/*---------------------typedefs*/
-
-struct zstruct
-{
-    double x, y, z;
-};
-typedef struct zstruct Z;
-
-/*--------------------functions */
-int G_readsites(FILE *, int, int, int, struct Cell_head *, Z **);

+ 1 - 8
include/rowio.h

@@ -20,13 +20,6 @@ typedef struct
     } *rcb;
 } ROWIO;
 
-int Rowio_fileno(const ROWIO *);
-void Rowio_forget(ROWIO *, int);
-void *Rowio_get(ROWIO *, int);
-void Rowio_flush(ROWIO *);
-int Rowio_put(ROWIO *, const void *, int);
-void Rowio_release(ROWIO *);
-int Rowio_setup(ROWIO *, int, int, int, int (*)(int, void *, int, int),
-		int (*)(int, const void *, int, int));
+#include <grass/defs/rowio.h>
 
 #endif

+ 0 - 3
include/search.h

@@ -1,3 +0,0 @@
-#ifndef _SEARCH_H
-#define _SEARCH_H
-#endif

+ 1 - 14
include/segment.h

@@ -57,19 +57,6 @@ typedef struct
     int offset;			/* offset of data past header */
 } SEGMENT;
 
-int segment_address(const SEGMENT *, int, int, int *, int *);
-int segment_flush(SEGMENT *);
-int segment_format(int, int, int, int, int, int);
-int segment_format_nofill(int, int, int, int, int, int);
-int segment_get(SEGMENT *, void *, int, int);
-int segment_get_row(const SEGMENT *, void *, int);
-int segment_init(SEGMENT *, int, int);
-int segment_pagein(SEGMENT *, int);
-int segment_pageout(SEGMENT *, int);
-int segment_put(SEGMENT *, const void *, int, int);
-int segment_put_row(const SEGMENT *, const void *, int);
-int segment_release(SEGMENT *);
-int segment_seek(const SEGMENT *, int, int);
-int segment_setup(SEGMENT *);
+#include <grass/defs/segment.h>
 
 #endif /* GRASS_SEGMENT_H */

+ 10 - 31
include/site.h

@@ -1,11 +1,8 @@
-/*-
- * easting|northing|[z|[d4|]...][#category] [ [@attr_text OR %flt] ... ]
- *
- * to allow multidimensions (everything preceding the last '|') and any
- * number of text or numeric attribute fields.
- */
+#ifndef GRASS_SITE_H
+#define GRASS_SITE_H
 
 #include <grass/raster.h>
+#include <grass/vector.h>
 
 #define MAX_SITE_STRING 1024
 #define MAX_SITE_LEN 4096
@@ -76,30 +73,12 @@ typedef struct
 } SITE_XYZ;
 
 
-/* Allocate 'num' SITE_XYZ structs. Returns NULL on failure */
-SITE_XYZ *G_alloc_site_xyz(size_t);
-
-
-/* Free the array of SITE_XYZ struct */
-void G_free_site_xyz(SITE_XYZ *);
-
+struct zstruct
+{
+    double x, y, z;
+};
+typedef struct zstruct Z;
 
-/* G_readsites_xyz: Reads a sites file converting to a site struct of xyz
- * values and the cat value.  The Z value can come from one of the
- * n-dimensions, a double attribute, or a string attribute converted to a
- * double with strtod().  The 'size' must not be greater than the number
- * of elements in the SITE_XYZ array, or bad things will happen. The number 
- * of records read is returned or EOF on end of file. NOTE: EOF won't be
- * returned unless no records are read and the EOF bit is set. It's safe
- * to assume that if the number of records read is less than the size of
- * the array, that there aren't any more records.
- */
-int G_readsites_xyz(FILE *,	/* The FILE stream to the sites file               */
-		    int,	/* Attribute type: SITE_COL_DIM, etc...            */
-		    int,	/* The field index (1 based) for the attribute     */
-		    int,	/* Size of the array                               */
-		    struct Cell_head *,	/* Respect region if not NULL */
-		    SITE_XYZ * xyz	/* The site array of size 'size'                   */
-    );
+#include <grass/defs/site.h>
 
-#include <grass/P_site.h>
+#endif

+ 2 - 127
include/sitelib.h

@@ -1,136 +1,11 @@
 #ifndef GRASS_SITELIB_H
 #define GRASS_SITELIB_H
+
 /* From src/sites/Lib */
 #ifndef GRASS_SITE_H
 #include <grass/site.h>
 #endif
-/* announce.c */
-int announce(char *);
-
-/* ask_quad.c */
-int ask_quad(int *);
-
-/* center.c */
-int center(char *, int);
-
-/* chain.c */
-int chain(char *);
-
-/* copy_sites.c */
-int copy_sites(SITE_LIST *, SITE_LIST *, int);
-
-/* copyfile.c */
-int copyfile(char *, char *);
-
-/* count_site.c */
-int count_sites(SITE_LIST *, int);
-
-/* counter.c */
-int counter_reset(char *, int);
-int counter(int);
-
-/* die.c */
-int die(char *);
-
-/* eq_sites.c */
-int equal_sites(SITE_LIST *, SITE_LIST *);
-
-/* execute.c */
-int execute(char *);
-
-/* hitreturn.c */
-int hitreturn(void);
-
-/* maximum.c */
-int maximum(register int *, int);
-
-/* memcopy.c */
-int memcopy(char *, char *, int);
-
-#ifdef MENU
-/* menu_hndlr.c */
-int menu_handler(MENU, char *);
-#endif
-
-/* meta_reprt.c */
-int meta_report(char *, char *, char *, int, int);
-
-/* parse.c */
-int parse(char *, char *[], int, char *);
-
-/* read_sites.c */
-int read_site_list(SITE_LIST *, FILE *);
-int get_site_list(SITE_LIST *, char *);
-
-/* region.c */
-char *format_res(double, char *, int);
-char *format_east(double, char *, int);
-char *format_north(double, char *, int);
-int scan_north(char *, double *);
-int scan_east(char *, double *);
-int scan_res(char *, double *);
-
-#ifdef REPORT
-/* report.c */
-REPORT *report_open(char *);
-REPORT *report_open_ref(char *, REPORT *);
-int report_close(REPORT *);
-int report_read(REPORT *);
-int report_record(REPORT *, char *);
-int report_read_record(REPORT *, char *);
-int report_scan(REPORT *);
-int report_matrix(REPORT *);
-
-/* rprt_finds.c */
-rprt_finds.c:int report_find_layer(REPORT *, int);
-rprt_finds.c:int report_find_cat(REPORT *, int, int);
-rprt_finds.c:int report_find_point(REPORT *, int);
-rprt_finds.c:int report_find_data(REPORT *, int, int);
-
-/* rprt_seeks.c */
-rprt_seeks.c:int report_seek_layers(REPORT *);
-rprt_seeks.c:int report_seek_points(REPORT *);
-rprt_seeks.c:int report_seek_cats(REPORT *);
-rprt_seeks.c:int report_seek_data(REPORT *);
-#endif
-
-/* rpt_screen.c */
-int new_report_screen(void);
-
-/* scan_int.c */
-int scan_int(char *, int *);
-
-/* scn_double.c */
-int scan_double(char *, double *);
-
-/* scopy.c */
-int scopy(char *, char *, int);
-
-/* site.c */
-int add_site(SITE_LIST *, double, double, char *);
-int initialize_site_list(SITE_LIST *);
-int rewind_site_list(SITE_LIST *);
-int next_site(SITE_LIST *, double *, double *, char **);
-int free_site_list(SITE_LIST *);
-
-/* sort_int.c */
-int sort_int(int[], int, int);
-
-/* trace.c */
-int trace(int);
-
-/* ut_to_cell.c */
-float northing_to_row(double, struct Cell_head *);
-float easting_to_col(double, struct Cell_head *);
-
-/* within_wnd.c */
-int within_window(double, double, struct Cell_head *);
-
-/* write_site.c */
-int put_site_list(SITE_LIST *, char *, int, int);
-int write_site_list(SITE_LIST *, FILE *, int, int);
 
-/* yes.c */
-int yes(char *);
+#include <grass/defs/sitelib.h>
 
 #endif

+ 1 - 5
include/spawn.h

@@ -1,4 +1,3 @@
-
 #ifndef GRASS_SPAWN_H
 #define GRASS_SPAWN_H
 
@@ -41,9 +40,6 @@ enum signal_type
     SST_CHILD,
 };
 
-extern int G_spawn(const char *command, ...);
-extern int G_vspawn_ex(const char *command, const char **args);
-extern int G_spawn_ex(const char *command, ...);
-extern int G_wait(int i_pid);
+#include <grass/defs/spawn.h>
 
 #endif

+ 0 - 0
include/sqlp.h


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است