Kaynağa Gözat

Remove unused functions
Declare functions "static" where appropriate


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33128 15284696-431f-4ddb-bdfa-cd5b030d7da7

Glynn Clements 16 yıl önce
ebeveyn
işleme
591fd1f79a
13 değiştirilmiş dosya ile 19 ekleme ve 2142 silme
  1. 0 16
      include/gisdefs.h
  2. 3 3
      lib/driver/Color.c
  3. 0 4
      lib/driver/driver.h
  4. 13 12
      lib/gis/cats.c
  5. 3 2
      lib/gis/closecell.c
  6. 0 36
      lib/gis/dig_title.c
  7. 0 28
      lib/gis/env.c
  8. 0 43
      lib/gis/fork.c
  9. 0 53
      lib/gis/gishelp.c
  10. 0 11
      lib/gis/list.c
  11. 0 48
      lib/gis/unctrl.c
  12. 0 610
      swig/perl/gis.h
  13. 0 1276
      swig/perl/gisdefs.h

+ 0 - 16
include/gisdefs.h

@@ -111,8 +111,6 @@ int G_read_cats(const char *, const char *, struct Categories *);
 int G_read_raster_cats(const char *, const char *, struct Categories *);
 int G_read_vector_cats(const char *, const char *, struct Categories *);
 CELL G_number_of_cats(const char *, const char *);
-CELL G__read_cats(const char *, const char *, const char *,
-		  struct Categories *, int);
 char *G_get_cats_title(const struct Categories *);
 char *G_get_raster_cats_title(const struct Categories *);
 char *G_get_cat(CELL, struct Categories *);
