Skip to content
Newer
Older
100644 571 lines (550 sloc) 12.2 KB
5dd73d9 @mauke initial import
authored
1 #ifndef GUARD_UNIBILIUM_H_
2 #define GUARD_UNIBILIUM_H_
3
4 /* Copyright 2008, Lukas Mai.
5 *
6 * This library is under the GNU Lesser General Public License;
7 * see the file LGPLv3 for details.
8 */
9
10 #include <stdio.h>
11
12 enum unibi_boolean {
13 unibi_boolean_begin_,
14 unibi_auto_left_margin,
15 unibi_auto_right_margin,
16 unibi_no_esc_ctlc,
17 unibi_ceol_standout_glitch,
18 unibi_eat_newline_glitch,
19 unibi_erase_overstrike,
20 unibi_generic_type,
21 unibi_hard_copy,
22 unibi_has_meta_key,
23 unibi_has_status_line,
24 unibi_insert_null_glitch,
25 unibi_memory_above,
26 unibi_memory_below,
27 unibi_move_insert_mode,
28 unibi_move_standout_mode,
29 unibi_over_strike,
30 unibi_status_line_esc_ok,
31 unibi_dest_tabs_magic_smso,
32 unibi_tilde_glitch,
33 unibi_transparent_underline,
34 unibi_xon_xoff,
35 unibi_needs_xon_xoff,
36 unibi_prtr_silent,
37 unibi_hard_cursor,
38 unibi_non_rev_rmcup,
39 unibi_no_pad_char,
40 unibi_non_dest_scroll_region,
41 unibi_can_change,
42 unibi_back_color_erase,
43 unibi_hue_lightness_saturation,
44 unibi_col_addr_glitch,
45 unibi_cr_cancels_micro_mode,
46 unibi_has_print_wheel,
47 unibi_row_addr_glitch,
48 unibi_semi_auto_right_margin,
49 unibi_cpi_changes_res,
50 unibi_lpi_changes_res,
51 unibi_backspaces_with_bs,
52 unibi_crt_no_scrolling,
53 unibi_no_correctly_working_cr,
54 unibi_gnu_has_meta_key,
55 unibi_linefeed_is_newline,
56 unibi_has_hardware_tabs,
57 unibi_return_does_clr_eol,
58 unibi_boolean_end_
59 };
60
61 enum unibi_numeric {
62 unibi_numeric_begin_ = unibi_boolean_end_,
63 unibi_columns,
64 unibi_init_tabs,
65 unibi_lines,
66 unibi_lines_of_memory,
67 unibi_magic_cookie_glitch,
68 unibi_padding_baud_rate,
69 unibi_virtual_terminal,
70 unibi_width_status_line,
71 unibi_num_labels,
72 unibi_label_height,
73 unibi_label_width,
74 unibi_max_attributes,
75 unibi_maximum_windows,
76 unibi_max_colors,
77 unibi_max_pairs,
78 unibi_no_color_video,
79 unibi_buffer_capacity,
80 unibi_dot_vert_spacing,
81 unibi_dot_horz_spacing,
82 unibi_max_micro_address,
83 unibi_max_micro_jump,
84 unibi_micro_col_size,
85 unibi_micro_line_size,
86 unibi_number_of_pins,
87 unibi_output_res_char,
88 unibi_output_res_line,
89 unibi_output_res_horz_inch,
90 unibi_output_res_vert_inch,
91 unibi_print_rate,
92 unibi_wide_char_size,
93 unibi_buttons,
94 unibi_bit_image_entwining,
95 unibi_bit_image_type,
96 unibi_magic_cookie_glitch_ul,
97 unibi_carriage_return_delay,
98 unibi_new_line_delay,
99 unibi_backspace_delay,
100 unibi_horizontal_tab_delay,
101 unibi_number_of_function_keys,
102 unibi_numeric_end_
103 };
104
105 enum unibi_string {
106 unibi_string_begin_ = unibi_numeric_end_,
107 unibi_back_tab,
108 unibi_bell,
109 unibi_carriage_return,
110 unibi_change_scroll_region,
111 unibi_clear_all_tabs,
112 unibi_clear_screen,
113 unibi_clr_eol,
114 unibi_clr_eos,
115 unibi_column_address,
116 unibi_command_character,
117 unibi_cursor_address,
118 unibi_cursor_down,
119 unibi_cursor_home,
120 unibi_cursor_invisible,
121 unibi_cursor_left,
122 unibi_cursor_mem_address,
123 unibi_cursor_normal,
124 unibi_cursor_right,
125 unibi_cursor_to_ll,
126 unibi_cursor_up,
127 unibi_cursor_visible,
128 unibi_delete_character,
129 unibi_delete_line,
130 unibi_dis_status_line,
131 unibi_down_half_line,
132 unibi_enter_alt_charset_mode,
133 unibi_enter_blink_mode,
134 unibi_enter_bold_mode,
135 unibi_enter_ca_mode,
136 unibi_enter_delete_mode,
137 unibi_enter_dim_mode,
138 unibi_enter_insert_mode,
139 unibi_enter_secure_mode,
140 unibi_enter_protected_mode,
141 unibi_enter_reverse_mode,
142 unibi_enter_standout_mode,
143 unibi_enter_underline_mode,
144 unibi_erase_chars,
145 unibi_exit_alt_charset_mode,
146 unibi_exit_attribute_mode,
147 unibi_exit_ca_mode,
148 unibi_exit_delete_mode,
149 unibi_exit_insert_mode,
150 unibi_exit_standout_mode,
151 unibi_exit_underline_mode,
152 unibi_flash_screen,
153 unibi_form_feed,
154 unibi_from_status_line,
155 unibi_init_1string,
156 unibi_init_2string,
157 unibi_init_3string,
158 unibi_init_file,
159 unibi_insert_character,
160 unibi_insert_line,
161 unibi_insert_padding,
162 unibi_key_backspace,
163 unibi_key_catab,
164 unibi_key_clear,
165 unibi_key_ctab,
166 unibi_key_dc,
167 unibi_key_dl,
168 unibi_key_down,
169 unibi_key_eic,
170 unibi_key_eol,
171 unibi_key_eos,
172 unibi_key_f0,
173 unibi_key_f1,
174 unibi_key_f10,
175 unibi_key_f2,
176 unibi_key_f3,
177 unibi_key_f4,
178 unibi_key_f5,
179 unibi_key_f6,
180 unibi_key_f7,
181 unibi_key_f8,
182 unibi_key_f9,
183 unibi_key_home,
184 unibi_key_ic,
185 unibi_key_il,
186 unibi_key_left,
187 unibi_key_ll,
188 unibi_key_npage,
189 unibi_key_ppage,
190 unibi_key_right,
191 unibi_key_sf,
192 unibi_key_sr,
193 unibi_key_stab,
194 unibi_key_up,
195 unibi_keypad_local,
196 unibi_keypad_xmit,
197 unibi_lab_f0,
198 unibi_lab_f1,
199 unibi_lab_f10,
200 unibi_lab_f2,
201 unibi_lab_f3,
202 unibi_lab_f4,
203 unibi_lab_f5,
204 unibi_lab_f6,
205 unibi_lab_f7,
206 unibi_lab_f8,
207 unibi_lab_f9,
208 unibi_meta_off,
209 unibi_meta_on,
210 unibi_newline,
211 unibi_pad_char,
212 unibi_parm_dch,
213 unibi_parm_delete_line,
214 unibi_parm_down_cursor,
215 unibi_parm_ich,
216 unibi_parm_index,
217 unibi_parm_insert_line,
218 unibi_parm_left_cursor,
219 unibi_parm_right_cursor,
220 unibi_parm_rindex,
221 unibi_parm_up_cursor,
222 unibi_pkey_key,
223 unibi_pkey_local,
224 unibi_pkey_xmit,
225 unibi_print_screen,
226 unibi_prtr_off,
227 unibi_prtr_on,
228 unibi_repeat_char,
229 unibi_reset_1string,
230 unibi_reset_2string,
231 unibi_reset_3string,
232 unibi_reset_file,
233 unibi_restore_cursor,
234 unibi_row_address,
235 unibi_save_cursor,
236 unibi_scroll_forward,
237 unibi_scroll_reverse,
238 unibi_set_attributes,
239 unibi_set_tab,
240 unibi_set_window,
241 unibi_tab,
242 unibi_to_status_line,
243 unibi_underline_char,
244 unibi_up_half_line,
245 unibi_init_prog,
246 unibi_key_a1,
247 unibi_key_a3,
248 unibi_key_b2,
249 unibi_key_c1,
250 unibi_key_c3,
251 unibi_prtr_non,
252 unibi_char_padding,
253 unibi_acs_chars,
254 unibi_plab_norm,
255 unibi_key_btab,
256 unibi_enter_xon_mode,
257 unibi_exit_xon_mode,
258 unibi_enter_am_mode,
259 unibi_exit_am_mode,
260 unibi_xon_character,
261 unibi_xoff_character,
262 unibi_ena_acs,
263 unibi_label_on,
264 unibi_label_off,
265 unibi_key_beg,
266 unibi_key_cancel,
267 unibi_key_close,
268 unibi_key_command,
269 unibi_key_copy,
270 unibi_key_create,
271 unibi_key_end,
272 unibi_key_enter,
273 unibi_key_exit,
274 unibi_key_find,
275 unibi_key_help,
276 unibi_key_mark,
277 unibi_key_message,
278 unibi_key_move,
279 unibi_key_next,
280 unibi_key_open,
281 unibi_key_options,
282 unibi_key_previous,
283 unibi_key_print,
284 unibi_key_redo,
285 unibi_key_reference,
286 unibi_key_refresh,
287 unibi_key_replace,
288 unibi_key_restart,
289 unibi_key_resume,
290 unibi_key_save,
291 unibi_key_suspend,
292 unibi_key_undo,
293 unibi_key_sbeg,
294 unibi_key_scancel,
295 unibi_key_scommand,
296 unibi_key_scopy,
297 unibi_key_screate,
298 unibi_key_sdc,
299 unibi_key_sdl,
300 unibi_key_select,
301 unibi_key_send,
302 unibi_key_seol,
303 unibi_key_sexit,
304 unibi_key_sfind,
305 unibi_key_shelp,
306 unibi_key_shome,
307 unibi_key_sic,
308 unibi_key_sleft,
309 unibi_key_smessage,
310 unibi_key_smove,
311 unibi_key_snext,
312 unibi_key_soptions,
313 unibi_key_sprevious,
314 unibi_key_sprint,
315 unibi_key_sredo,
316 unibi_key_sreplace,
317 unibi_key_sright,
318 unibi_key_srsume,
319 unibi_key_ssave,
320 unibi_key_ssuspend,
321 unibi_key_sundo,
322 unibi_req_for_input,
323 unibi_key_f11,
324 unibi_key_f12,
325 unibi_key_f13,
326 unibi_key_f14,
327 unibi_key_f15,
328 unibi_key_f16,
329 unibi_key_f17,
330 unibi_key_f18,
331 unibi_key_f19,
332 unibi_key_f20,
333 unibi_key_f21,
334 unibi_key_f22,
335 unibi_key_f23,
336 unibi_key_f24,
337 unibi_key_f25,
338 unibi_key_f26,
339 unibi_key_f27,
340 unibi_key_f28,
341 unibi_key_f29,
342 unibi_key_f30,
343 unibi_key_f31,
344 unibi_key_f32,
345 unibi_key_f33,
346 unibi_key_f34,
347 unibi_key_f35,
348 unibi_key_f36,
349 unibi_key_f37,
350 unibi_key_f38,
351 unibi_key_f39,
352 unibi_key_f40,
353 unibi_key_f41,
354 unibi_key_f42,
355 unibi_key_f43,
356 unibi_key_f44,
357 unibi_key_f45,
358 unibi_key_f46,
359 unibi_key_f47,
360 unibi_key_f48,
361 unibi_key_f49,
362 unibi_key_f50,
363 unibi_key_f51,
364 unibi_key_f52,
365 unibi_key_f53,
366 unibi_key_f54,
367 unibi_key_f55,
368 unibi_key_f56,
369 unibi_key_f57,
370 unibi_key_f58,
371 unibi_key_f59,
372 unibi_key_f60,
373 unibi_key_f61,
374 unibi_key_f62,
375 unibi_key_f63,
376 unibi_clr_bol,
377 unibi_clear_margins,
378 unibi_set_left_margin,
379 unibi_set_right_margin,
380 unibi_label_format,
381 unibi_set_clock,
382 unibi_display_clock,
383 unibi_remove_clock,
384 unibi_create_window,
385 unibi_goto_window,
386 unibi_hangup,
387 unibi_dial_phone,
388 unibi_quick_dial,
389 unibi_tone,
390 unibi_pulse,
391 unibi_flash_hook,
392 unibi_fixed_pause,
393 unibi_wait_tone,
394 unibi_user0,
395 unibi_user1,
396 unibi_user2,
397 unibi_user3,
398 unibi_user4,
399 unibi_user5,
400 unibi_user6,
401 unibi_user7,
402 unibi_user8,
403 unibi_user9,
404 unibi_orig_pair,
405 unibi_orig_colors,
406 unibi_initialize_color,
407 unibi_initialize_pair,
408 unibi_set_color_pair,
409 unibi_set_foreground,
410 unibi_set_background,
411 unibi_change_char_pitch,
412 unibi_change_line_pitch,
413 unibi_change_res_horz,
414 unibi_change_res_vert,
415 unibi_define_char,
416 unibi_enter_doublewide_mode,
417 unibi_enter_draft_quality,
418 unibi_enter_italics_mode,
419 unibi_enter_leftward_mode,
420 unibi_enter_micro_mode,
421 unibi_enter_near_letter_quality,
422 unibi_enter_normal_quality,
423 unibi_enter_shadow_mode,
424 unibi_enter_subscript_mode,
425 unibi_enter_superscript_mode,
426 unibi_enter_upward_mode,
427 unibi_exit_doublewide_mode,
428 unibi_exit_italics_mode,
429 unibi_exit_leftward_mode,
430 unibi_exit_micro_mode,
431 unibi_exit_shadow_mode,
432 unibi_exit_subscript_mode,
433 unibi_exit_superscript_mode,
434 unibi_exit_upward_mode,
435 unibi_micro_column_address,
436 unibi_micro_down,
437 unibi_micro_left,
438 unibi_micro_right,
439 unibi_micro_row_address,
440 unibi_micro_up,
441 unibi_order_of_pins,
442 unibi_parm_down_micro,
443 unibi_parm_left_micro,
444 unibi_parm_right_micro,
445 unibi_parm_up_micro,
446 unibi_select_char_set,
447 unibi_set_bottom_margin,
448 unibi_set_bottom_margin_parm,
449 unibi_set_left_margin_parm,
450 unibi_set_right_margin_parm,
451 unibi_set_top_margin,
452 unibi_set_top_margin_parm,
453 unibi_start_bit_image,
454 unibi_start_char_set_def,
455 unibi_stop_bit_image,
456 unibi_stop_char_set_def,
457 unibi_subscript_characters,
458 unibi_superscript_characters,
459 unibi_these_cause_cr,
460 unibi_zero_motion,
461 unibi_char_set_names,
462 unibi_key_mouse,
463 unibi_mouse_info,
464 unibi_req_mouse_pos,
465 unibi_get_mouse,
466 unibi_set_a_foreground,
467 unibi_set_a_background,
468 unibi_pkey_plab,
469 unibi_device_type,
470 unibi_code_set_init,
471 unibi_set0_des_seq,
472 unibi_set1_des_seq,
473 unibi_set2_des_seq,
474 unibi_set3_des_seq,
475 unibi_set_lr_margin,
476 unibi_set_tb_margin,
477 unibi_bit_image_repeat,
478 unibi_bit_image_newline,
479 unibi_bit_image_carriage_return,
480 unibi_color_names,
481 unibi_define_bit_image_region,
482 unibi_end_bit_image_region,
483 unibi_set_color_band,
484 unibi_set_page_length,
485 unibi_display_pc_char,
486 unibi_enter_pc_charset_mode,
487 unibi_exit_pc_charset_mode,
488 unibi_enter_scancode_mode,
489 unibi_exit_scancode_mode,
490 unibi_pc_term_options,
491 unibi_scancode_escape,
492 unibi_alt_scancode_esc,
493 unibi_enter_horizontal_hl_mode,
494 unibi_enter_left_hl_mode,
495 unibi_enter_low_hl_mode,
496 unibi_enter_right_hl_mode,
497 unibi_enter_top_hl_mode,
498 unibi_enter_vertical_hl_mode,
499 unibi_set_a_attributes,
500 unibi_set_pglen_inch,
501 unibi_termcap_init2,
502 unibi_termcap_reset,
503 unibi_linefeed_if_not_lf,
504 unibi_backspace_if_not_bs,
505 unibi_other_non_function_keys,
506 unibi_arrow_key_map,
507 unibi_acs_ulcorner,
508 unibi_acs_llcorner,
509 unibi_acs_urcorner,
510 unibi_acs_lrcorner,
511 unibi_acs_ltee,
512 unibi_acs_rtee,
513 unibi_acs_btee,
514 unibi_acs_ttee,
515 unibi_acs_hline,
516 unibi_acs_vline,
517 unibi_acs_plus,
518 unibi_memory_lock,
519 unibi_memory_unlock,
520 unibi_box_chars_1,
521 unibi_string_end_
522 };
523
524 typedef struct unibi_term unibi_term;
525
526 unibi_term *unibi_dummy(void);
527 unibi_term *unibi_init(const char *, size_t);
528 void unibi_destroy(unibi_term *);
529
530 size_t unibi_dump(const unibi_term *, char *, size_t);
531
532 const char *unibi_get_name(const unibi_term *);
533 void unibi_set_name(unibi_term *, const char *);
534
535 const char **unibi_get_aliases(const unibi_term *);
536 void unibi_set_aliases(unibi_term *, const char **);
537
538 int unibi_get_bool(const unibi_term *, enum unibi_boolean);
539 void unibi_set_bool(unibi_term *, enum unibi_boolean, int);
540
541 short unibi_get_num(const unibi_term *, enum unibi_numeric);
542 void unibi_set_num(unibi_term *, enum unibi_numeric, short);
543
544 const char *unibi_get_str(const unibi_term *, enum unibi_string);
545 void unibi_set_str(unibi_term *, enum unibi_string, const char *);
546
547 #if 0
548 int unibi_get_ext_bool(const unibi_term *, const char *);
549 int unibi_set_ext_bool(unibi_term *, const char *, int);
550
551 short unibi_get_ext_num(const unibi_term *, const char *);
552 int unibi_set_ext_num(unibi_term *, const char *, short);
553
554 const char *unibi_get_ext_str(const unibi_term *, const char *);
555 int unibi_set_ext_str(unibi_term *, const char *, const char *);
556 #endif
557
558 unibi_term *unibi_from_fp(FILE *);
559 unibi_term *unibi_from_fd(int);
560 unibi_term *unibi_from_file(const char *);
561 unibi_term *unibi_from_term(const char *);
562 unibi_term *unibi_from_env(void);
563
564 extern const char *const unibi_terminfo_dirs;
565
566 const char *unibi_name_bool(enum unibi_boolean);
567 const char *unibi_name_num(enum unibi_numeric);
568 const char *unibi_name_str(enum unibi_string);
569
570 #endif /* GUARD_UNIBILIUM_H_ */
Something went wrong with that request. Please try again.