vask.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef __VASK_H__
  2. #define __VASK_H__
  3. #include <signal.h>
  4. #include <curses.h>
  5. #ifdef MAKE_VASK_LIB
  6. #define MAX_ANSW 80
  7. #define MAX_CONST 80
  8. #define MAX_LINE 23
  9. /**
  10. *** target contains all the variable type that we will want to
  11. *** be looking for.
  12. **/
  13. union target {
  14. char *c ;
  15. short *h ;
  16. int *i ;
  17. long *l ;
  18. float *f ;
  19. double *d ;
  20. double for_alignement;
  21. };
  22. /**
  23. *** ans_rec contains all the information needed to go
  24. *** and get an answer from the screen.
  25. **/
  26. struct ans_rec {
  27. union target targetptr ; /* pointer to value */
  28. int var_type ; /* value type */
  29. int row ; /* row position */
  30. int col ; /* column position */
  31. int length ; /* length of entry */
  32. int decimal_places ; /* number of decimal places */
  33. };
  34. /**
  35. *** page is an array of pointers to lines on a page.
  36. **/
  37. struct page {
  38. const char *line[MAX_LINE] ;
  39. };
  40. struct V__
  41. {
  42. struct ans_rec usr_answ[MAX_ANSW];
  43. struct ans_rec constant[MAX_CONST] ;
  44. struct page page;
  45. int NUM_ANSW;
  46. int NUM_CONST;
  47. int NUM_LINE ;
  48. int decimal_places;
  49. char interrupt_msg[80];
  50. };
  51. /* one of the library routines (V_call) will define this struct */
  52. extern struct V__ V__ ;
  53. #endif
  54. void V_float_accuracy(int);
  55. int V_call(void);
  56. void V_intrpt_ok(void);
  57. void V_intrpt_msg(const char *);
  58. void V_clear(void);
  59. int V_const(void *,int,int,int,int);
  60. void V_error(const char *, ...);
  61. void V_exit(void);
  62. void V_init(void);
  63. int V_line(int,const char *);
  64. int V_ques(void *,int,int,int,int);
  65. int V__dump_window(void);
  66. void V__remove_trail(int,char *);
  67. void V__trim_decimal(char *);
  68. #endif /* __VASK_H__ */