home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / OOFILE / Buildable, limited OOFILE / c-tree headers / ctsort.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-12  |  3.6 KB  |  90 lines  |  [TEXT/CWIE]

  1. /*
  2.  *    This program is the CONFIDENTIAL and PROPRIETARY property 
  3.  *    of FairCom(R) Corporation. Any unauthorized use, reproduction or
  4.  *    transfer of this computer program is strictly prohibited.
  5.  *
  6.  *      Copyright (c) 1984 - 1994 FairCom Corporation.
  7.  *    This is an unpublished work, and is subject to limited distribution and
  8.  *    restricted disclosure only. ALL RIGHTS RESERVED.
  9.  *
  10.  *            RESTRICTED RIGHTS LEGEND
  11.  *    Use, duplication, or disclosure by the Government is subject to
  12.  *    restrictions set forth in subparagraph (c)(1)(ii) of the Rights in
  13.  *     Technical Data and Computer Software clause at DFARS 252.227-7013.
  14.  *    FairCom Corporation, 4006 West Broadway, Columbia, MO 65203.
  15.  *
  16.  *    c-tree PLUS(tm)    Version 6.4
  17.  *            Release B
  18.  *            October 19, 1994
  19.  */
  20.  
  21. #ifndef ctSORTH
  22. #define ctSORTH
  23.  
  24. #define MAX_HANDLES 5   /* this is the maximum number of file handles */
  25.             /* the sort will try to allocate min=3 the more */
  26.             /* the better.  if it can't get this many it */
  27.             /* use what it can get (min 3) */
  28. #define MAX_K_TO_USE 1000 /* max number of kilobytes the sort will try to */
  29.             /* allocate.  the more the better.  if it can't */
  30.             /* get this much it will use less */
  31. #define MAX_INT_VALUE 65000 /*max value that can be held in an integer */
  32. #define WORK_DRIVE_OR_PATH ""
  33.  
  34. /* Structure that maps global variables */
  35. typedef struct globalv {
  36.     LONG    outpos;        /* file position */
  37.     LONG    wf_pos[MAX_HANDLES];/* file position */
  38.     ppUTEXT ptr_area_p;    /* pointer to pointer area */
  39.     pUTEXT     out_buf;    /* ptr to output buffer */
  40.     pUTEXT     data_area[MAX_HANDLES];/* ptrs to data areas */
  41.     pUTEXT     in_buf;        /* address of current input buffer */
  42.     pUTEXT     m_ptr[MAX_HANDLES];/* pointers to cur rec in merge buf */
  43.     UINT    last_rec_given;    /* last record given by givrec */
  44.     NINT    last_buf;    /* merge buffer assignment */
  45.     NINT    last_buf_moved;    /* last buffer moved from */
  46.     UCOUNT    next_ptr;      /* next pointer number to be used */
  47.     UCOUNT    bytes_in_buf;    /* number of bytes in data buf */
  48.     UCOUNT    cur_data_area;    /* number of current data area */
  49.     UCOUNT    data_area_num;    /* number of data areas allocated */
  50.     UCOUNT    data_area_size; /* data area size in bytes */
  51.     UCOUNT    first_mergefile;/* number of first file to merge */
  52.     UCOUNT    m_bytes_in_buf[MAX_HANDLES];/* num of bytes in each merge buf */
  53.     UCOUNT    num_ptrs;      /* number of pointers that can be held */
  54.     UCOUNT    number_handles; /* number of handles available */
  55.     UCOUNT    out_buf_cur_off;/* current offset into output buffer */
  56.     UCOUNT    out_buf_size;    /* output buffer size in bytes */
  57.     UCOUNT    recl;          /* record length */
  58.     UCOUNT    return_code;      /* main return code */
  59.     UCOUNT    wf_num;        /* num of current workfile (rel 1) */
  60.     COUNT    outnum;
  61.     COUNT   wfnum[MAX_HANDLES];    /* ctree fcb's */
  62.     UTEXT     wf_root[13];    /* init sets to "swtttttt.00 z"  */
  63.     TEXT     filename_hold[64];/* hold area for filename */
  64.     UTEXT     m_eof[MAX_HANDLES];/* eof indicators */
  65.     UTEXT     givrec_subsequent;/* indicates if subsequent givrec */
  66.     UTEXT     in_memory_sort;      /* indicates if in_memory sort */
  67.     UTEXT     m_intermediate;      /* intermediate merge indicator */
  68.     UTEXT     merge1_subsequent;/* indicates subsequent merge1 called */
  69.     UTEXT    no_more_recs;      /* indicates if all recs given */
  70.     UTEXT     sinit_done;    /* flag indicating if sinit done */
  71.     UTEXT     sreturn_started;/* indicates if return phase started */
  72.     } SGLOBV;
  73. typedef SGLOBV ctMEM *    pSGLOBV;
  74.  
  75. #ifdef PROTOTYPE
  76. extern pSGLOBV ctsinit(NINT rec_size,NINT max_hndl);
  77. extern NINT ctsadd(pSGLOBV gv,pVOID rec_area);
  78. extern NINT ctsval(pSGLOBV gv,pVOID rec_area);
  79. extern NINT ctsabort(pSGLOBV gv);
  80. #else /* PROTOTYPE */
  81. extern pSGLOBV ctsinit();
  82. extern NINT ctsadd();
  83. extern NINT ctsval();
  84. extern NINT ctsabort();
  85. #endif /* PROTOTYPE */
  86.  
  87. #endif /* ctSORTH */
  88.  
  89. /* end of ctsort.h */
  90.