
/* 
 * $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: catalog.c 1.1 90/01/19 $@(#)catalog.c	1.1 89/12/01"
#include <stdio.h>
#include "catalog.h"
/*
 * Messages text source files generation
 * Format set according to the X/OPEN specification
 */

extern char *gettxt();
 
/*
 * Message file initialization
 * Force set number to 1 and set quote character to "
 */
void
msg_start(fout)
  FILE *fout;
{
  fprintf(fout, "$quote \"\n");
  fprintf(fout, "$set 1\n");
}

/*
 * messages file end
 */
void
msg_end(fout)
  FILE *fout;
{
}

static char *func_name;

/*
 * Function start : print a comment with function name
 */
void
msg_f_start(fout, funcname)
  FILE *fout;
  char *funcname;
{
  fprintf(fout, gettxt("xs:25","$ Function start : %s\n"), funcname);
  func_name = funcname;
}

/*
 * Function end : print a comment with function name
 */
void
msg_f_end(fout)
  FILE *fout;
{
  fprintf(fout, gettxt("xs:26","$ Function end : %s\n"), func_name);
}

/*
 * String put : print string, preceeded by string number and surrounded
 * by " (which is the quote character : see msg_start)
 */
void
msg_string(fout, nr, string)
  FILE *fout;
  int nr;
  char *string;
{
  fprintf(fout, "%d\t\"%s\"\n", nr, string);
}

/*
 * Put a fixed size string in the file, preceeded by a comment about the
 * length.
 */
void
msg_fixed(fout, nr, string, len)
  FILE *fout;
  int nr, len;
  char *string;
{
  fprintf(fout, gettxt("xs:27","$ %d: Max. length %d\n"), nr, len - 1);
  msg_string(fout, nr, string);
}
/*
 * Add a comment in the messages files
 */
void
msg_comment(fout, string)
  FILE *fout;
  char *string;
{
  fprintf(fout, "$ %s\n", string);
}
