File: par.h

package info (click to toggle)
udo 6.4.1-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,680 kB
  • sloc: ansic: 42,702; makefile: 81; cpp: 19
file content (141 lines) | stat: -rw-r--r-- 4,702 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*	############################################################
	# @(#) par.h
	# @(#)
	# @(#) Copyright (c) 1995-2001 by Dirk Hagedorn
	# @(#) Dirk Hagedorn (udo@dirk-hagedorn.de)
	#
	# This program is free software; you can redistribute it and/or
	# modify it under the terms of the GNU General Public License
	# as published by the Free Software Foundation; either version 2
	# of the License, or (at your option) any later version.
	# 
	# This program is distributed in the hope that it will be useful,
	# but WITHOUT ANY WARRANTY; without even the implied warranty of
	# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	# GNU General Public License for more details.
	# 
	# You should have received a copy of the GNU General Public License
	# along with this program; if not, write to the Free Software
	# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
	#
	############################################################	*/

/*	############################################################
	# Typen
	############################################################	*/
#ifndef UDO_PAR_H
#define UDO_PAR_H

/*	--------------------------------------------------
	Trennvorschlaege
	--------------------------------------------------	*/
#define	HYPHEN_LEN	128

typedef struct _hyphen
{
	char	hyphen[HYPHEN_LEN+1];	/* Wort mit Trennstrichen drin	*/
	char	solo[HYPHEN_LEN+1];		/* gleiches Wort, aber ohne !-	*/
}	HYPHEN, *pHYPHEN;


/*	--------------------------------------------------
	Makros
	--------------------------------------------------	*/
#define	MACRO_NAME_LEN	32
#define	MACRO_CONT_LEN	256

typedef struct _macros
{
	char	name[MACRO_NAME_LEN+1];		/* Der Name des Makros		*/
	char	entry[MACRO_CONT_LEN+1];	/* Der Inhalt des Makros	*/
	BOOLEAN	vars;						/* mit Parametern? PL3		*/
}	MACROS, *pMACROS;


/*	--------------------------------------------------
	Definitionen
	--------------------------------------------------	*/
#define	DEFINE_NAME_LEN	32
#define	DEFINE_CONT_LEN	256

typedef struct _defs
{
	char name[DEFINE_NAME_LEN+1];		/* Der Name der Definition	*/
	char entry[DEFINE_CONT_LEN+1];		/* Der Inhalt				*/
	BOOLEAN	vars;						/* mit Parametern? PL3		*/
}	DEFS, *pDEFS;


/*	--------------------------------------------------
	Allgemeiner Platzhalter
	--------------------------------------------------	*/
typedef struct _placeholder				
{
	char	magic[6];	/* Eine Steuermarke <ESC><0xB0+nr>	*/
	char	*entry;		/* Das komplette Kommando			*/
	char	*text;		/* Nur Text (wichtig fuer toklen())	*/
	BOOLEAN	replaced;	/* TRUE: PH ist bereits ersetzt worden */
}	PLACEHOLDER;


/*	--------------------------------------------------
	Spezielle Platzhalter fuer Formatbefehle
	--------------------------------------------------	*/
typedef struct _speccmd
{
	char	magic[6];	/* Eine Steuermarke <ESC><0xB0+nr>	*/
	char	*entry;		/* Das komplette Kommando			*/
	BOOLEAN	replaced;	/* TRUE: PH ist bereits ersetzt worden */
}	SPECCMD;

#endif	/* UDO_PAR_H */



/*	############################################################
	# globale Variablen
	############################################################	*/
GLOBAL UINT		hyphen_counter;		/* Anzahl von geladenen Trennregeln		*/
GLOBAL UINT		macro_counter;		/* Anzahl geladener Makros				*/
GLOBAL UINT		define_counter;		/* Anzahl geladener defines				*/


/*	############################################################
	# globale Funktionen
	############################################################	*/
GLOBAL void replace_variables ( char *s, const char *cmd, const char *entry);

GLOBAL void reset_speccmds ( void );
GLOBAL BOOLEAN add_speccmd ( char *entry );
GLOBAL BOOLEAN insert_speccmd ( char *s, const char *rep, char *entry );
GLOBAL void replace_speccmds ( char *s );

GLOBAL BOOLEAN add_placeholder ( char *entry, char *rawtext );
GLOBAL BOOLEAN insert_placeholder ( char *s, const char *rep, char *entry, char *rawtext );
GLOBAL void replace_placeholders ( char *s );
GLOBAL void replace_placeholders_text ( char *s );
GLOBAL void reset_placeholders ( void );
GLOBAL size_t pholdlen ( int i );

GLOBAL void c_internal_index ( char *s, const BOOLEAN inside_b4_macro);

GLOBAL void c_commands_inside ( char *s, const BOOLEAN inside_b4_macro );


GLOBAL void replace_hyphens ( char *s );
GLOBAL void add_hyphen ( void );

GLOBAL void replace_macros ( char *s );
GLOBAL BOOLEAN add_macro ( void );

GLOBAL void replace_defines ( char *s );
GLOBAL BOOLEAN add_define ( void );


GLOBAL void init_module_par ( void );
GLOBAL void exit_module_par ( void );

/*	############################################################
	# par.h
	############################################################	*/