/*
* 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_UTILITY_H
#define _SORT_UTILITY_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <libintl.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <wchar.h>
#include "types.h"
#ifndef TRUE
#endif /* TRUE */
#ifndef FALSE
#define FALSE 0
#endif /* FALSE */
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#define EMSG_CHECK \
gettext("check option (-c) only for use with a single file\n")
#define EMSG_MEMORY \
gettext("insufficient memory; use -S option to increase allocation\n")
#define WMSG_NEWLINE_ADDED \
gettext("missing NEWLINE added at end of input file %s\n")
extern void warn(const char *, ...);
extern void die(const char *, ...);
extern void usage(void);
extern void swap(void **, void **);
extern int bump_file_template();
extern char *get_file_template();
extern void set_file_template(char **);
extern void set_cleanup_chain(stream_t **);
extern void set_output_file(char *);
extern void set_output_guard(stream_t *);
extern void clear_output_guard(void);
extern void establish_output_guard(sort_t *);
extern void remove_output_guard();
extern void atexit_handler(void);
extern void set_memory_ratio(sort_t *, int *, int *);
extern void *safe_realloc(void *, size_t);
extern void safe_free(void *);
extern void hold_file_descriptor(void);
extern void release_file_descriptor(void);
extern int xstreql(const char *, const char *);
#ifdef _LITTLE_ENDIAN
#endif /* _LITTLE_ENDIAN */
#ifdef DEBUG
#else
#define ASSERT(x)
#endif
#ifdef STATS
#define __S(x) x
#else
#define __S(x)
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SORT_UTILITY_H */