1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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);
|