/* Time-stamp: <96/11/28 10:54:17 john> */

/* 
# Purpose: exports and definitions for reading attribute files
 */

extern int read_attributes_string_or_stream(char *string,
					    FILE *stream,
					    struct entry **result,
					    int *read_error,
					    int (*checker)(struct entry *new_entry,
							   int entry_count),
					    int read_all,
					    int debug_reading_attributes);

extern int read_attribute_file(char *attr_file_directory,
			       char *attr_file_name,
			       char *attr_file_sub_directory,
			       struct entry **result,
			       int *read_error,
			       int (*checker)(struct entry *new_entry,
					      int entry_count),
			       int read_all,
			       int debug_reading_attributes);

extern int read_data(char *attr_file_directory,
		     char *attr_file_name,
		     struct entry **result,
		     int *read_error,
		     int (*checker)(struct entry *new_entry,
				    int entry_count),
		     int read_all,
		     int read_unvetted,
		     int debug);

#define READ_OK 0
#define READ_SILLY_FILENAME 1
#define READ_NO_FILE 2
#define READ_NO_MEM 3
#define READ_EOF_AFTER_KEY 4
#define READ_EOF_INSIDE_VALUE 5
#define READ_NO_DATA_SOURCE 6
#define READ_FAILED_TO_MAKE_ENTRY 7

extern struct entry *find_matching_entry_for_merge(struct entry *kn,
						   struct entry *ex,
						   char *namefield_1,
						   char *namefield_2);

extern void add_added_entries(struct entry *extant,
			      char *pagefile_dir,
			      char *pagefile_name,
			      char *addenda_dir,
			      char *addenda_file,
			      int debug);

extern void knockout_entries(struct entry *extant,
			     char *pagefile_dir,
			     char *pagefile_name,
			     char *knockout_dir,
			     char *knockout_file,
			     int debug);

extern void fetch_inclusions(struct entry *entry,
			     struct style *style);

extern void report_read_error(int read_error, char *type, char *name);

/* end of attr.h */
