home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Utilities / Miscellaneous / CopyPaste 3.3.4 / CopyPaste Tools Sourcecode / Selection Sort.c / ToolSort.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-06  |  1.4 KB  |  49 lines  |  [TEXT/KAHL]

  1. #ifndef _ToolSort_
  2. #define _ToolSort_
  3.  
  4. #include <stdio.h>
  5.  
  6. #define    NIL                0L
  7.  
  8. #define No_Error        0
  9. #define    End_Error        1    /* Selection must end with a carriage return. */
  10. #define Type_Error        2    /* No selection of type 'TEXT' in scarp. */
  11. #define Memory_Error     4    /* Not enough memory. */
  12. #define Nil_Hand_Error     8    /* Nil Handle Error. */
  13. #define Empty_Error     16    /* No selection, scrap empty. */
  14. #define Sys_Error        32    /* A system error, probably relating to the filing system. */
  15. #define Scrap_Error        64    /* Error writing desk scrap. */
  16. #define TEScrap_Error    128    /* Error writing writing TEScrap. */
  17.  
  18. #define alertID     2
  19.  
  20. typedef struct SelLineRec
  21.     {
  22.     int        noLines;
  23.     Handle    *lines;        /* array of Handles of lines of text */
  24.     } SelLine;
  25.  
  26. typedef struct SelRec
  27.     {
  28.     long    length;        /* length of selection */
  29.     Handle    sel;        /* handle to selection */
  30.     } SelRec;
  31.  
  32. typedef    Handle Text;
  33.  
  34.  
  35. /******************* Function Prototypes ******************************/
  36.  
  37. int Bubble(void *elem, int big, int num, int (*comp)(), int (*set)() ); 
  38. int BuildLines( SelRec validSel, SelLine * selLine );
  39. int Comp( Handle *e1, Handle* e2 );
  40. void GetValidSel(SelRec *validSel);
  41. int SelToText( SelLine sortSel, Text *txt );
  42. int Set( Handle *e1, Handle* e2 );
  43. int ShellSort(void *elem, int big, int num, int (*comp)(), int (*set)() ); 
  44. int Swap( Handle *e1, Handle* e2 );
  45. int UpdateSel( Handle txt );
  46.  
  47. void main(void);
  48.  
  49. #endif