[Cobolforgcc-devel] Sort definition
Status: Pre-Alpha
Brought to you by:
timjosling
|
From: Tim J. <te...@me...> - 2000-12-26 18:52:12
|
Ted,
How about this for the basic in core sort? You could do it in one
call but then you would need to reanalyze the sort field details
for each buffer full of records.
Regards,
Tim Josling
/* set up for one or more sorts */
enum cobr_sort_status_enum
cobr_basic_sort_init
(
UINT32 sort_field_count,
struct sort_field_desc* sort_fields,
UINT8* collating_sequence /* 256 bytes in order for text field
sort or NULL */
);
/* do a sort */
enum cobr_sort_status_enum
cobr_basic_sort(
void * handle,
UINT32 record_count,
void** records,
UINT32* record_lengths);
/* free the memory etc */
enum cobr_sort_status_enum
cobr_basic_sort_wrap(void * handle);
struct sort_field_desc
{
UINT32 offset;
UINT32 length;
UINT32 decimals;
UINT32 type;
UINT32 flags;
};
enum cobr_sort_status_enum
{ /* sample only */
cobr_sort_status_OK=0,
cobr_sort_status_invalid_key_definitions,
cobr_sort_status_record_too_short,
...etc...
};
<end>
|