home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / chord3_6.zip / chord / chord.h < prev    next >
C/C++ Source or Header  |  1995-04-25  |  5KB  |  171 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. #include "patchlevel.h"
  6.  
  7. #define TRUE 1
  8. #define FALSE 0
  9.  
  10. #define MAXLINE 256
  11. #define MAXFONTS 16   /* Maximum number of different fonts in one execution */
  12. #define MAXTOKEN 256
  13. #define MAX_CHORD 1024
  14. #define CHORD_NAME_SZ   10
  15. #define MAXNOTE 8
  16.  
  17. #define LONG_FINGERS    4
  18. #define FRET_NONE_STR    "-"        /* fret value for unplayed strings */
  19. #define FRET_NONE    -2        /* internal numeric value */
  20. #define FRET_X_STR    "X"        /* fret value for muted strings */
  21. #define FRET_X        -1        /* internal value (must be -1) */
  22. #define NO_CHORD_STR    "N.C."        /* Indicates No-Chord */
  23. #define BASE_FRET_STR    "base-fret"
  24. #define FRETS_STR    "frets"
  25.  
  26. #ifdef US
  27. #define TOP 756.0         /* 10.5 inches in points */
  28. #define BOTTOM 40.0        /* 0.5 inch in points */
  29. #define L_MARGIN 72.0      /* 1 inch in points */
  30. #define WIDTH 612.0        /* 8.5 inches in points */
  31. #else
  32.     /* Note: Not having access to an actual A4 PostScript printer
  33.          the CHORD authors had to rely on input from beta-testers
  34.          on what were the proper values to use for these fields.
  35.          We though 813 was the right value for TOP.
  36.          Some beta testers agreed, some thought it was better
  37.          to leave the US value (756). We left 756 in and commented
  38.          out the 813 entry. If the A4 page does not look to good for
  39.          your taste, you may want to recompile with the other value.
  40.          Thanks for your co-operation ... The authors */
  41.  
  42. #define TOP 756.0         /* 10.5 inches in points */
  43. /* #define TOP 813 */        /* 28.7 cm or 11.30 inches in points */
  44. #define BOTTOM 36.0      /* 1.25 cm or 0.5 inch in points */
  45. #define L_MARGIN 72.0     /* 2.5 cm or 1 inch in points */
  46. #define WIDTH 595.0       /* 21 cm or 8.27 inches in points */
  47.  
  48. #endif /* US */
  49.  
  50. #define DELIM_STR       ": \t"
  51.  
  52. #define DEF_TEXT_SIZE 12
  53. #define DEF_CHORD_SIZE 9
  54. #define DEF_GRID_SIZE 30
  55. #define DEF_TEXT_FONT "Times-Roman"
  56. #define DEF_CHORD_FONT "Helvetica-Oblique"
  57. #define MONOSPACED_FONT "Courier"
  58.  
  59. #define CHORD_BUILTIN    0
  60. #define CHORD_DEFINED    1
  61. #define CHORD_IN_CHORDRC    2
  62.  
  63. #define CHORD_EASY    0
  64. #define CHORD_HARD    1
  65.  
  66. struct kcs {
  67.     struct     kcs *next;
  68.     char    chord_name[CHORD_NAME_SZ];
  69.     int    displ;
  70.     int    s1,s2,s3,s4,s5,s6;
  71.     int    origin;
  72.     int    difficult;
  73.     } dummy_kcs;
  74.  
  75. struct chord_struct {
  76.     struct chord_struct *next;
  77.     struct kcs *chord;
  78.     } dummy_chord_struct;
  79.  
  80. struct sub_title_struct {
  81.     struct sub_title_struct *next_sub;
  82.     char *sub_title;
  83.     };
  84.  
  85. struct toc_struct {
  86.     struct toc_struct *next;
  87.     struct sub_title_struct *sub_titles; 
  88.     char *title;
  89.     int page_label;
  90.     };
  91.  
  92. int do_define_chord();
  93. void build_ps_toc();
  94. void do_chorus_line();
  95. void do_end_of_page();
  96. void do_end_of_phys_page();
  97. void do_end_of_song();
  98. void do_init_grid_ps();
  99. void do_new_song();
  100. void do_start_of_page();
  101. void do_subtitle();
  102. void do_title();
  103. void draw_chords();
  104. void dump_chords();
  105. void init_known_chords();
  106. void init_ps();
  107. void print_chord_line ();
  108. void print_re_encode();
  109. void print_text_line();
  110. void print_version();
  111. void read_chordrc();
  112. void set_chord_font();
  113. void use_chord_font();
  114. void use_text_font();
  115.  
  116. #ifdef  __STDC__
  117. struct chord_struct *add_to_chordtab(char *chord);
  118. void add_title_to_toc(char *title, int page_label);
  119. void add_subtitle_to_toc(char *subtitle);
  120. int do_transpose(char *chord);
  121. struct kcs *get_kc_entry (char *chord);
  122. void advance(int amount);
  123. void debug(char *dbg_str);
  124. void do_chord (int i_text, char *chord);
  125. void do_comment(char *comment, int style);
  126. void do_directive(char *directive);
  127. void do_help (char *command) ;
  128. void dump_fret(int fretnum);
  129. void error(char *error);
  130. void error_rt(char *error);
  131. void moveto(int new_hpos, int new_vpos);
  132. void process_file(FILE *source_fd);
  133. void ps_fputc(FILE *fd, int c);
  134. void ps_fputs(FILE *fd, char *string);
  135. void ps_puts(char *string);
  136. void put_in_string(char array[], int *p_index, int c, int max_index, int *p_ov_flag);
  137. void re_encode(char *font);
  138. void read_input_file(char source[], FILE *source_fd);
  139. void set_text_font(int size);
  140. char *tolower_str(char *string);
  141. char *toupper_str(char *string);
  142. extern      char *strtok(char *s1, const char *s2);
  143. #else /* __STDC__ */
  144. struct chord_struct *add_to_chordtab();
  145. int do_transpose();
  146. struct kcs *get_kc_entry ();
  147. void advance();
  148. void debug();
  149. void do_chord ();
  150. void do_comment();
  151. void do_directive();
  152. void do_help ();
  153. void do_translate();
  154. void dump_fret();
  155. void error();
  156. void error_rt();
  157. void moveto();
  158. void process_file();
  159. void ps_fputc();
  160. void ps_fputs();
  161. void ps_puts();
  162. void put_in_string();
  163. void re_encode();
  164. void read_input_file();
  165. void set_text_font();
  166. char *tolower_str();
  167. char *toupper_str();
  168. extern char *strtok();
  169.  
  170. #endif /* ANSI_C */
  171.