GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
dig_atts.h
Go to the documentation of this file.
1 #include <stdio.h>
2 
3 /*
4  #define WRITE_ATT_FORMAT "%c %12.2lf %12.2lf %8d"
5  #define WRITE_ATT_FORMAT "%c %14.2lf %14.2lf %7d"
6  */
7 #define WRITE_ATT_FORMAT "%c %14s %14s %10d"
8 #define FlSIZ 14
9 #define READ_ATT_FORMAT "%c %lf %lf %d"
10 
11 /* only types allowed in atts file
12  * A - area, L - line, P - point
13  */
14 #define ATT_TYPES "LAP"
15 
16 /* removed Jun 25 1991 dpg
17  #define LINE 0
18  #define AREA 1
19  #define DOT 2
20  #define DEAD_LINE 4
21  #define DEAD_AREA 5
22  #define DEAD_DOT 6
23  */
24 
25 struct attribute
26 {
27  char type;
28  double x;
29  double y;
30  int cat;
31  long offset;
32 };
33 
34 
35 struct atts_index
36 {
37  long *area_off;
38  long *line_off;
39  long *point_off;
43  int max_areas;
44  int max_lines;
46  int max_atts;
47 };
48 
49 int atts_init(FILE *, struct atts_index *);
50 int free_atts(struct atts_index *);
51 int read_area_att(FILE *, struct atts_index *, struct attribute *, int);
52 int read_line_att(FILE *, struct atts_index *, struct attribute *, int);
53 int read_att_struct(FILE *, struct attribute *);
54 int read_att(FILE *, char *, double *, double *, int *, long *);
55 int write_att(FILE *, char, double, double, int);
56 int write_att_struct(FILE *, struct attribute *);
57 int write_att_line(FILE *, double *, double *, int, int);
int max_atts
Definition: dig_atts.h:46
int max_lines
Definition: dig_atts.h:44
int atts_init(FILE *, struct atts_index *)
int read_att_struct(FILE *, struct attribute *)
int read_att(FILE *, char *, double *, double *, int *, long *)
long offset
Definition: dig_atts.h:31
char type
Definition: dig_atts.h:27
int cat
Definition: dig_atts.h:30
double x
Definition: dig_atts.h:28
long * area_off
Definition: dig_atts.h:37
long * point_off
Definition: dig_atts.h:39
int area_alloc
Definition: dig_atts.h:40
int write_att(FILE *, char, double, double, int)
int max_areas
Definition: dig_atts.h:43
int free_atts(struct atts_index *)
int write_att_struct(FILE *, struct attribute *)
int max_points
Definition: dig_atts.h:45
int read_line_att(FILE *, struct atts_index *, struct attribute *, int)
int point_alloc
Definition: dig_atts.h:42
int line_alloc
Definition: dig_atts.h:41
int write_att_line(FILE *, double *, double *, int, int)
int read_area_att(FILE *, struct atts_index *, struct attribute *, int)
double y
Definition: dig_atts.h:29
long * line_off
Definition: dig_atts.h:38