/* 
 * $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

/*	Copyright (c) 1984 AT&T	*/
/*	  All Rights Reserved  	*/

/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
/*	The copyright notice above does not evidence any   	*/
/*	actual or intended publication of such source code.	*/
#ident "$Header: nl_type2.h 1.4 90/06/24 $@(#)nl_type2.h	1.1 89/12/06 "

#ifndef _NL_TYPE2_H_
struct cat_msg {
  int msg_nr;			/* The message number */
  int msg_len;			/* The actual message len */
  long msg_off;			/* The message offset in the temporary file */
  char *msg_ptr;		/* A pointer to the actual message */
  struct cat_msg *msg_next;     /* Next element in list */
};

struct cat_set {
  int set_nr;			/* The set number */
  int set_msg_nr;		/* The number of messages in the set */
  struct cat_msg *set_msg;	/* The associated message list */
  struct cat_set *set_next;	/* Next set in list */
};

struct cat_lib_set {
  int first_in_set;
  int largest_number;
};

/*
 * library format set
 * information
 */
struct l_cat_set {
  int first_msg;		/* The first message number */
  int last_msg;			/* The last message in the set */
};

struct cat_hdr {
  long hdr_magic;		/* The magic number */
  int hdr_set_nr;		/* Set nr in file */
  int hdr_mem;			/* The space needed to load the file */
  long hdr_off_msg_hdr;		/* Position of messages headers in file */
  long hdr_off_msg;		/* Position of messages in file */
};

struct cat_set_hdr {
  int shdr_set_nr;		/* The set number */
  int shdr_msg_nr;		/* Number of messages in set */
  int shdr_msg;			/* Start offset of messages in messages list */
};

struct cat_msg_hdr{
  int msg_nr;			/* The messge number */
  int msg_len;			/* message len */
  int msg_ptr;			/* message offset in table */
};

#define CAT_MAGIC	0xFF88FF89

typedef int bool;
#define FALSE 0
#define TRUE  1
#ifndef NO_XPG3_HDR
extern void *malloc();
#else
extern char *malloc();
#endif	/* NO_XPG3_HDR */

#ifdef GENCAT
struct cat_set *get_set_ptr();
struct cat_msg *get_msg_ptr();
extern char msg_buf[];
extern struct cat_set *sets;
extern int curset;
extern FILE *tempfile;
#define CMD_SET		"set"
#define CMD_SET_LEN	3
#define CMD_DELSET	"delset"
#define CMD_DELSET_LEN	6
#define CMD_QUOTE	"quote"
#define CMD_QUOTE_LEN	5
#define MSIZE 128
#else
char *cat_get_msg();
#endif

/*
 * Default search pathname
 */
#define DEF_NLSPATH	"/usr/lib/message/%l/%N"
#define _NL_TYPE2_H_

#endif /* _NL_TYPE2_H_ */
