types.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1998-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SORT_TYPES_H
#define _SORT_TYPES_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/resource.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
typedef int flag_t;
typedef union vchar {
char sc;
} vchar_t;
typedef union vcharptr {
char *sp;
} vcharptr_t;
typedef struct line_rec {
} line_rec_t;
enum field_species {
};
#define FIELD_DICTIONARY_ORDER 0x1
#define FIELD_FOLD_UPPERCASE 0x2
#define FIELD_IGNORE_NONPRINTABLES 0x4
#define FIELD_IGNORE_BLANKS_START 0x8
#define FIELD_IGNORE_BLANKS_END 0x10
#define FIELD_REVERSE_COMPARISONS 0x20
#define FIELD_MODIFIERS_DEFINED 0x40
typedef struct field {
/*
* field ops vector
*/
enum field_species f_species;
/*
* starting and ending fields, and offsets
*/
int f_start_field;
int f_end_field;
} field_t;
#define STREAM_SOURCE_MASK 0x000f
#define STREAM_NO_SOURCE 0x0000
#define STREAM_ARRAY 0x0001
#define STREAM_MMAP 0x0002
#define STREAM_SINGLE 0x0004
#define STREAM_WIDE 0x0008
#define STREAM_OPEN 0x0010
#define STREAM_PRIMED 0x0020
#define STREAM_OUTPUT 0x0040
#define STREAM_EOS_REACHED 0x0080
#define STREAM_NOTFILE 0x0100
#define STREAM_UNIQUE 0x0200
#define STREAM_INSTANT 0x0400
#define STREAM_TEMPORARY 0x0800
#define STREAM_NOT_FREEABLE 0x1000
#define CHAR_AVG_LINE 32
#define XFRM_MULTIPLIER 8
#define NEXT_LINE_COMPLETE 0x0
#define NEXT_LINE_INCOMPLETE 0x1
#define PRIME_SUCCEEDED 0x0
#define PRIME_FAILED_EMPTY_FILE 0x1
#define PRIME_FAILED 0x2
typedef struct stream_array {
typedef struct stream_simple_file {
/*
* stream_simple_file_t is used for STREAM_MMAP and for STREAM_OUTPUT
* for either single- (STREAM_SINGLE | STREAM_OUTPUT) or multi-byte
* (STREAM_WIDE | STREAM_OUTPUT) locales.
*/
int s_fd; /* file descriptor */
typedef struct stream_buffered_file {
/*
* stream_buffered_file_t is used for both STREAM_STDIO and
* STREAM_WIDE.
*/
void *s_vbuf; /* stdio alternate buffer */
typedef union stream_type {
struct stream;
typedef struct stream_ops {
int (*sop_is_closable)(struct stream *);
int (*sop_open_for_write)(struct stream *);
void (*sop_release_line)(struct stream *);
void (*sop_send_eol)(struct stream *);
int (*sop_unlink)(struct stream *);
} stream_ops_t;
/*
* The stream_t type is provided to simplify access to files, particularly for
* external merges.
*/
typedef struct stream {
struct stream *s_previous;
char *s_filename;
void *s_buffer;
} stream_t;
/*
* sort(1) has, for debugging purposes, a primitive compile-time option to
* generate statistics of various operations executed during an invocation.
* These statistics are recorded in the following sort_statistics_t structure.
*/
typedef struct sort_statistics {
typedef struct sort {
char *m_output_filename;
char *m_tmpdir_template;
vchar_t);
} sort_t;
#ifdef __cplusplus
}
#endif
#endif /* _SORT_TYPES_H */