/*
* 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 (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* EMACS_MODES: !fill, lnumb, !overwrite, !nodelete, !picture */
/**
** The disk copy of the filter table:
**/
/*
* There are 9 fields in the filter table (the first one is ignored).
*/
# define FL_IGN 0
/*
* Various strings.
*/
/**
** The internal copy of a filter as seen by the rest of the world:
**/
typedef enum FILTERTYPE {
} FILTERTYPE;
/*
* A (char **) list is an array of string pointers (char *) with
* a null pointer after the last item.
*/
typedef struct FILTER {
} FILTER;
/**
** The internal copy of a filter as seen by the filter routines:
**/
/*
* To speed up processing the filter table, FL_MAX_GUESS slots
* will be preallocated for the internal copy. If filter tables
* are expected to be substantially larger than this, bump it up.
*/
typedef struct TYPE {
char * name;
} TYPE;
typedef struct TEMPLATE {
char * keyword;
char * pattern;
char * re;
char * result;
int nbra;
} TEMPLATE;
/*
* A (TYPE *) list is an array of content-types (TYPE) with a null
* "name" element. A (TEMPLATE *) list is an array of templates (TEMPLATE)
* with a null "keyword" element.
*/
typedef struct _FILTER {
char * name;
char * command;
char ** printers;
unsigned char mark,
} _FILTER;
/**
** Various routines.
**/
/*
* Null terminated list (filters[i].name == NULL).
*/
#if defined(__STDC__)
_FILTER * search_filter ( char * );
FILTERTYPE insfilter ( char ** , char * , char * , char * , char * , char ** , unsigned short * );
FILTERTYPE s_to_filtertype ( char * );
TEMPLATE s_to_template ( char * );
TEMPLATE * sl_to_templatel ( char ** );
TYPE * sl_to_typel ( char ** );
char * template_to_s ( TEMPLATE );
char ** templatel_to_sl ( TEMPLATE * );
char ** typel_to_sl ( TYPE * );
int open_filtertable ( char * , char * );
int get_and_load ( void );
int delfilter ( char * );
int loadfilters ( char * );
int dumpfilters( char * );
void freefilter ( FILTER * );
void free_filter ( _FILTER * );
void trash_filters ( void );
void close_filtertable ( FILE * );
#else
extern _FILTER *search_filter();
extern FILTERTYPE insfilter(),
*sl_to_typel();
extern TEMPLATE s_to_template(),
*sl_to_templatel();
#if defined(BUFSIZ)
extern FILE *open_filtertable();
#endif
extern char **typel_to_sl(),
**templatel_to_sl(),
*getfilterfile();
extern int putfilter(),
delfilter(),
loadfilters(),
get_and_load();
extern void freefilter(),
free_filter(),
freetempl(),
#endif