dig_atts.h 1.3 KB

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