GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sites.c File Reference
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <grass/gis.h>
#include <grass/site.h>
#include <grass/dbmi.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Include dependency graph for sites.c:

Go to the source code of this file.

Macros

#define DQUOTE   '"'
 
#define SPACE   ' '
 
#define BSLASH   92
 
#define PIPE   '|'
 
#define ispipe(c)   (c==PIPE)
 
#define isnull(c)   (c=='\0')
 
#define isquote(c)   (c==DQUOTE)
 
#define isbslash(c)   (c==BSLASH)
 
#define FOUND_ALL(s, n, dim, c, d)
 

Functions

int G_site_get (struct Map_info *Map, Site *s)
 
int G_site_put (struct Map_info *Map, const Site *s)
 
int G_site_describe (struct Map_info *Map, int *dims, int *cat, int *strs, int *dbls)
 
int G_site_put_head (struct Map_info *Map, Site_head *head)
 
int G_site_get_head (struct Map_info *Map, Site_head *head)
 
char * G_find_sites (char *name, const char *mapset)
 
char * G_find_sites2 (const char *name, const char *mapset)
 
char * G_ask_sites_new (const char *prompt, char *name)
 
char * G_ask_sites_old (const char *prompt, char *name)
 
char * G_ask_sites_any (const char *prompt, char *name)
 
char * G_ask_sites_in_mapset (const char *prompt, char *name)
 
struct Map_info * G_sites_open_old (const char *name, const char *mapset)
 
struct Map_info * G_sites_open_new (const char *name)
 
void G_sites_close (struct Map_info *Map)
 
struct Map_info * G_fopen_sites_old (const char *name, const char *mapset)
 
struct Map_info * G_fopen_sites_new (const char *name)
 
int G_get_site (struct Map_info *fd, double *east, double *north, char **desc)
 
int G_put_site (struct Map_info *fd, double east, double north, const char *desc)
 
void G_site_free_struct (Site *s)
 
Site * G_site_new_struct (RASTER_MAP_TYPE cattype, int n_dim, int n_s_att, int n_d_att)
 
int G_oldsite_get (FILE *fptr, Site *s)
 
int G__oldsite_get (FILE *ptr, Site *s, int fmt)
 
int G_oldsite_describe (FILE *ptr, int *dims, int *cat, int *strs, int *dbls)
 
int G_site_in_region (const Site *site, const struct Cell_head *region)
 
int G_site_c_cmp (const void *a, const void *b)
 
int G_site_d_cmp (const void *a, const void *b)
 
int G_oldsite_s_cmp (const void *a, const void *b)
 
FILE * G_oldsites_open_old (const char *name, const char *mapset)
 
FILE * G_oldsites_open_new (const char *name)
 
char * G_site_format (const Site *s, const char *fs, int id)
 
SITE_ATT * G_sites_get_atts (struct Map_info *Map, int *cat)
 
int G_sites_get_fields (struct Map_info *Map, char ***cnames, int **ctypes, int **ndx)
 
void G_sites_free_fields (int ncols, char **cnames, int *ctypes, int *ndx)
 

Macro Definition Documentation

#define BSLASH   92

Definition at line 29 of file sites.c.

#define DQUOTE   '"'

Definition at line 27 of file sites.c.

Referenced by G__oldsite_get().

#define FOUND_ALL (   s,
  n,
  dim,
  c,
 
)
Value:
(((s->cattype != -1 && !n) || \
(dim < s->dim_alloc) || \
(c < s->str_alloc) || \
(d < s->dbl_alloc))?0:1)
int n
Definition: dataquad.c:291

Definition at line 638 of file sites.c.

Referenced by G__oldsite_get().

#define isbslash (   c)    (c==BSLASH)

Definition at line 35 of file sites.c.

#define isnull (   c)    (c=='\0')

Definition at line 33 of file sites.c.

Referenced by G__oldsite_get(), and G_oldsite_describe().

#define ispipe (   c)    (c==PIPE)

Definition at line 32 of file sites.c.

Referenced by G_oldsite_describe().

#define isquote (   c)    (c==DQUOTE)

Definition at line 34 of file sites.c.

#define PIPE   '|'

Definition at line 30 of file sites.c.

Referenced by G__oldsite_get(), and G_oldsite_describe().

#define SPACE   ' '

Definition at line 28 of file sites.c.

Referenced by G_site_format().

Function Documentation

int G__oldsite_get ( FILE *  ptr,
Site *  s,
int  fmt 
)

Definition at line 650 of file sites.c.

