GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-77aab223bc
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  char type;
27  double x;
28  double y;
29  int cat;
30  long offset;
31 };
32 
33 struct atts_index {
34  long *area_off;
35  long *line_off;
36  long *point_off;
40  int max_areas;
41  int max_lines;
43  int max_atts;
44 };
45 
46 int atts_init(FILE *, struct atts_index *);
47 int free_atts(struct atts_index *);
48 int read_area_att(FILE *, struct atts_index *, struct attribute *, int);
49 int read_line_att(FILE *, struct atts_index *, struct attribute *, int);
50 int read_att_struct(FILE *, struct attribute *);
51 int read_att(FILE *, char *, double *, double *, int *, long *);
52 int write_att(FILE *, char, double, double, int);
53 int write_att_struct(FILE *, struct attribute *);
54 int write_att_line(FILE *, double *, double *, int, int);
int atts_init(FILE *, struct atts_index *)
int read_att_struct(FILE *, struct attribute *)
int read_line_att(FILE *, struct atts_index *, struct attribute *, int)
int write_att(FILE *, char, double, double, int)
int read_area_att(FILE *, struct atts_index *, struct attribute *, int)
int write_att_line(FILE *, double *, double *, int, int)
int free_atts(struct atts_index *)
int write_att_struct(FILE *, struct attribute *)
int read_att(FILE *, char *, double *, double *, int *, long *)
double x
Definition: dig_atts.h:27
int cat
Definition: dig_atts.h:29
double y
Definition: dig_atts.h:28
char type
Definition: dig_atts.h:26
long offset
Definition: dig_atts.h:30
int area_alloc
Definition: dig_atts.h:37
int max_atts
Definition: dig_atts.h:43
int max_lines
Definition: dig_atts.h:41
int line_alloc
Definition: dig_atts.h:38
long * area_off
Definition: dig_atts.h:34
int max_areas
Definition: dig_atts.h:40
int max_points
Definition: dig_atts.h:42
int point_alloc
Definition: dig_atts.h:39
long * point_off
Definition: dig_atts.h:36
long * line_off
Definition: dig_atts.h:35