home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / thesrc15.zip / proto.h < prev    next >
C/C++ Source or Header  |  1993-11-29  |  19KB  |  711 lines

  1. /*
  2.  * THE - The Hessling Editor. A text editor similar to VM/CMS xedit.
  3.  * Copyright (C) 1991-1993 Mark Hessling
  4.  *
  5.  * This program is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU General Public License as
  7.  * published by the Free Software Foundation; either version 2 of
  8.  * the License, or any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13.  * General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to:
  17.  *
  18.  *    The Free Software Foundation, Inc.
  19.  *    675 Mass Ave,
  20.  *    Cambridge, MA 02139 USA.
  21.  *
  22.  *
  23.  * If you make modifications to this software that you feel increases
  24.  * it usefulness for the rest of the community, please email the
  25.  * changes, enhancements, bug fixes as well as any and all ideas to me.
  26.  * This software is going to be maintained and enhanced as deemed
  27.  * necessary by the community.
  28.  *
  29.  * Mark Hessling                     email: M.Hessling@gu.edu.au
  30.  * 36 David Road                     Phone: +61 7 849 7731
  31.  * Holland Park                      Fax:   +61 7 875 5314
  32.  * QLD 4121
  33.  * Australia
  34.  */
  35.  
  36. /*
  37. $Header: C:\THE\RCS\proto.h 1.4 1993/09/01 16:26:59 MH Interim MH $
  38. */
  39.  
  40. #ifdef PROTO
  41.                                                          /* commutil.c */
  42. char *get_key_definition(unsigned short );
  43. int function_key(int );
  44. int command_line(char *,bool);
  45. void cleanup_command_line(void);
  46. void split_command(char *,char *,char *);
  47. int param_split(char *,char *[],int,char *,char);
  48. int command_split(char *,char *[],int,char *,char *);
  49. long valid_target(char *,long);
  50. long get_true_line(void);
  51. LINE *find_named_line(char *,long *);
  52. long search_target(char *,char,long ,int );
  53. int get_row_for_focus_line(int ,long ,long );
  54. int calculate_focus_line(int ,long ,long );
  55. void print_line(char ,long ,short ,char *,char *,bool);
  56. char next_char(LINE *,short *,int);
  57. int add_define(int,char *);
  58. int remove_define(int);
  59. int append_define(int,int,char *);
  60. int find_key_value(char *);
  61. short find_command(char *);
  62. short split_change_params(char *,char *,char *,char *,char *,char *);
  63. void init_command(void);
  64. void add_command(char *);
  65. char *get_next_command( int );
  66. int parse_colours(char *,chtype *,chtype *,chtype *);
  67. void set_colour(int ,chtype,chtype,chtype);
  68. int tabs_convert(LINE *,bool);
  69. int convert_hex_strings(char *);
  70. int marked_block(bool);
  71. int suspend_curses(void);
  72. int resume_curses(void);
  73. int restore_THE(void);
  74. int execute_set_sos_command(bool,char *);
  75. int valid_command_type(bool,char *);
  76. int allocate_temp_space(unsigned int,char);
  77. void free_temp_space(char);
  78. char calculate_current_row(char,char,char);
  79. int get_valid_macro_file_name(char *,char *,int *);
  80.                                                               /* box.c */
  81. void box_operations(int ,char ,bool ,char );
  82. int box_delete(BOXP *);
  83. int box_move(BOXP *,bool);
  84. int box_copy(BOXP *,bool);
  85. int box_fill(BOXP *,char);
  86.                                                           /* execute.c */
  87. int execute_os_command(char *,bool ,bool );
  88. int execute_change_command(char *,bool );
  89. short selective_change(char *,int,char *,int,long ,long ,short );
  90. int insert_new_line(char *,int,long,long,bool,bool);
  91. int execute_makecurr(long);
  92. int execute_shift_command(int,int,long,long);
  93. int execute_change_case(char *,char);
  94. int change_case(char *,int,int,char);
  95. int rearrange_line_blocks(char,char,long,long,long,int,VIEW_DETAILS*,VIEW_DETAILS*);
  96. int execute_set_point(char *,long ,bool);
  97. int execute_wrap_word(unsigned short);
  98. int execute_split_join(bool,bool);
  99. int execute_put(char *,bool);
  100. int execute_macro(char *,bool);
  101.                                                           /* default.c */
  102. void set_defaults(void);
  103. void set_default_colours(void);
  104. short get_profile(char *);
  105. short defaults_for_first_file(void);
  106. short defaults_for_other_files(void);
  107. short default_file_attributes(void);
  108. void set_screen_defaults(void);
  109.                                                              /* edit.c */
  110. void editor(void);
  111.                                                             /* error.c */
  112. void display_error(unsigned short ,char *);
  113.                                                              /* file.c */
  114. short get_file(char *);
  115. LINE *read_file(FILE *,LINE *,char *);
  116. short save_file(FILE_DETAILS *,char *,char,long,long,char,int,int);
  117. int write_char(char ,FILE *);
  118. int increment_alt(FILE_DETAILS *);
  119. char *new_filename(char *,char *,char *,char *);
  120. int remove_aus_file(FILE_DETAILS *);
  121. int free_view_memory(void);
  122. void free_a_view(void);
  123. int free_file_memory(void);
  124. int read_directory(void);
  125. VIEW_DETAILS *find_file(char *,char *);
  126. int execute_command_file(FILE *);
  127. int process_command_line(char *);
  128.                                                             /* getch.c */
  129. int my_getch (WINDOW *);
  130.                                                           /* nonansi.c */
  131. int file_readable(char *);
  132. int file_writable(char *);
  133. int file_exists(char *);
  134. int remove_file(char *);
  135. short splitpath(char *);
  136. #ifdef NO_RENAME
  137. int rename(char *,char *);
  138. #endif
  139. #ifdef OS2
  140. bool LongFileNames(char *);
  141. #endif
  142.                                                            /* prefix.c */
  143. int execute_prefix_commands(void);
  144. void clear_pending_prefix_command(int,LINE *);
  145. void add_prefix_command(LINE *,long,bool);
  146. int add_prefix_synonym(char *,char *);
  147. char *find_prefix_synonym(char *);
  148. char *find_prefix_oldname(char *);
  149.                                                              /* show.c */
  150. void show_heading(void);
  151. void show_footing(void);
  152. void clear_footing(void);
  153. void show_page(void);
  154. void show_one_row(char *,unsigned short,unsigned short ,LINE *);
  155. void highlight_line(char,chtype,chtype);
  156. void show_marked_block(void);
  157. void redraw_window(WINDOW *);
  158. void repaint_screen(void);
  159.                                                               /* the.c */
  160. void init_signals(void);
  161. void handle_signal(int );
  162. void display_info(char *);
  163. void exit_clean(short );
  164.                                                              /* util.c */
  165. short memrevne(char *,char ,short );
  166. char *meminschr(char *,char ,short ,short ,short );
  167. char *meminsmem(char *,char *,short ,short ,short ,short );
  168. char *memdelchr(char *,short ,short,short );
  169. short strzne(char *,char );
  170. short memne(char *,char ,short );
  171. short strzrevne(char *,char );
  172. short strzreveq(char *,char );
  173. char *strtrunc(char *);
  174. int memfind(char *,char *,int ,int ,bool ,bool ,char );
  175. short memcmpi(char *,char *,short );
  176. char *make_upper(char *);
  177. unsigned short equal(char *,char *,short );
  178. int valid_integer(char *);
  179. int valid_positive_integer(char *);
  180. int strzeq(char *,char );
  181. char *strtrans(char *,char,char);
  182. void *ll_add(void *,void *,unsigned short );
  183. void *ll_del(void *,void *,int );
  184. void ll_free(void *);
  185. void *ll_find(void *,unsigned long );
  186. LINE *lll_add(LINE *,LINE *,unsigned short );
  187. LINE *lll_del(LINE **,LINE **,LINE *,int );
  188. LINE *lll_free(LINE *);
  189. LINE *lll_find(LINE *,unsigned long );
  190. LINE *add_line(LINE *,LINE *,char *,unsigned short );
  191. LINE *delete_line(LINE *,LINE *,int);
  192. VIEW_DETAILS *vll_add(VIEW_DETAILS *,VIEW_DETAILS *,unsigned short );
  193. VIEW_DETAILS *vll_del(VIEW_DETAILS **,VIEW_DETAILS **,VIEW_DETAILS *,int );
  194. DEFINE *dll_add(DEFINE *,DEFINE *,unsigned short );
  195. DEFINE *dll_del(DEFINE **,DEFINE **,DEFINE *,int );
  196. DEFINE *dll_free(DEFINE *);
  197. long find_string(long ,short *,char *,int ,int ,int ,char );
  198. void put_string(WINDOW *,int ,int ,char *,int);
  199. void put_char(WINDOW *,chtype ,char );
  200. int set_up_windows(void);
  201. void delete_windows(void);
  202. void pre_process_line(long );
  203. void post_process_line(long );
  204. short blank_field(char *);
  205. void adjust_marked_lines(bool ,long ,long );
  206. void adjust_pending_prefix(VIEW_DETAILS *,bool ,long ,long );
  207. char case_translate(char );
  208. void add_to_recovery_list(char *,int );
  209. void get_from_recovery_list(int );
  210. WINDOW *adjust_window(WINDOW *,int ,int ,int ,int );
  211. void draw_cursor(int );
  212. int my_wclrtoeol(WINDOW *);
  213.                                                              /* rexx.c */
  214. #if !defined(NOREXX)
  215. int initialise_rexx(void);
  216. int finalise_rexx(void);
  217. int execute_macro_file(char *,char *);
  218. int set_extract_variables(char *);
  219. int set_rexx_variable(char *,char *,int);
  220. #endif
  221.                                                             /* query.c */
  222. int find_item(char *,char);
  223. int show_status(void);
  224. int save_status(char *);
  225. int get_item_values(int,char *,char,unsigned long,char *,unsigned long);
  226.                                                          /* directry.c */
  227. int set_dirtype(char *);
  228.                                                           /* fnmatch.c */
  229. int fnmatch(char *,char *,int);
  230.                                                              /* sort.c */
  231. int execute_sort(char *);
  232.                                                             /* comm*.c */
  233. int Add(char *);
  234. int All(char *);
  235. int Arbchar(char *);
  236. int Autosave(char *);
  237. int Backup(char *);
  238. int Backward(char *);
  239. int BeepSound(char *);
  240. int Bottom(char *);
  241. int Cancel(char *);
  242. int Case(char *);
  243. int Ccancel(char *);
  244. int Change(char *);
  245. int Clearscreen(char *);
  246. int Clock(char *);
  247. int Cmatch(char *);
  248. int Cmdarrows(char *);
  249. int Cmdline(char *);
  250. int Cmsg(char *);
  251. int Colour(char *);
  252. int Command(char *);
  253. int Control_char(char *);
  254. int Copy(char *);
  255. int Curline(char *);
  256. int Define(char *);
  257. int DeleteLine(char *);
  258. int Directory(char *);
  259. int Dirinclude(char *);
  260. int Display(char *);
  261. int Down_arrow(char *);
  262. int Duplicate(char *);
  263. int Emsg(char *);
  264. int Enter(char *);
  265. int Etmode(char *);
  266. int Eolout(char *);
  267. int Expand(char *);
  268. int Extract(char *);
  269. int Ffile(char *);
  270. int File(char *);
  271. int Fillbox(char *);
  272. int Forward(char *);
  273. int Get(char *);
  274. int Help(char *);
  275. int Hex(char *);
  276. int Hexdisplay(char *);
  277. int Impmacro(char *);
  278. int Impos(char *);
  279. int Input(char *);
  280. int Insertmode(char *);
  281. int Join(char *);
  282. int Left_arrow(char *);
  283. int Linend(char *);
  284. int Locate(char *);
  285. int Lowercase(char *);
  286. int Macro(char *);
  287. int Macroext(char *);
  288. int Macropath(char *);
  289. int Margins(char *);
  290. int Mark(char *);
  291. int Modify(char *);
  292. int Move(char *);
  293. int Msg(char *);
  294. int Msgmode(char *);
  295. int Newlines(char *);
  296. int Next(char *);
  297. int Nextwindow(char *);
  298. int Nomsg(char *);
  299. int Nondisp(char *);
  300. int Nop(char *);
  301. int Number(char *);
  302. int Overlaybox(char *);
  303. int Os(char *);
  304. int Osnowait(char *);
  305. int Osquiet(char *);
  306. int Pending(char *);
  307. int Point(char *);
  308. int Prefix(char *);
  309. int Print(char *);
  310. int Printer(char *);
  311. int Put(char *);
  312. int Putd(char *);
  313. int Qquit(char *);
  314. int Quit(char *);
  315. int Query(char *);
  316. int Recover(char *);
  317. int Reexecute(char *);
  318. int Redraw(char *);
  319. int Refresh(char *);
  320. int Replace(char *);
  321. int Reprofile(char *);
  322. int Reserved(char *);
  323. int Reset(char *);
  324. int Retrieve(char *);
  325. int Rexxoutput(char *);
  326. int Right_arrow(char *);
  327. int Save(char *);
  328. int Scope(char *);
  329. int Select(char *);
  330. int Set(char *);
  331. int Schange(char *);
  332. int Screen(char *);
  333. int Shift(char *);
  334. int ShowKey(char *);
  335. int Sort(char *);
  336. int Sos(char *);
  337. int Sos_addline(char *);
  338. int Sos_cursoradj(char *);
  339. int Sos_delback(char *);
  340. int Sos_delchar(char *);
  341. int Sos_delend(char *);
  342. int Sos_delline(char *);
  343. int Sos_delword(char *);
  344. int Sos_doprefix(char *);
  345. int Sos_edit(char *);
  346. int Sos_endchar(char *);
  347. int Sos_execute(char *);
  348. int Sos_makecurr(char *);
  349. int Sos_tabf(char *);
  350. int Sos_tabwordb(char *);
  351. int Sos_tabwordf(char *);
  352. int Sos_undo(char *);
  353. int Split(char *);
  354. int Spltjoin(char *);
  355. int Ssave(char *);
  356. int Status(char *);
  357. int Stay(char *);
  358. int Suspend(char *);
  359. int Tabcmd(char *);
  360. int Tabkey(char *);
  361. int Tabpre(char *);
  362. int Tabs(char *);
  363. int Tabsin(char *);
  364. int Tabsout(char *);
  365. int Text(char *);
  366. int Top(char *);
  367. int Up(char *);
  368. int Up_arrow(char *);
  369. int Uppercase(char *);
  370. int Verify(char *);
  371. int Wordwrap(char *);
  372. int Xedit(char *);
  373. int Zone(char *);
  374.  
  375. #else
  376.                                                          /* commutil.c */
  377. char *get_key_definition();
  378. int function_key();
  379. int command_line();
  380. void cleanup_command_line();
  381. void split_command();
  382. int param_split();
  383. int command_split();
  384. long valid_target();
  385. long get_true_line();
  386. LINE *find_named_line();
  387. long search_target();
  388. int get_row_for_focus_line();
  389. int calculate_focus_line();
  390. void print_line();
  391. char next_char();
  392. int add_define();
  393. int remove_define();
  394. int append_define();
  395. int find_key_value();
  396. short find_command();
  397. short split_change_params();
  398. void init_command();
  399. void add_command();
  400. char *get_next_command();
  401. int parse_colours();
  402. void set_colour();
  403. int tabs_convert();
  404. int convert_hex_strings();
  405. int marked_block();
  406. int suspend_curses();
  407. int resume_curses();
  408. int restore_THE();
  409. int execute_set_sos_command();
  410. int valid_command_type();
  411. int allocate_temp_space();
  412. void free_temp_space();
  413. char calculate_current_row();
  414. int get_valid_macro_file_name();
  415.                                                               /* box.c */
  416. void box_operations();
  417. int box_delete();
  418. int box_move();
  419. int box_copy();
  420. int box_fill();
  421.                                                           /* execute.c */
  422. int execute_os_command();
  423. int execute_change_command();
  424. short selective_change();
  425. int insert_new_line();
  426. int execute_makecurr();
  427. int execute_shift_command();
  428. int execute_change_case();
  429. int change_case();
  430. int rearrange_line_blocks();
  431. int execute_set_point();
  432. int execute_wrap_word();
  433. int execute_split_join();
  434. int execute_put();
  435. int execute_macro();
  436.                                                           /* default.c */
  437. void set_defaults();
  438. void set_default_colours();
  439. short get_profile();
  440. short defaults_for_first_file();
  441. short defaults_for_other_files();
  442. short default_file_attributes();
  443. void set_screen_defaults();
  444.                                                             /* error.c */
  445. void display_error();
  446.                                                              /* file.c */
  447. short get_file();
  448. LINE *read_file();
  449. short save_file();
  450. int write_char();
  451. int increment_alt();
  452. char *new_filename();
  453. int remove_aus_file();
  454. int free_view_memory();
  455. void free_a_view();
  456. int free_file_memory();
  457. int read_directory();
  458. VIEW_DETAILS *find_file();
  459. int execute_command_file();
  460. int process_command_line();
  461.                                                             /* getch.c */
  462. int my_getch ();
  463.                                                           /* nonansi.c */
  464. int file_readable();
  465. int file_writable();
  466. int file_exists();
  467. int remove_file();
  468. short splitpath();
  469. #ifdef NO_RENAME
  470. int rename();
  471. #endif
  472. #ifdef OS2
  473. bool LongFileName();
  474. #endif
  475.                                                            /* prefix.c */
  476. int execute_prefix_commands();
  477. void clear_pending_prefix_command();
  478. void add_prefix_command();
  479. #if !defined(NOREXX)
  480. int add_prefix_synonym();
  481. char *find_prefix_synonym();
  482. char *find_prefix_oldname();
  483. #endif
  484.                                                              /* show.c */
  485. void show_heading();
  486. void show_footing();
  487. void clear_footing();
  488. void show_page();
  489. void show_one_row();
  490. void highlight_line();
  491. void show_marked_block();
  492. void redraw_window();
  493. void repaint_screen();
  494.                                                               /* the.c */
  495. void init_signals();
  496. void handle_signal();
  497. void display_info();
  498. void exit_clean();
  499.                                                              /* util.c */
  500. short memrevne();
  501. char *meminschr();
  502. char *meminsmem();
  503. char *memdelchr();
  504. short strzne();
  505. short memne();
  506. short strzrevne();
  507. short strzreveq();
  508. char *strtrunc();
  509. int memfind();
  510. short memcmpi();
  511. char *make_upper();
  512. unsigned short equal();
  513. int valid_integer();
  514. int valid_positive_integer();
  515. int strzeq();
  516. char *strtrans();
  517. void *ll_add();
  518. void *ll_del();
  519. void ll_free();
  520. void *ll_find();
  521. LINE *lll_add();
  522. LINE *lll_del();
  523. LINE *lll_free();
  524. LINE *lll_find();
  525. LINE *add_line();
  526. LINE *delete_line();
  527. VIEW_DETAILS *vll_add();
  528. VIEW_DETAILS *vll_del();
  529. DEFINE *dll_add();
  530. DEFINE *dll_del();
  531. DEFINE *dll_free();
  532. long find_string();
  533. void put_string();
  534. void put_char();
  535. int set_up_windows();
  536. void delete_windows();
  537. void pre_process_line();
  538. void post_process_line();
  539. short blank_field();
  540. void adjust_marked_lines();
  541. void adjust_pending_prefix();
  542. char case_translate();
  543. void add_to_recovery_list();
  544. void get_from_recovery_list();
  545. WINDOW *adjust_window();
  546. void draw_cursor();
  547. int my_wclrtoeol();
  548.                                                              /* rexx.c */
  549. #if !defined(NOREXX)
  550. int initialise_rexx();
  551. int finalise_rexx();
  552. int execute_macro_file();
  553. int set_extract_variables();
  554. int set_rexx_variable();
  555. #endif
  556.                                                             /* query.c */
  557. int find_item();
  558. int show_status();
  559. int save_status();
  560. int get_item_values();
  561.                                                          /* directry.c */
  562. int set_dirtype();
  563.                                                           /* fnmatch.c */
  564. int fnmatch();
  565.                                                              /* sort.c */
  566. int execute_sort();
  567.                                                             /* comm*.c */
  568. int Add();
  569. int All();
  570. int Arbchar();
  571. int Autosave();
  572. int Backup();
  573. int Backward();
  574. int BeepSound();
  575. int Bottom();
  576. int Cancel();
  577. int Case();
  578. int Ccancel();
  579. int Change();
  580. int Clearscreen();
  581. int Clock();
  582. int Cmatch();
  583. int Cmdarrows();
  584. int Cmdline();
  585. int Cmsg();
  586. int Colour();
  587. int Command();
  588. int Control_char();
  589. int Copy();
  590. int Curline();
  591. int Define();
  592. int DeleteLine();
  593. int Directory();
  594. int Dirinclude();
  595. int Display();
  596. int Down_arrow();
  597. int Duplicate();
  598. int Emsg();
  599. int Enter();
  600. int Eolout();
  601. int Etmode();
  602. int Expand();
  603. int Extract();
  604. int Ffile();
  605. int File();
  606. int Fillbox();
  607. int Forward();
  608. int Get();
  609. int Help();
  610. int Hex();
  611. int Hexdisplay();
  612. int Impmacro();
  613. int Impos();
  614. int Input();
  615. int Insertmode();
  616. int Join();
  617. int Left_arrow();
  618. int Linend();
  619. int Locate();
  620. int Lowercase();
  621. int Macro();
  622. int Macroext();
  623. int Macropath();
  624. int Margins();
  625. int Mark();
  626. int Modify();
  627. int Move();
  628. int Msg();
  629. int Msgmode();
  630. int Newlines();
  631. int Next();
  632. int Nextwindow();
  633. int Nomsg();
  634. int Nondisp();
  635. int Nop();
  636. int Number();
  637. int Overlaybox();
  638. int Os();
  639. int Osnowait();
  640. int Osquiet();
  641. int Pending();
  642. int Point();
  643. int Prefix();
  644. int Print();
  645. int Printer();
  646. int Put();
  647. int Putd();
  648. int Qquit();
  649. int Quit();
  650. int Query();
  651. int Recover();
  652. int Reexecute();
  653. int Redraw();
  654. int Refresh();
  655. int Replace();
  656. int Reprofile();
  657. int Reserved();
  658. int Reset();
  659. int Retrieve();
  660. int Rexxoutput();
  661. int Right_arrow();
  662. int Save();
  663. int Scope();
  664. int Select();
  665. int Schange();
  666. int Screen();
  667. int Set();
  668. int Shift();
  669. int ShowKey();
  670. int Sort();
  671. int Sos();
  672. int Sos_addline();
  673. int Sos_cursoradj();
  674. int Sos_delback();
  675. int Sos_delchar();
  676. int Sos_delend();
  677. int Sos_delline();
  678. int Sos_delword();
  679. int Sos_doprefix();
  680. int Sos_edit();
  681. int Sos_endchar();
  682. int Sos_execute();
  683. int Sos_makecurr();
  684. int Sos_tabf();
  685. int Sos_tabwordb();
  686. int Sos_tabwordf();
  687. int Sos_undo();
  688. int Split();
  689. int Spltjoin();
  690. int Ssave();
  691. int Stay();
  692. int Suspend();
  693. int Status();
  694. int Tabcmd();
  695. int Tabkey();
  696. int Tabpre();
  697. int Tabs();
  698. int Tabsin();
  699. int Tabsout();
  700. int Text();
  701. int Top();
  702. int Up();
  703. int Up_arrow();
  704. int Uppercase();
  705. int Verify();
  706. int Wordwrap();
  707. int Xedit();
  708. int Zone();
  709.  
  710. #endif
  711.