home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / CROUTE / TABLE.H < prev    next >
C/C++ Source or Header  |  1988-03-25  |  2KB  |  69 lines

  1. /* table.h */
  2.  
  3. /*--------------- ANSA SOFTWARE CONFIDENTIAL INFORMATION ------------------ */
  4.  
  5. /* table definition */
  6.  
  7. #ifndef TSTRUCTH
  8. typedef char TABLE;
  9. #endif
  10.  
  11. /* table routine error definitions */
  12.  
  13. extern    int    tError;
  14.  
  15. #define TEUNLINK    1   /* unlink failed - write protected disk */
  16.             /* or read-only file? */
  17. #define TETNAME     2   /* table name not parseable */
  18. #define TENOTABLE   3   /* table name doesn't exist */
  19. #define TENOINDEX   4   /* index fields not supported */
  20. #define TEFIELDS    5   /* number fields must be between 1 and 255 */
  21. #define TEFLDNAME   6   /* invalid field name */
  22. #define TEFLDTYPE   7   /* invalid field type */
  23. #define TEMEMORY    8   /* no memory - malloc failure */
  24. #define TELSEEK     9   /* unable to lseek */
  25. #define TECREATE   10   /* unable to create file */
  26. #define TERDREAD   11   /* unable to read relation descriptor */
  27. #define TERDWRITE  12   /* unable to write relation descriptor */
  28. #define TECLOSE    13   /* unable to close table */
  29. #define TESEEK     14   /* unable to tSeek - parameter error */
  30. #define TESKEMPTY  15   /* no tSeek allowed in empty file */
  31. #define TESKBEFORE 16   /* attempt to tSeek before bein of file */
  32. #define TESKAFTER  17   /* attempt to tSeek after end of file */
  33. #define TEREAD     18   /* unable to read */
  34. #define TEWRITE    20   /* unable to write */
  35. #define    TETBLPTR   21    /* invalid table pointer */
  36. #define    TEPROTECT  22    /* protected table */
  37.  
  38. /*----------------------- Function Prototypes ------------------------------*/
  39.  
  40. char *tErrMsg(char *);
  41. char *tFldName(TABLE *,int ,char *);
  42. char *tFldType(TABLE *,unsigned int ,char *);
  43.  
  44. int tClose(TABLE *);
  45. int tDelete(char *);
  46. int tEmpty(char *);
  47. int tExist(char *);
  48. int tFldGet(TABLE *,int ,char *);
  49. int tFldNum(TABLE *,char *);
  50. int tFldPut(TABLE *,int ,char *);
  51. int tFldValidate(char *,char *);
  52. int tMaxTypeSize(char *);
  53. int tNumFlds(TABLE *);
  54. int tNumGet(TABLE *,int ,double *);
  55. int tNumPut(TABLE *,int ,double );
  56. int tShortGet(TABLE *,int ,int *);
  57. int tShortPut(TABLE *,int ,int );
  58. int tUnLink(char *);
  59.  
  60. long tAppend(TABLE *);
  61. long tNextRow(TABLE *);
  62. long tNumRows(TABLE *);
  63. long tPrevRow(TABLE *);
  64. long tSeek(TABLE *,long ,int );
  65. long tTell(TABLE *);
  66.  
  67. TABLE *tCreate(char *,int ,char * *,char * *,int );
  68. TABLE *tOpen(char *);
  69.