home *** CD-ROM | disk | FTP | other *** search
-
- (c) Copyright Sequiter Software Inc. 1988-1990. All rights reserved.
-
-
- This is information on the Code Base 4 low level sorting routines.
- It is not intended for the user to call these routines directly; it is
- to help those trying to understand Code Base 4 internals. These routines
- are used by the higher level routines 'i4reindex' and 'x4sort'.
-
- We recognize that some users have specialized sorting requirments. If you
- fall into this category of user, use routine 'x4sort' as an example. However,
- be prepared to invest a substantial amount of time. This is not for the
- average user.
-
-
-
- u4sort_add()
-
- Usage int u4sort_add( sort_data_ptr, info_ptr )
-
- Description Specifies some additional information to be sorted.
-
- Parameters Name Meaning
-
- sort_data_ptr An item of data to sort.
-
- info_ptr A pointer to associated information
- such as a record number or a database
- record.
-
-
- u4sort_alloc()
-
- Usage int u4sort_alloc( int num_spools, long tot_records,
- int len_sort_and_info )
-
- Description Allocates memory for the sort.
-
- Returns Value Meaning
-
- 0 Memory Allocated
- -1 Not enough memory
-
-
-
-
- u4sort_free()
-
- Description If 'u4sort_get' signals that all of the sorted values
- have been returned or if an error has been returned
- by a 'sort' routine, it is not necessary to call
- 'u4sort_free'. However, it is possible to free the
- 'sort' memory prematurely by calling 'u4sort_free'.
-
-
-
-
- u4sort_get()
-
- Usage int u4sort_get( (char F_PTR *) ptr_ptr )
-
- Description 'u4sort_get' is used to retrieve all of the sorted values
- in sorted order.
-
- Parameters '*ptr_ptr' is modified to point to the next sort value.
- This value is set to NULL if there are no more items
- to retrieve.
-
- Returns Value Meaning
-
- 0 Success
- -1 Error
-
-
-
-
- u4sort_init()
-
- Usage int u4sort_init( long num_records, int sort_width,
- int info_width )
-
- Description Allocates memory and initializes.
-
- Returns Value Meaning
-
- >= 0 The number of spools used.
- -1 Error
- -2 Not enough memory
-
-
-
-
- u4sort_quick()
-
- Usage void u4sort_quick( (char F_PTR H_PTR) ptr_ptr,
- long n, int width )
-
- Description Performs an itterative quick sort. As recursion is
- not used, the amount of stack memory required is limited.