References buf, DQUOTE, err, errno, FOUND_ALL, G_index(), G_scan_easting(), G_scan_northing(), G_strncpy(), isnull, n, NULL, and PIPE.

Referenced by G_oldsite_get().

char* G_ask_sites_any ( const char *  prompt,
char *  name 
)

Definition at line 321 of file sites.c.

References G_ask_any().

char* G_ask_sites_in_mapset ( const char *  prompt,
char *  name 
)

Definition at line 327 of file sites.c.

References G_ask_in_mapset().

char* G_ask_sites_new ( const char *  prompt,
char *  name 
)

Definition at line 309 of file sites.c.

References G_ask_new().

char* G_ask_sites_old ( const char *  prompt,
char *  name 
)

Definition at line 315 of file sites.c.

References G_ask_old().

char* G_find_sites ( char *  name,
const char *  mapset 
)

Definition at line 297 of file sites.c.

References G_find_vector().

char* G_find_sites2 ( const char *  name,
const char *  mapset 
)

Definition at line 303 of file sites.c.

References G_find_vector2().

struct Map_info* G_fopen_sites_new ( const char *  name)

Definition at line 527 of file sites.c.

References G_sites_open_new().

struct Map_info* G_fopen_sites_old ( const char *  name,
const char *  mapset 
)

Definition at line 521 of file sites.c.

References G_sites_open_old().

int G_get_site ( struct Map_info *  fd,
double *  east,
double *  north,
char **  desc 
)

Definition at line 533 of file sites.c.

References G_fatal_error().

int G_oldsite_describe ( FILE *  ptr,
int dims,
int cat,
int strs,
int dbls 
)

Definition at line 790 of file sites.c.

References buf, err, G_index(), G_strstr(), isnull, ispipe, NULL, and PIPE.

int G_oldsite_get ( FILE *  fptr,
Site *  s 
)

Definition at line 643 of file sites.c.

References G__oldsite_get(), and G_projection().

int G_oldsite_s_cmp ( const void *  a,
const void *  b 
)

Definition at line 1064 of file sites.c.

FILE* G_oldsites_open_new ( const char *  name)

Definition at line 1089 of file sites.c.

References G_fopen_new().

FILE* G_oldsites_open_old ( const char *  name,
const char *  mapset 
)

Definition at line 1084 of file sites.c.

References G_fopen_old().

int G_put_site ( struct Map_info *  fd,
double  east,
double  north,
const char *  desc 
)

Definition at line 542 of file sites.c.

References G_fatal_error().

int G_site_c_cmp ( const void *  a,
const void *  b 
)

Definition at line 1024 of file sites.c.

References b.

int G_site_d_cmp ( const void *  a,
const void *  b 
)

Definition at line 1049 of file sites.c.

int G_site_describe ( struct Map_info *  Map,
int dims,
int cat,
int strs,
int dbls 
)

Definition at line 155 of file sites.c.

References G_debug(), and Vect_is_3d().

char* G_site_format ( const Site *  s,
const char *  fs,
int  id 
)
void G_site_free_struct ( Site *  s)

Definition at line 554 of file sites.c.

References G_free().

int G_site_get ( struct Map_info *  Map,
Site *  s 
)
int G_site_get_head ( struct Map_info *  Map,
Site_head *  head 
)
int G_site_in_region ( const Site *  site,
const struct Cell_head *  region 
)

Definition at line 940 of file sites.c.

References G_adjust_easting().

Site* G_site_new_struct ( RASTER_MAP_TYPE  cattype,
int  n_dim,
int  n_s_att,
int  n_d_att 
)

Definition at line 568 of file sites.c.

References G_fatal_error(), G_free(), NULL, and dialogs::s.

int G_site_put ( struct Map_info *  Map,
const Site *  s 
)
int G_site_put_head ( struct Map_info *  Map,
Site_head *  head 
)
void G_sites_close ( struct Map_info *  Map)

Definition at line 492 of file sites.c.

References free(), G_free(), Vect_build(), and Vect_close().

void G_sites_free_fields ( int  ncols,
char **  cnames,
int ctypes,
int ndx 
)

Definition at line 1315 of file sites.c.

References free().

SITE_ATT* G_sites_get_atts ( struct Map_info *  Map,
int cat 
)

Definition at line 1206 of file sites.c.

struct Map_info* G_sites_open_new ( const char *  name)

Definition at line 473 of file sites.c.

References G_debug(), G_message(), G_warning(), render::Map, and Vect_open_new().

Referenced by G_fopen_sites_new().