@@ -143,7 +141,6 @@ int G_set_raster_cat(const void *, const void *, const char *, struct Categories
 int G_write_cats(const char *, struct Categories *);
 int G_write_raster_cats(const char *, struct Categories *);
 int G_write_vector_cats(const char *, struct Categories *);
-int G__write_cats(const char *, const char *, struct Categories *);
 char *G_get_ith_d_raster_cat(const struct Categories *, int, DCELL *,
 			     DCELL *);
 char *G_get_ith_f_raster_cat(const struct Categories *, int, void *, void *);
@@ -192,7 +189,6 @@ int G_clicker(void);
 /* closecell.c */
 int G_close_cell(int);
 int G_unopen_cell(int);
-int G__write_fp_format(int);
 
 /* color_compat.c */
 int G_make_ryg_colors(struct Colors *, CELL, CELL);
@@ -425,8 +421,6 @@ char *G__env_name(int);
 int G__read_env(void);
 void G_set_gisrc_mode(int);
 int G_get_gisrc_mode(void);
-int G__set_gisrc_file(const char *);
-char *G__get_gisrc_file(void);
 int G__create_alt_env(void);
 int G__switch_env(void);
 
@@ -475,9 +469,6 @@ int G_zlib_write(int, const unsigned char *, int);
 int G_zlib_read(int, int, unsigned char *, int);
 int G_zlib_write_noCompress(int, const unsigned char *, int);
 
-/* fork.c */
-int G_fork(void);
-
 /* format.c */
 int G__check_format(int);
 int G__read_row_ptrs(int);
@@ -586,9 +577,6 @@ char *G_gisbase(void);
 /* gisdbase.c */
 char *G_gisdbase(void);
 
-/* gishelp.c */
-int G_gishelp(const char *, const char *);
-
 /* gisinit.c */
 int G__gisinit(const char *, const char *);
 int G__no_gisinit(const char *);
@@ -690,7 +678,6 @@ double G_distance2_point_to_line(double, double, double, double, double,
 				 double);
 
 /* list.c */
-int G_set_list_hit_return(int);
 int G_list_element(const char *, const char *, const char *,
 		   int (*)(const char *, const char *, const char *));
 char **G_list(int, const char *, const char *, const char *);
@@ -1150,9 +1137,6 @@ int G_free_tokens(char **);
 /* trim_dec.c */
 int G_trim_decimal(char *);
 
-/* unctrl.c */
-char *G_unctrl(int);
-
 /* verbose.c */
 int G_verbose(void);
 int G_verbose_min(void);

+ 3 - 3
lib/driver/Color.c

@@ -2,14 +2,14 @@
 #include "driver.h"
 #include "driverlib.h"
 
-int DRV_lookup_color(int r, int g, int b)
+static int lookup_color(int r, int g, int b)
 {
     if (driver->lookup_color)
 	return (*driver->lookup_color) (r, g, b);
     return 0;
 }
 
-void DRV_color(int number)
+static void color(int number)
 {
     if (driver->color)
 	(*driver->color) (number);
@@ -18,7 +18,7 @@ void DRV_color(int number)
 
 void COM_Color_RGB(unsigned char r, unsigned char g, unsigned char b)
 {
-    DRV_color(DRV_lookup_color(r, g, b));
+    color(lookup_color(r, g, b));
 }
 
 void COM_Standard_color(int number)

+ 0 - 4
lib/driver/driver.h

@@ -134,10 +134,6 @@ extern void COM_Text_rotation(double);
 
 /* Driver Operations */
 
-/* Color.c */
-extern int DRV_lookup_color(int, int, int);
-extern void DRV_color(int);
-
 /* Draw.c */
 extern void DRV_draw_bitmap(int, int, int, const unsigned char *);
 extern void DRV_draw_line(double, double, double, double);

+ 13 - 12
lib/gis/cats.c

@@ -329,6 +329,10 @@ static int get_cond(char **, char *, DCELL);
 static int get_fmt(char **, char *, int *);
 static int cmp(const void *, const void *);
 
+static int write_cats(const char *element, const char *name, struct Categories *cats);
+static CELL read_cats(const char *element,
+		      const char *name,
+		      const char *mapset, struct Categories * pcats, int full);
 
 /*!
  * \brief read raster category file
@@ -367,7 +371,7 @@ int G_read_raster_cats(const char *name,
 {
     char *type;
 
-    switch (G__read_cats("cats", name, mapset, pcats, 1)) {
+    switch (read_cats("cats", name, mapset, pcats, 1)) {
     case -2:
 	type = "missing";
 	break;
@@ -403,7 +407,7 @@ int G_read_vector_cats(const char *name,
 {
     char *type;
 
-    switch (G__read_cats("dig_cats", name, mapset, pcats, 1)) {
+    switch (read_cats("dig_cats", name, mapset, pcats, 1)) {
     case -2:
 	type = "missing";
 	break;
@@ -433,9 +437,9 @@ CELL G_number_of_cats(const char *name, const char *mapset)
     return max;
 }
 
-CELL G__read_cats(const char *element,
-		  const char *name,
-		  const char *mapset, struct Categories * pcats, int full)
+static CELL read_cats(const char *element,
+		      const char *name,
+		      const char *mapset, struct Categories * pcats, int full)
 {
     FILE *fd;
     char buff[1024];
@@ -1180,7 +1184,7 @@ int G_set_raster_cat(const void *rast1, const void *rast2,
 
 int G_write_cats(const char *name, struct Categories *cats)
 {
-    return G__write_cats("cats", name, cats);
+    return write_cats("cats", name, cats);
 }
 
 
@@ -1196,7 +1200,7 @@ int G_write_cats(const char *name, struct Categories *cats)
 
 int G_write_raster_cats(const char *name, struct Categories *cats)
 {
-    return G__write_cats("cats", name, cats);
+    return write_cats("cats", name, cats);
 }
 
 
@@ -1216,10 +1220,10 @@ int G_write_raster_cats(const char *name, struct Categories *cats)
 
 int G_write_vector_cats(const char *name, struct Categories *cats)
 {
-    return G__write_cats("dig_cats", name, cats);
+    return write_cats("dig_cats", name, cats);
 }
 
-int G__write_cats(const char *element, const char *name, struct Categories *cats)
+static int write_cats(const char *element, const char *name, struct Categories *cats)
 {
     FILE *fd;
     int i, fp_map;
@@ -1227,7 +1231,6 @@ int G__write_cats(const char *element, const char *name, struct Categories *cats
     DCELL val1, val2;
     char str1[100], str2[100];
 
-    /* DEBUG fprintf(stderr,"G__write_cats(*element = '%s', name = '%s', cats = %p\n",element,name,cats); */
     if (!(fd = G_fopen_new(element, name)))
 	return -1;
 
@@ -1247,7 +1250,6 @@ int G__write_cats(const char *element, const char *name, struct Categories *cats
 	fp_map = 0;
     else
 	fp_map = G_raster_map_is_fp(name, G_mapset());
-    /* DEBUG fprintf(stderr,"G__write_cats(): fp_map = %d\n",fp_map); */
     if (!fp_map)
 	G_sort_cats(cats);
 
@@ -1272,7 +1274,6 @@ int G__write_cats(const char *element, const char *name, struct Categories *cats
 	}
     }
     fclose(fd);
-    /* DEBUG fprintf(stderr,"G__write_cats(): done\n"); */
     return (1);
 }
 

+ 3 - 2
lib/gis/closecell.c

@@ -43,6 +43,7 @@ static int close_old(int);
 static int close_new(int, int);
 static char CELL_DIR[100];
 
+static int write_fp_format(int fd);
 
 /*!
  * \brief close a raster map
@@ -248,7 +249,7 @@ static int close_new(int fd, int ok)
 	if (fcb->map_type != CELL_TYPE) {	/* floating point map */
 	    int cell_fd;
 
-	    if (G__write_fp_format(fd) != 0) {
+	    if (write_fp_format(fd) != 0) {
 		G_warning(_("Error writing floating point format file for map %s"),
 			  fcb->name);
 		stat = -1;
@@ -397,7 +398,7 @@ static int close_new(int fd, int ok)
 }
 
 /* returns 0 on success, 1 on failure */
-int G__write_fp_format(int fd)
+static int write_fp_format(int fd)
 {
     struct fileinfo *fcb = &G__.fileinfo[fd];
     struct Key_Value *format_kv;

+ 0 - 36
lib/gis/dig_title.c

@@ -1,36 +0,0 @@
-
-/**************************************************************
- * char *G_get_cell_title (name, mapset)
- *   char *name        name of map file
- *   char *mapset      mapset containing name
- *
- *   returns pointer to string containing cell title. (from cats file)
- *************************************************************/
-
-#include <stdio.h>
-#include <grass/gis.h>
-
-char *G_get_dig_title(const char *name, const char *mapset)
-{
-    FILE *fd;
-    int stat = -1;
-    char title[100];
-
-    fd = G_fopen_old("dig_cats", name, mapset);
-    if (fd) {
-	stat = 1;
-	if (!fgets(title, sizeof title, fd))	/* skip number of cats */
-	    stat = -1;
-	else if (!G_getl(title, sizeof title, fd))	/* read title */
-	    stat = -1;
-
-	fclose(fd);
-    }
-
-    if (stat < 0)
-	*title = 0;
-    else
-	G_strip(title);
-
-    return G_store(title);
-}

+ 0 - 28
lib/gis/env.c

@@ -500,34 +500,6 @@ int G__read_env(void)
 }
 
 /**
-   \brief Sets filename for gisrc
-
-   \param name filename
-
-   \return 0
-*/
-int G__set_gisrc_file(const char *name)
-{
-    gisrc = NULL;
-    if (name && *name)
-	gisrc = G_store(name);
-
-    return 0;
-}
-
-/**
-   \brief Get gisrc filename
-
-   \param
-   
-   \return char pointer to filename
-*/
-char *G__get_gisrc_file(void)
-{
-    return gisrc;
-}
-
-/**
    \brief Set up alternative environment variables
 
    \param

+ 0 - 43
lib/gis/fork.c

@@ -1,43 +0,0 @@
-#include <grass/config.h>
-
-#include <unistd.h>
-#include <grass/gis.h>
-
-/*************************************************************
- * G_fork() 
- *
- * Issue a system fork() call and protect the child from all
- * signals (which it does by changing the process group for the child)
- *
- * returns:
- *     -1 fork failed.
- *      0 child
- *     >0 parent
- ************************************************************/
-
-int G_fork(void)
-{
-#ifdef __MINGW32__
-    return -1;
-#else /* __MINGW32__ */
-    int pid;
-
-    pid = fork();
-
-    /*
-     * change the process group for the child (pid == 0)
-     * note: we use the BSD calling sequence, since
-     * it will work ok for ATT call which has no arguments
-     */
-    if (pid == 0)
-#ifdef SETPGRP_VOID
-	setpgrp();
-#else
-	setpgrp(0, getpid());
-#endif
-
-    return pid;
-
-#endif /* __MINGW32__ */
-
-}

+ 0 - 53
lib/gis/gishelp.c

@@ -1,53 +0,0 @@
-/*
- ****************************************************************************
- *
- * MODULE:       GRASS 5 gis library, gishelp.c
- * AUTHOR(S):    unknown
- * PURPOSE:      Print help information
- * COPYRIGHT:    (C) 2000 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.
- *
- *****************************************************************************/
-
-/*
- **********************************************************************
- *
- *  G_gishelp(helpfile, request)
- *      char *helpfile           help directory where "request" is found
- *      char *request            help file desired
- *
- *   Prints a helpfile to the screen.  Helpfiles are stored in directories
- *   associated with different GRID programs.  A given file will be
- *   found in   $GISBASE/txt/"helpfile"/"request".
- *
- **********************************************************************/
-
-#include <grass/gis.h>
-#include <grass/glocale.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <grass/spawn.h>
-#define GEN_HELP	"gen_help"
-
-int G_gishelp(const char *helpfile, const char *request)
-{
-    char file[1024];
-
-    if (request == NULL)
-	request = GEN_HELP;
-
-    sprintf(file, "%s/txt/%s/%s", G_getenv("GISBASE"), helpfile, request);
-
-    if (!access(file, 04)) {
-	fprintf(stderr, _("one moment...\n"));
-	G_spawn(getenv("GRASS_PAGER"), getenv("GRASS_PAGER"), file, NULL);
-    }
-    else {
-	fprintf(stderr, _("No help available for command [%s]\n"), request);
-    }
-
-    return 0;
-}

+ 0 - 11
lib/gis/list.c

@@ -24,17 +24,10 @@
 #include <grass/glocale.h>
 
 static int broken_pipe;
-static int hit_return = 0;
 static int list_element(FILE *, const char *, const char *, const char *,
 			int (*)(const char *, const char *, const char *));
 static void sigpipe_catch(int);
 
-int G_set_list_hit_return(int flag)
-{
-    hit_return = flag;
-    return 0;
-}
-
 /**
    \brief General purpose list function.
 
@@ -130,10 +123,6 @@ int G_list_element(const char *element,
 #ifdef SIGPIPE
     signal(SIGPIPE, sigpipe);
 #endif
-    if (hit_return && isatty(1)) {
-	fprintf(stderr, _("hit RETURN to continue -->"));
-	while (getchar() != '\n') ;
-    }
 
     return 0;
 }

+ 0 - 48
lib/gis/unctrl.c

@@ -1,48 +0,0 @@
-
-/**
- * \file unctrl.c
- *
- * \brief GIS Library - Handles control characters.
- *
- * (C) 2001-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.
- *
- * \author GRASS GIS Development Team
- *
- * \date 1999-2006
- */
-
-#include <stdio.h>
-#include <grass/gis.h>
-
-
-/**
- * \brief Printable version of control character.
- *
- * This routine returns a pointer to a string which contains an
- * English-like representation for the character <b>c</b>. This is useful for
- * nonprinting characters, such as control characters. Control characters are
- * represented by ctrl-C, e.g., control A is represented by ctrl-A. 0177 is
- * represented by DEL/RUB. Normal characters remain unchanged.
- *
- * \param[in] int c
- * \return char * pointer to string containing English-like representation for character <b>c</b>
- */
-
-char *G_unctrl(int c)
-{
-    static char buf[20];
-
-    if (c < ' ')
-	sprintf(buf, "ctrl-%c", c | 0100);
-    else if (c < 0177)
-	sprintf(buf, "%c", c);
-    else if (c == 0177)
-	sprintf(buf, "DEL/RUB");
-    else
-	sprintf(buf, "Mctrl-%c", (c & 77) | 0100);
-
-    return buf;
-}

+ 0 - 610
swig/perl/gis.h

@@ -1,610 +0,0 @@
-/*
- *****************************************************************************
- *
- * MODULE:      Grass Include Files
- * AUTHOR(S):   Original author unknown - probably CERL
- *              Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th
- * PURPOSE:     This file contains definitions of variables and data types
- *              for use with most, if not all, Grass programs. This file is
- *              usually included in every Grass program.
- * COPYRIGHT:    (C) 2000 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 GRASS_GIS_H
-#define GRASS_GIS_H
-
-/*============================= Include Files ==============================*/
-
-/* System include files */
-#include <stdio.h>
-#include <stdarg.h>
-
-/* Grass and local include files */
-#include <grass/config.h>
-#include <grass/datetime.h>
-
-/*=========================== Constants/Defines ============================*/
-
-#if !defined __GNUC__ || __GNUC__ < 2
-#undef __attribute__
-#define __attribute__(x)
-#endif
-
-static const char *GRASS_copyright __attribute__ ((unused))
-    = "GRASS GNU GPL licensed Software";
-
-/* Define TRUE and FALSE for boolean comparisons */
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#define MAXEDLINES  50
-#define RECORD_LEN  80
-#define NEWLINE     '\n'
-#define RECLASS_TABLE 1
-#define RECLASS_RULES 2
-#define RECLASS_SCALE 3
-
-#define METERS    1
-#define FEET      2
-#define DEGREES   3
-
-#define CELL_TYPE 0
-#define FCELL_TYPE 1
-#define DCELL_TYPE 2
-
-#define PROJECTION_XY  0
-#define PROJECTION_UTM 1
-#define PROJECTION_SP  2
-#define PROJECTION_LL  3
-#define PROJECTION_OTHER  99
-
-#define PROJECTION_FILE "PROJ_INFO"
-#define UNIT_FILE "PROJ_UNITS"
-
-/* define PI and friends */
-#undef M_PI
-#define M_PI    3.14159265358979323846	/* pi */
-
-#undef M_PI_2
-#define M_PI_2  1.57079632679489661923	/* pi/2 */
-
-#undef M_PI_4
-#define M_PI_4  0.78539816339744830962	/* pi/4 */
-
-/* epsilon (IEEE: 2.220446e-16) */
-#define GRASS_EPSILON 1.0e-15
-
-/* Location of envariment variables */
-#define G_VAR_GISRC    0
-#define G_VAR_MAPSET   1
-
-/* Where to find/store variables */
-#define G_GISRC_MODE_FILE     0	/* files */
-#define G_GISRC_MODE_MEMORY   1	/* memory only */
-
-/* for G_parser() */
-#define TYPE_INTEGER  1
-#define TYPE_DOUBLE   2
-#define TYPE_STRING   3
-#define YES           1
-#define NO            0
-#define GISPROMPT_COLOR "color,grass,color"
-
-/* File/directory name lengths */
-#define GNAME_MAX 256
-#define GMAPSET_MAX 256
-
-#define GPATH_MAX 4096
-
-/* Macros for type size independent integers                    */
-/* Use these for portability to ensure integers are truly 32bit */
-/* and are handled in a uniform manner                          */
-
-/* Convert integer to 4 bytes - little endian */
-#define serialize_int32_le(buf, x) do { \
-    (buf)[0] = ((x) >>  0) & 0xFF; \
-    (buf)[1] = ((x) >>  8) & 0xFF; \
-    (buf)[2] = ((x) >> 16) & 0xFF; \
-    (buf)[3] = ((x) >> 24) & 0xFF; \
-} while(0)
-
-/* Convert 4 bytes to an integer - little endian */
-#define deserialize_int32_le(buf) (((buf)[0] <<  0) | \
-                                   ((buf)[1] <<  8) | \
-                                   ((buf)[2] << 16) | \
-                                   ((buf)[3] << 24))
-
-/* Convert integer to 4 bytes - big endian */
-#define serialize_int32_be(buf, x) do { \
-    (buf)[0] = ((x) >> 24) & 0xFF; \
-    (buf)[1] = ((x) >> 16) & 0xFF; \
-    (buf)[2] = ((x) >>  8) & 0xFF; \
-    (buf)[3] = ((x) >>  0) & 0xFF; \
-} while(0)
-
-/* Convert 4 bytes to an integer - big endian */
-#define deserialize_int32_be(buf) (((buf)[0] << 24) | \
-                                   ((buf)[1] << 16) | \
-                                   ((buf)[2] <<  8) | \
-                                   ((buf)[3] <<  0))
-
-/* Cross-platform Directory Separator Character and null device stuff */
-#define GRASS_DIRSEP '/'
-#ifdef __MINGW32__
-#  define HOST_DIRSEP '\\'
-#  define G_DEV_NULL 'NUL:'
-#else
-#  define HOST_DIRSEP '/'
-#  define G_DEV_NULL '/dev/null'
-#endif
-
- /**/ typedef enum
-{
-    G_OPT_DB_WHERE,		/* SQL where conditions */
-    G_OPT_DB_COLUMN,		/* one attr column */
-    G_OPT_DB_COLUMNS,		/* one or more attr columns */
-
-    G_OPT_I_GROUP,		/* old input imagery group */
-    G_OPT_R_INPUT,		/* old input raster map */
-    G_OPT_R_INPUTS,		/* old input raster maps */
-    G_OPT_R_OUTPUT,		/* new output raster map */
-    G_OPT_R_MAP,		/* old input raster map */
-    G_OPT_R_MAPS,		/* old input rasters map */
-    G_OPT_R_BASE,		/* old input base raster map */
-    G_OPT_R_COVER,		/* old input cover raster map */
-    G_OPT_R_ELEV,		/* old input elevation raster map */
-    G_OPT_R_ELEVS,		/* old input elevation raster maps */
-
-    G_OPT_R3_INPUT,		/* old input raster3d map */
-    G_OPT_R3_INPUTS,		/* old input raster3d maps */
-    G_OPT_R3_OUTPUT,		/* new output raster3d map */
-
-    G_OPT_V_INPUT,		/* old input vector map */
-    G_OPT_V_INPUTS,		/* old input vector maps */
-    G_OPT_V_OUTPUT,		/* new output vector map */
-    G_OPT_V_MAP,		/* old input vector map */
-    G_OPT_V_TYPE,		/* primitive type */
-    G_OPT_V_FIELD,		/* field number */
-    G_OPT_V_CAT,		/* one category */
-    G_OPT_V_CATS,		/* more categories */
-
-    G_OPT_F_INPUT,		/* old input file */
-    G_OPT_F_OUTPUT,		/* new output file */
-    G_OPT_F_SEP,		/* data field separator */
-
-    G_OPT_C_FG,			/* foreground color */
-    G_OPT_C_BG			/* background color */
-} STD_OPT;
-
-/* Message format */
-#define G_INFO_FORMAT_STANDARD 0	/* GRASS_MESSAGE_FORMAT=standard or not defined */
-#define G_INFO_FORMAT_GUI      1	/* GRASS_MESSAGE_FORMAT=gui */
-#define G_INFO_FORMAT_SILENT   2	/* GRASS_MESSAGE_FORMAT=silent */
-
-/* Icon types */
-#define G_ICON_CROSS  0
-#define G_ICON_BOX    1
-#define G_ICON_ARROW  2
-
-/* default colors */
-#define DEFAULT_FG_COLOR "black"
-#define DEFAULT_BG_COLOR "white"
-
-/* for G_get_raster_sample(), INTERP_TYPE */
-#define UNKNOWN	  0
-#define NEAREST   1		/* nearest neighbor interpolation  */
-#define BILINEAR  2		/* bilinear interpolation          */
-#define CUBIC     3		/* cubic interpolation             */
-
-/* for raster maps */
-#define GR_FATAL_EXIT    0
-#define GR_FATAL_PRINT   1
-#define GR_FATAL_RETURN  2
-
-/* Element types */
-enum
-{				/* Dir */
-    G_ELEMENT_RASTER = 1,	/* cell */
-    G_ELEMENT_VECTOR = 2,	/* vector */
-    G_ELEMENT_GROUP = 3,	/* group */
-    G_ELEMENT_REGION = 4	/* window */
-};
-
-/*=========================== Typedefs/Structures ==========================*/
-
-typedef int CELL;
-typedef double DCELL;
-typedef float FCELL;
-extern CELL CELL_NODATA;
-
-typedef int RASTER_MAP_TYPE;
-
-/* for G_get_raster_sample() */
-typedef int INTERP_TYPE;
-
-struct Cell_head
-{
-    int format;			/* max numer of bytes per cell minus 1          */
-    int compressed;		/* 0 = uncompressed, 1 = compressed, -1 pre 3.0 */
-    int rows;			/* number of rows in the data 2D                */
-    int rows3;			/* number of rows in the data 3D                */
-    int cols;			/* number of columns in the data 2D             */
-    int cols3;			/* number of columns in the data 3D             */
-    int depths;			/* number of depths in data                     */
-    int proj;			/* Projection (see #defines above)              */
-    int zone;			/* Projection zone                              */
-    double ew_res;		/* East to West cell size 2D                    */
-    double ew_res3;		/* East to West cell size 3D                    */
-    double ns_res;		/* North to South cell size 2D                  */
-    double ns_res3;		/* North to South cell size 3D                  */
-    double tb_res;		/* Top to Bottom cell size                      */
-    double north;		/* coordinates of layer                         */
-    double south;
-    double east;
-    double west;
-    double top;
-    double bottom;
-};
-
-struct _Color_Rule_
-{
-    struct
-    {
-	DCELL value;
-	unsigned char red;
-	unsigned char grn;
-	unsigned char blu;
-    } low, high;
-
-    struct _Color_Rule_ *next;
-    struct _Color_Rule_ *prev;
-};
-
-struct _Color_Info_
-{
-    struct _Color_Rule_ *rules;
-    int n_rules;
-
-    struct
-    {
-	unsigned char *red;
-	unsigned char *grn;
-	unsigned char *blu;
-	unsigned char *set;
-	int nalloc;
-	int active;
-    } lookup;
-
-    struct
-    {
-	DCELL *vals;
-	/* pointers to color rules corresponding to the intervals btwn vals */
-	struct _Color_Rule_ **rules;
-	int nalloc;
-	int active;
-    } fp_lookup;
-
-    DCELL min, max;
-};
-
-struct Colors
-{
-    int version;		/* set by read_colors: -1=old,1=new */
-    DCELL shift;
-    int invert;
-    int is_float;		/* defined on floating point raster data? */
-    int null_set;		/* the colors for null are set? */
-    unsigned char null_red;
-    unsigned char null_grn;
-    unsigned char null_blu;
-    int undef_set;		/* the colors for cells not in range are set? */
-    unsigned char undef_red;
-    unsigned char undef_grn;
-    unsigned char undef_blu;
-    struct _Color_Info_ fixed;
-    struct _Color_Info_ modular;
-    DCELL cmin;
-    DCELL cmax;
-};
-
-
-typedef struct
-{
-    unsigned char r, g, b, a;	/* red, green, blue, and alpha */
-} RGBA_Color;
-
-typedef RGBA_Color RGB_Color;
-
-/* RGBA_Color alpha presets */
-#define RGBA_COLOR_OPAQUE     255
-#define RGBA_COLOR_TRANSPARENT  0
-#define RGBA_COLOR_NONE         0
-
-
-struct Reclass
-{
-    char *name;			/* name of raster map being reclassed    */
-    char *mapset;		/* mapset in which "name" is found      */
-    int type;			/* type of reclass                      */
-    int num;			/* size of reclass table                */
-    CELL min;			/* table min                            */
-    CELL max;			/* table max                            */
-    CELL *table;		/* reclass table                        */
-};
-
-struct FPReclass_table
-{
-    DCELL dLow;			/* domain low */
-    DCELL dHigh;		/* domain high */
-    DCELL rLow;			/* range low */
-    DCELL rHigh;		/* range high */
-};
-
-/* reclass structure from double to double used by r.recode to reclass */
-/* between types: int to double, float to int,... */
-struct FPReclass
-{
-    int defaultDRuleSet;	/* 1 if default domain rule set */
-    int defaultRRuleSet;	/* 1 if default range rule set */
-    int infiniteLeftSet;	/* 1 if negative infinite interval rule exists */
-    int infiniteRightSet;	/* 1 if positive infinite interval rule exists */
-    int rRangeSet;		/* 1 if range range (i.e. interval) is set */
-    int maxNofRules;
-    int nofRules;
-    DCELL defaultDMin;		/* default domain minimum value */
-    DCELL defaultDMax;		/* default domain maximum value */
-    DCELL defaultRMin;		/* default range minimum value */
-    DCELL defaultRMax;		/* default range maximum value */
-    DCELL infiniteDLeft;	/* neg infinite rule */
-    DCELL infiniteDRight;	/* neg infinite rule */
-    DCELL infiniteRLeft;	/* pos infinite rule */
-    DCELL infiniteRRight;	/* pos infinite rule */
-    DCELL dMin;			/* minimum domain values in rules */
-    DCELL dMax;			/* maximum domain values in rules */
-    DCELL rMin;			/* minimum range values in rules */
-    DCELL rMax;			/* maximum range values in rules */
-    struct FPReclass_table *table;
-};
-
-struct Quant_table
-{
-    DCELL dLow;
-    DCELL dHigh;
-    CELL cLow;
-    CELL cHigh;
-};
-
-struct Quant
-{
-    int truncate_only;
-    int round_only;
-    int defaultDRuleSet;
-    int defaultCRuleSet;
-    int infiniteLeftSet;
-    int infiniteRightSet;
-    int cRangeSet;
-    int maxNofRules;
-    int nofRules;
-    DCELL defaultDMin;
-    DCELL defaultDMax;
-    CELL defaultCMin;
-    CELL defaultCMax;
-    DCELL infiniteDLeft;
-    DCELL infiniteDRight;
-    CELL infiniteCLeft;
-    CELL infiniteCRight;
-    DCELL dMin;
-    DCELL dMax;
-    CELL cMin;
-    CELL cMax;
-    struct Quant_table *table;
-
-    struct
-    {
-	DCELL *vals;
-
-	/* pointers to quant rules corresponding to the intervals btwn vals */
-	struct Quant_table **rules;
-	int nalloc;
-	int active;
-	DCELL inf_dmin;
-	DCELL inf_dmax;
-	CELL inf_min;
-	CELL inf_max;
-	/* all values smaller than inf_dmin become inf_min */
-	/* all values larger than inf_dmax become inf_max */
-	/* inf_min and/or inf_max can be NULL if there are no inf rules */
-    } fp_lookup;
-};
-
-struct Categories
-{
-    CELL ncats;			/* total number of categories              */
-    CELL num;			/* the highest cell values. Only exists    
-				   for backwards compatibility = (CELL)
-				   max_fp_values in quant rules          */
-    char *title;		/* name of data layer                      */
-    char *fmt;			/* printf-like format to generate labels   */
-    float m1;			/* Multiplication coefficient 1            */
-    float a1;			/* Addition coefficient 1                  */
-    float m2;			/* Multiplication coefficient 2            */
-    float a2;			/* Addition coefficient 2                  */
-    struct Quant q;		/* rules mapping cell values to index in
-				   list of labels                        */
-    char **labels;		/* array of labels of size num             */
-    int *marks;			/* was the value with this label was used? */
-    int nalloc;
-    int last_marked_rule;
-    /* NOTE: to get a rule corresponfing to cats.labels[i], use */
-    /* G_get_ith_c/f/d_raster_cat (pcats, i, val1, val2) */
-    /* it calls */
-    /* G_quant_get_ith_rule(&cats->q, i, val1, val2, &index, &index); */
-    /* and idex ==i, because rule is added at the same time as a */
-    /* label, and quant rules are never reordered. Olga apr,95 */
-};
-
-struct History
-{
-    char mapid[RECORD_LEN];
-    char title[RECORD_LEN];
-    char mapset[RECORD_LEN];
-    char creator[RECORD_LEN];
-    char maptype[RECORD_LEN];
-    char datsrc_1[RECORD_LEN];
-    char datsrc_2[RECORD_LEN];
-    char keywrd[RECORD_LEN];
-    int edlinecnt;
-    char edhist[MAXEDLINES][RECORD_LEN];
-};
-
-struct Cell_stats
-{
-    struct Cell_stats_node
-    {
-	int idx;
-	long *count;
-	int left;
-	int right;
-    } *node;			/* tree of values */
-
-    int tlen;			/* allocated tree size */
-    int N;			/* number of actual nodes in tree */
-    int curp;
-    long null_data_count;
-    int curoffset;
-};
-
-struct Histogram
-{
-    int num;
-
-    struct Histogram_list
-    {
-	CELL cat;
-	long count;
-    } *list;
-};
-
-struct Range
-{
-    CELL min;
-    CELL max;
-    int first_time;		/* whether or not range was updated */
-};
-
-struct FPRange
-{
-    DCELL min;
-    DCELL max;
-    int first_time;		/* whether or not range was updated */
-};
-
-/*
- ** Structure for I/O of 3dview files  (view.c)
- */
-struct G_3dview
-{
-    char pgm_id[40];		/* user-provided identifier */
-    float from_to[2][3];	/* eye position & lookat position */
-    float fov;			/* field of view */
-    float twist;		/* right_hand rotation about from_to */
-    float exag;			/* terrain elevation exageration */
-    int mesh_freq;		/* cells per grid line */
-    int poly_freq;		/* cells per polygon */
-    int display_type;		/* 1 for mesh, 2 for poly, 3 for both */
-    int lightson;		/* boolean */
-    int dozero;			/* boolean */
-    int colorgrid;		/* boolean */
-    int shading;		/* boolean */
-    int fringe;			/* boolean */
-    int surfonly;		/* boolean */
-    int doavg;			/* boolean */
-    char grid_col[40];		/* colors */
-    char bg_col[40];		/* colors */
-    char other_col[40];		/* colors */
-    float lightpos[4];		/* east, north, height, 1.0 for local 0.0 infin */
-    float lightcol[3];		/* values between 0.0 to 1.0 for red, grn, blu */
-    float ambient;
-    float shine;
-    struct Cell_head vwin;
-};
-
-struct Key_Value
-{
-    int nitems;
-    int nalloc;
-    char **key;
-    char **value;
-};
-
-struct Option			/* Structure that stores option info */
-{
-    char *key;			/* Key word used on command line    */
-    int type;			/* Option type                      */
-    int required;		/* REQUIRED or OPTIONAL             */
-    int multiple;		/* Multiple entries OK              */
-    char *options;		/* Approved values or range or NULL */
-    char **opts;		/* NULL or NULL terminated array of parsed options */
-    char *key_desc;		/* one word describing the key      */
-    char *label;		/* Optional short label, used in GUI as item label */
-    char *description;		/* String describing option         */
-    char *descriptions;		/* ';' separated pairs of option and option descriptions */
-    /* For example: (with ->options = "break,rmdupl")
-     * "break;break lines on intersections;"
-     * "rmdupl;remove duplicates"
-     */
-    char **descs;		/* parsed descriptions, array of either NULL or string */
-    /* in the same order as options */
-    char *answer;		/* Option answer                    */
-    char *def;			/* Where original answer gets saved */
-    char **answers;		/* Option answers (for multiple=YES) */
-    struct Option *next_opt;	/* Pointer to next option struct    */
-    char *gisprompt;		/* Interactive prompt guidance      */
-    char *guisection;		/* GUI Layout guidance: ';' delimited heirarchical tree position */
-    int (*checker) ();		/* Routine to check answer or NULL  */
-    int count;
-};
-
-struct Flag			/* Structure that stores flag info  */
-{
-    char key;			/* Key char used on command line    */
-    char answer;		/* Stores flag state: 0/1           */
-    char *label;		/* Optional short label, used in GUI as item label */
-    char *description;		/* String describing flag meaning   */
-    char *guisection;		/* GUI Layout guidance: ';' delimited heirarchical tree position */
-    struct Flag *next_flag;	/* Pointer to next flag struct      */
-};
-
-struct GModule			/* Structure that stores module info  */
-{
-    char *label;		/* Optional short description for GUI */
-    char *description;		/* String describing module */
-    char *keywords;		/* Keywords describing module */
-    /* further items are possible: author(s), version */
-    int overwrite;		/* overwrite old files */
-    int verbose;		/* print all informations about progress and so on */
-};
-
-struct TimeStamp
-{
-    DateTime dt[2];		/* two datetimes */
-    int count;
-};
-
-/*============================== Prototypes ================================*/
-
-/* Since there are so many prototypes for the gis library they are stored */
-/* in the file gisdefs.h */
-#include <grass/gisdefs.h>
-
-#endif /* GRASS_GIS_H */

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 1276
swig/perl/gisdefs.h