/* AMAN.H */ #include "\yossi\common.h" #define BRIAL_LINE_LEN 38 /* Brial line length */ #define LAST_BRIAL_LINE_LEN 25 /* Last line in page */ #define MAX_WORD_LEN BRIAL_LINE_LEN #define LINES_PER_PAGE 26 #define PAGES_PER_VOLUME 80 #define MAX_PAGES_PER_VOLUME 90 #define MIN_PAGES_PER_VOLUME 60 #define MAX_TITLE_LINES 6 #define PAGE_NUM_LEN 5 /* # of characters in the page number */ #define SPACE_BEFORE_PAGE_NUM 3 /* between text and page number 3 spaces are needed */ #define MIN_LINES_FOR_TITLE 4 /* without at least 4 lines for the begining of the chapter we go to the next page and leave the lines blank */ #define P_NUM (PAGE_NUM_LEN + SPACE_BEFORE_PAGE_NUM) /* This is the number of chars needed for the page number */ #define FIRST_LINE_LEN (BRIAL_LINE_LEN - P_NUM) #define BRAIL_HARD_SPACE '' /* ascii 127 */ #define SPACE_NEEDED_FOR_CHAPTER_PAGE 4 #define MAX_LINE_LEN 400 #define MAX_RULLERS 7 #define MAX_TABS 7 #define DEFAULT_LANG HEBREW #define LINE_DELS "\nÛ" #define SPACE 0200 /* Brial blank space */ #define blank_line(c) (*c == NULL ? YES : NO) #define W_NORMAL 0 #define W_EOF 1 #define W_EOL 2 #define ATTR_NORMAL 0 #define ATTR_MARKED 1 #define ATTR_TITLE 2 #define MENU_FILE 1 #define MENU_CONVERT 2 #define MENU_EDIT 3 #define MENU_PRINT 4 #define MENU_EXIT 5 #define MENU_RETURN 6 #define MENU_TEXT 7 #define MENU_PAGE1 8 #define MENU_PAGE2 9 #define MENU_PAGE3 10 #define MENU_PAGE4 11 #define MENU_DEBUG 12 #define MENU_SIM 13 #define MENU_BRIAL 14 #define is_ein_digit(c) (isdigit(c)||c=='#'||c=='$'||c=='%'||c=='¤') #define is_attribute(c) (c>=201&&c<=203) #define to_attr(c) (c == 201 || c == 202 ? ATTR_MARKED : c == 203 ? ATTR_TITLE : ATTR_NORMAL) #define EIN_LANG(c) (is_ein_digit(c) ? ENGLISH : LANG(c)) #define secoend_lang(c) (default_lang == ENGLISH ? (EIN_LANG(c) == HEBREW) : \ (EIN_LANG(c) == ENGLISH || is_ein_digit(c))) #define B_CR 0xCD /* '\n' */ #define B_FF 0xC7 /* '\f' */ /* #define B_CR '\n' #define B_FF '\f' */ struct page { float top; float bottom; int lines; float spacing[MAX_RULLERS]; }; struct word { char orig[MAX_WORD_LEN+10]; char text[MAX_WORD_LEN+10]; char attr; char lang; char center; }; struct word_q { char status; struct word w; struct word_q *next; }; typedef char EIN_LINE[2][MAX_LINE_LEN+9]; /* menu.c */ char menu_Main(char *); void menu_File(char *); char menu_Convert(char *, int *); char menu_Print(char *, int *); /* brial.c */ char SendNikudFile(char *, FILE *); char FileExists(char *, char *); /* braille.c */ char *get_line(int); EIN_LINE *prepare_line(void); void advance_line_num(void); void output_line(char *); void ein_error(int, char *,...); void open_error_file(char *); void close_error_file(void); int hyphen_heb(char *), hyphen_eng(char *); /* char.c */ char c_translate_char(char **, char **); /* word.c */ struct word_q *w_push_word(struct word *, char); void w_pop_word(void); char w_pull_word(struct word *, int); void w_prepare_prefix(char *, struct word *); int w_translate_word(char *, char, struct word *); char *w_translate_int(int); /* line.c */ char *l_get_line(int); int l_title_lines(void); int l_check_for_brackets_etc(struct word *) ; char *l_insert_word(char *, struct word *, char *, int, char); int l_pre_hyphen(char, char *, int); char *l_get_letters_and_status(int, char *, char); /* page.c */ void p_pagenate(void); void p_page_setup(void) ; /* sets up the page line by line */ void p_send_warning(void); /* in case of exceeding the maximum number of pages per volume */ void p_print_line(char *, int); void p_print_title(int, int); void p_finish_up(void); char *p_get_line(int); int p_check_title(int); void p_first_page(void); void p_second_page(void); void p_third_page(void); char *p_first_page_get_line(int, char); /* romepage.c */ void ip_first_page(void); void ip_second_or_fourth_page(char); void ip_third_page(void);