File: record.h

package info (click to toggle)
msort 8.53-2.2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,360 kB
  • sloc: sh: 10,138; ansic: 10,031; makefile: 51
file content (38 lines) | stat: -rw-r--r-- 851 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * The key associated with a record may be a sequence of codes,
 * a (pointer to a) floating point number, a numeric string struct,
 * or a hybrid structure.
 */	 

struct HybridList {
  unsigned char cnt;		/* Number of subparts - high bit indicates first bit is numeric */
  long int *ilist;		/* Numeric portions */
  wchar_t **tlist;		/* Textual portions */
};

union key{
  wchar_t *t;
#ifdef HAVE_LONGDOUBLE
  long double *n;
#else
  double *n;
#endif
  struct {
    int   cnt;
    char *txt;
    char sign;
  } N;
  struct HybridList *H;
};

/*
 * A record contains the text, and a list of the keys extracted
 * from the record.
 */

struct record{
  size_t length;		/* Length of text in characters */
  UTF8 *text;			/* The text itself */
  off_t fpos;			/* File offset for semi-external sort */
  union key *klistptr;		/* List of keys */
};