dig_atts.h 1.4 KB

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