1 /*
2  * metaseq.h
3  *
4  * handling of the metasequences
5  * Copyright (c) 1988, 89, 90, 91, 92, 93 Miguel Santana
6  * Copyright (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana
7  * $Id: metaseq.h,v 1.13 1998/02/12 09:45:04 demaille Exp $
8  */
9 
10 /*
11  * This file is part of a2ps.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; see the file COPYING.  If not, write to
25  * the Free Software Foundation, 59 Temple Place - Suite 330,
26  * Boston, MA 02111-1307, USA.
27  */
28 
29 /*
30  * $Id: metaseq.h,v 1.13 1998/02/12 09:45:04 demaille Exp $
31  */
32 
33 #ifndef _METASEQ_H_
34 #define _METASEQ_H_
35 
36 struct a2ps_job;
37 struct file_job;
38 struct pair_htable;
39 
40 /* Macro meta sequences hash table */
41 
42 struct pair_htable * macro_meta_sequence_table_new PARAMS ((void));
43 void macro_meta_sequence_table_free PARAMS ((struct pair_htable * table));
44 
45 /* Return true if valid definition, false otherwise */
46 bool macro_meta_sequence_add PARAMS ((struct a2ps_job * job,
47 					 const char * key,
48 					 const char * value));
49 void macro_meta_sequence_delete PARAMS ((struct a2ps_job * job,
50 					 const char * key));
51 char * macro_meta_sequence_get PARAMS ((struct a2ps_job * job,
52 					const char * key));
53 void macro_meta_sequences_list_short PARAMS ((struct a2ps_job * job,
54 					     FILE * stream));
55 
56 void macro_meta_sequences_list_long PARAMS ((struct a2ps_job * job,
57 					    FILE * stream));
58 
59 /*
60  * Expand escape sequences in a string
61  * Note: no malloc is done on the result!
62  * The result must either be used before the following
63  * call to expand_user_string, or strdup'ed
64  */
65 uchar * expand_user_string PARAMS ((struct a2ps_job * job,
66 				    struct file_job * file,
67 				    const uchar * context_name,
68 				    const uchar * str));
69 
70 /* Definition of the integer divertions */
71 #define JOB_NB_PAGES		1
72 #define JOB_NB_SHEETS		2
73 #define JOB_NB_FILES		3
74 #define FILE_NB_PAGES		4
75 #define FILE_NB_SHEETS		5
76 #define FILE_NB_LINES		6
77 #define FILE_LAST_PAGE		7
78 #define FILE_LAST_SHEET		8
79 
80 #define VAR_USER_COMMENTS	"user.comments"
81 #define VAR_USER_HOME		"user.home"
82 #define VAR_USER_HOST		"user.host"
83 #define VAR_USER_LOGIN		"user.login"
84 #define VAR_USER_NAME		"user.name"
85 
86 #define VAR_OPT_VIRTUAL_FORCE	"opt.virtual.force"
87 #endif
88