summaryrefslogtreecommitdiff
path: root/usr/src/lib/libpp/common/pp.3
blob: 988185bd24ae34e17139907892db5642871fcc04 (plain)
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
.fp 5 CW
.de L		\" literal font
.ft 5
.if !\\$1 \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \f1
..
.de LR
.}S 5 1 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
..
.de RL
.}S 1 5 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
..
.de EX		\" start example
.ta 1i 2i 3i 4i 5i 6i
.PP
.RS 
.PD 0
.ft 5
.nf
..
.de EE		\" end example
.fi
.ft
.PD
.RE
.PP
..
.TH PP 3
.SH NAME \" @(#)pp.3 (gsf@research.att.com) 04/01/92
pp \- ANSI C preprocessor library
.SH SYNOPSIS
.EX
:PACKAGE: ast
#include <pp.h>
%include "pptokens.yacc
\-lpp
.EE
.SH DESCRIPTION
The
.I pp
library provides a tokenizing implementation of the C language preprocessor
and supports K&R (Reiser), ANSI and C++ dialects.
The preprocessor is comprised of 12 public functions,
a global character class table accessed by macros, and
a single global struct with 10 public elements.
.PP
.I pp
operates in two modes.
.I Standalone
mode is used to implement the traditional standalone C preprocessor.
.I Tokeinizing
mode provides a function interface to a stream of preprocessed tokens.
.I pp
is by default ANSI; the only default predefined symbols are
.L __STDC__
and
.LR __STDPP__ .
Dialects (K&R, C++) and local conventions are determined by
compiler specific
.IR probe (1)
information that is included at runtime.
The
.I probe
information can be overridden by providing a file
.L pp_default.h
with pragmas and definitions for each compiler implementation.
This file is usually located in the compiler specific
default include directory.
.PP
Directive, command line argument, option and pragma syntax is described in
.IR cpp (1).
.I pp
specific semantics are described below.
Most semantic differences with standard or classic implementations are in the
form of optimizations.
.PP
Options and pragmas map to
.L ppop
function calls described below.
For the remaining descriptions,
``setting \f5ppop(PP_\fP\fIoperation\fP\f5)\fP''
is a shorthand for calling
.L ppop
with the arguments appropriate for
\f5PP_\fP\fIoperation\fP.
.PP
The library interface describes only the public functions and struct elements.
Static structs and pointers to structs are provided by the library.
The user should not attempt to allocate structs.
In particular,
.L sizeof
is meaningless for
.I pp
supplied structs.
.PP
The global struct
.L pp
provides readonly information.
Any changes to
.L pp
must be done using the functions described below.
.L pp
has the following public elements:
.TP
.L "char* version"
The
.I pp
implementaion version string.
.TP
.L "char* lineid"
The current line sync directive name.
Used for standalone line sync output.
The default value is the empty string.
See the
.L ppline
function below.
.TP
.L "char* outfile"
The current output file name.
.TP
.L "char* pass"
The pragma pass name for
.I pp.
The default value is
.LR pp .
.TP
.L "char* token"
The string representation for the current input token.
.TP
.L "int flags"
The inclusive or of:
.RS
.TP
.L PP_comment
Set if 
.L ppop(PP_COMMENT)
was set.
.TP
.L PP_compatibility
Set if 
.L ppop(PP_COMPATIBILITY)
was set.
.TP
.L PP_linefile
Set if standalone line syncs require a file argument.
.TP
.L PP_linetype
Set if standalone line syncs require a third argument.
The third argument is
.L 1
for include file push,
.L 2
for include file pop and null otherwise.
.TP
.L PP_strict
Set if 
.L ppop(PP_STRICT)
was set.
.TP
.L PP_transition
Set if 
.L ppop(PP_TRANSITION)
was set.
.RE
.TP
.L "struct ppdirs* lcldirs"
The list of directories to be searched for "..." include files.
If the first directory name is "" then it is replaced by the
directory of the including file at include time.
The public elements of
.L "struct ppdirs"
are:
.RS
.TP
.L "char* name"
The directory pathname.
.TP
.L "struct ppdirs* next"
The next directory,
.L 0
if it is the last in the list.
.RE
.TP
.L "struct ppdirs* stddirs"
.L pp.stddirs\->next
is the list of directories to be searched for <...> include files.
This list may be
.LR 0 .
.TP
.L "struct ppsymbol* symbol"
If
.L ppop(PP_COMPILE)
was set then
.L pp.symbol
points to the symbol table entry for the current identifier token.
.L pp.symbol
is undefined for non-identifier tokens.
Once defined, an identifier will always have the same
.L ppsymbol
pointer.
If
.L ppop(PP_NOHASH)
was also set then
.L pp.symbol
is defined for macro and keyword tokens and
.L 0
for all other identifiers.
The elements of
.L "struct ppsymbol"
are:
.RS
.TP
.L "char* name"
The identifier name.
.TP
.L "int flags"
The inclusive or of the following flags:
.PD 0
.RS
.TP
.L SYM_ACTIVE
Currently being expanded.
.TP
.L SYM_BUILTIN
Builtin macro.
.TP
.L SYM_DISABLED
Macro expansion currently disabled.
.TP
.L SYM_FUNCTION
Function-like macro.
.TP
.L SYM_INIT
Initialization macro.
.TP
.L SYM_KEYWORD
Keyword identifier.
.TP
.L SYM_LOADED
Loaded checkpoint macro.
.TP
.L SYM_MULTILINE
.L #macdef
macro.
.TP
.L SYM_NOEXPAND
No identifiers in macro body.
.TP
.L SYM_PREDEFINED
Predefined macro.
.TP
.L SYM_PREDICATE
Also a
.L #assert
predicate.
.TP
.L SYM_READONLY
Readonly macro.
.TP
.L SYM_REDEFINE
Ok to redefine.
.TP
.L SYM_VARIADIC
Variadic function-like macro.
.TP
.L SYM_UNUSED
First unused symbol flag bit index.
The bits from
.L (1<<SYM_UNUSED)
on are initially unset and may be set by the user.
.RE
.PD
.TP
.L "struct ppmacro* macro"
Non-zero if the identifier is a macro.
.L "int macro\->arity"
is the number of formal arguments for function-like macros and
.L "char* macro\->value"
is the macro definition value, a
.L 0
terminated string that may contain internal mark sequences.
.TP
.L "char* value"
Initially set to
.L 0
and never modified by
.IR pp .
This field may be set by the user.
.RE
.TP
.L "Hash_table_t* symtab"
The macro and identifier
.L "struct ppsymbol"
hash table.
The
.IR hash (3)
routines may be used to examine the table, with the exception that the
following macros must be used for individual
.L pp.symtab
symbol lookup:
.RS
.TP
.L "struct ppsymbol* ppsymget(Hash_table_t* table, char* name)"
Return the
.L ppsymbol
pointer for
.LR name ,
0 if
.L name
not defined.
.TP
.L "struct ppsymbol* ppsymset(Hash_table_t* table, char* name)"
Return the
.L ppsymbol
pointer for
.LR name .
If
.L name
is not defined then allocate and return a new
.L ppsymbol
for it.
.RE
.RE
.PP
Error messages are reported using
.IR error (3)
and the following globals relate to
.IR pp :
.TP
.L "int error_info.errors"
The level 2 error count.
Error levels above 2 cause immediate exit.
If
.L error_info.errors
is non-zero then the user program exit status should also be non-zero.
.TP
.L "char* error_info.file"
The current input file name.
.TP
.L "int error_info.line"
The current input line number.
.TP
.L "int error_info.trace"
The debug trace level,
.L 0
by default.
Larger negative numbers produce more trace information.
Enabled when the user program is linked with the
.B \-g
.IR cc (1)
option.
.TP
.L "int error_info.warnings"
The level 1 error count.
Warnings do not affect the exit status.
.PP
The functions are:
.TP
.L "extern int ppargs(char** argv, int last);"
Passed to
.IR optjoin (3)
to parse
.IR cpp (1)
style options and arguments.
The user may also supply application specific option parsers.
Also handles non-standard options like the sun
.L \-undef
and GNU
.LR \-trigraphs .
Hello in there, ever here of
.IR getopt (3)?
.TP
.L "extern void ppcpp(void);"
This is the standalone
.IR cpp (1)
entry point.
.L ppcpp
consumes all of the input and writes the preprocessed text to the output.
A single call to
.L ppcpp
is equivalent to, but more efficient than:
.EX
    ppop(PP_SPACEOUT, 1);
    while (pplex())
	ppprintf(" %s", pp.token);
.EE
.TP
.L "extern int ppcomment(char* head, char* comment, char* tail, int line);"
The default comment handler that passes comments to the output.
May be used as an argument to
.LR ppop(PP_COMMENT) ,
or the user may supply an application specific handler.
.L head
is the comment head text,
.L "/*"
for C and
.L "//"
for C++,
.L comment
is the comment body,
.L tail
is the comment tail text,
.L "*/"
for C and
.B newline
for C++, and
.L line
is the comment starting line number.
.TP
.L "extern void pperror(int level, char* format, ...);"
Equivalent to
.IR error (3).
All
.I pp
error and warning messages pass through
.LR pperror .
The user may link with an application specific
.L pperror
to override the library default.
.TP
.L "extern int ppincref(char* parent, char* file, int line, int push);"
The default include reference handler that outputs
.L file
to the standard error.
May be used as an argument to the
.LR ppop(PP_INCREF) ,
or the user may supply an application specific handler.
.L parent
is the including file name,
.L file
is the current include file name,
.L line
is the current line number in
.LR file ,
and 
.L push
is non-zero if
.L file
is being pushed or
.L 0
if file is being popped.
.TP
.L "extern void ppinput(char* buffer, char* file, int line);"
Pushes the
.L 0
terminated
.L buffer
on the
.I pp
input stack.
.L file
is the pseudo file name used in line syncs for
.L buffer
and
.L line
is the starting line number.
.TP
.L "int pplex(void)"
Returns the token type of the next input token.
.L pp.token
and where applicable
.L pp.symbol
are updated to refer to the new token.
The token type constants are defined in
.L pp.h
for
.L #include
and
.L pp.yacc
for
.IR yacc (1)
.LR %include .
The token constant names match
.LR T_[A-Z_]* ;
some are encoded by oring with
.L N_[A-Z_]*
tokens.
.sp
The numeric constant tokens and encodings are:
.EX
    T_DOUBLE          (N_NUMBER|N_REAL)
    T_DOUBLE_L        (N_NUMBER|N_REAL|N_LONG)
    T_FLOAT           (N_NUMBER|N_REAL|N_FLOAT)
    T_DECIMAL         (N_NUMBER)
    T_DECIMAL_L       (N_NUMBER|N_LONG)
    T_DECIMAL_U       (N_NUMBER|N_UNSIGNED)
    T_DECIMAL_UL      (N_NUMBER|N_UNSIGNED|N_LONG)
    T_OCTAL           (N_NUMBER|N_OCTAL)
    T_OCTAL_L         (N_NUMBER|N_OCTAL|N_LONG)
    T_OCTAL_U         (N_NUMBER|N_OCTAL|N_UNSIGNED)
    T_OCTAL_UL        (N_NUMBER|N_OCTAL|N_UNSIGNED|N_LONG)
    T_HEXADECIMAL     (N_NUMBER|N_HEXADECIMAL)
    T_HEXADECIMAL_L   (N_NUMBER|N_HEXADECIMAL|N_LONG)
    T_HEXADECIMAL_U   (N_NUMBER|N_HEXADECIMAL|N_UNSIGNED)
    T_HEXADECIMAL_UL  (N_NUMBER|N_HEXADECIMAL|N_UNSIGNED|N_LONG)
.EE
The normal C tokens are:
.EX
    T_ID              \fIC identifier\fP
    T_INVALID         \fIinvalid token\fP
    T_HEADER          <..>
    T_CHARCONST       '..'
    T_WCHARCONST      L'..'
    T_STRING          ".."
    T_WSTRING         L".."
    T_PTRMEM          ->
    T_ADDADD          ++
    T_SUBSUB          --
    T_LSHIFT          <<
    T_RSHIFT          >>
    T_LE              <=
    T_GE              >=
    T_EQ              ==
    T_NE              !=
    T_ANDAND          &&
    T_OROR            ||
    T_MPYEQ           *=
    T_DIVEQ           /=
    T_MODEQ           %=
    T_ADDEQ           +=
    T_SUBEQ           -=
    T_LSHIFTEQ        <<=
    T_RSHIFTEQ        >>=
    T_ANDEQ           &=
    T_XOREQ           ^=
    T_OREQ            |=
    T_TOKCAT          ##
    T_VARIADIC        ...
    T_DOTREF          .*    [\fIif\fP PP_PLUSPLUS]
    T_PTRMEMREF       ->*   [\fIif\fP PP_PLUSPLUS]
    T_SCOPE           ::    [\fIif\fP PP_PLUSPLUS]
    T_UMINUS          \fIunary minus\fP
.EE
If
.L ppop(PP_COMPILE)
was set then the keyword tokens are also defined.
Compiler differences and dialects are detected by the
.I pp
.IR probe (1)
information, and only the appropriate keywords are enabled.
The ANSI keyword tokens are:
.EX
T_AUTO          T_BREAK          T_CASE           T_CHAR
T_CONTINUE      T_DEFAULT        T_DO             T_DOUBLE_T
T_ELSE          T_EXTERN         T_FLOAT_T        T_FOR
T_GOTO          T_IF             T_INT            T_LONG
T_REGISTER      T_RETURN         T_SHORT          T_SIZEOF
T_STATIC        T_STRUCT         T_SWITCH         T_TYPEDEF
T_UNION         T_UNSIGNED       T_WHILE          T_CONST
T_ENUM          T_SIGNED         T_VOID           T_VOLATILE
.EE
and the C++ keyword tokens are:
.EX
T_CATCH         T_CLASS          T_DELETE         T_FRIEND
T_INLINE        T_NEW            T_OPERATOR       T_OVERLOAD
T_PRIVATE       T_PROTECTED      T_PUBLIC         T_TEMPLATE
T_THIS          T_THROW          T_TRY            T_VIRTUAL
.EE
In addition,
.L T_ASM
is recognized where appropriate.
Additional keyword tokens
.L ">= T_KEYWORD"
may be added using
.LR ppop(PP_COMPILE) .
.sp
Many C implementations show no restraint in adding new keywords; some
PC compilers have tripled the number of keywords.
For the most part these new keywords introduce noise constructs that
can be ignored for standard
.RI ( reasonable )
analysis and compilation.
The noise keywords fall in four syntactic categories that map into the two
noise keyword tokens
.L T_NOISE 
and 
.LR T_NOISES .
For
.L T_NOISES
.L pp.token
points to the entire noise construct, including the offending noise keyword.
The basic noise keyword categories are:
.RS
.TP
.L T_NOISE
The simplest noise: a single keyword that is noise in any context and maps to
.LR T_NOISE .
.TP
.L T_X_GROUP
A noise keyword that precedes an optional grouping construct, either
.L "(..)"
or
.L "{..}"
and maps to
.LR T_NOISES .
.TP
.L T_X_LINE
A noise keyword that consumes the remaining tokens in the line
and maps to
.LR T_NOISES .
.TP
.L T_X_STATEMENT
A noise keyword that consumes the tokens up to the next
.L ;
and maps to
.LR T_NOISES .
.RE
.sp
If
.L ppop(PP_NOISE)
is
.L "> 0"
then implementation specific noise constructs are mapped to either
.L T_NOISE
or
.L T_NOISES ,
otherwise if
.L ppop(PP_NOISE)
is
.L "< 0"
then noise constructs are completely ignored,
otherwise the unmapped grouping noise tokens
.L T_X_.*
are returned.
.sp
Token encodings may be tested by the following macros:
.RS
.TP
.L "int isnumber(int token);"
Non-zero if
.L token
is an integral or floating point numeric constant.
.TP
.L "int isinteger(int token);"
Non-zero if
.L token
is an integral numeric constant.
.TP
.L "int isreal(int token);"
Non-zero if
.L token
is a floating point numeric constant.
.TP
.L "int isassignop(int token);"
Non-zero if
.L token
is a C assignment operator.
.TP
.L "int isseparate(int token);"
Non-zero if
.L token
must be separated from other tokens by
.BR space .
.TP
.L "int isnoise(int token);"
Non-zero if
.L token
is a noise keyword.
.RE
.TP
.L "extern int ppline(int line, char* file);"
The default line sync handler that outputs line sync pragmas for the C compiler
front end.
May be used as an argument to
.LR ppop(PP_LINE) ,
or the user may supply an application specific handler.
.L line
is the line number and
.L file
is the file name.
If
.L ppop(PP_LINEID)
was set then the directive
\fB#\fP \fIlineid line \fP"\fIfile\fP" is output.
.TP
.L "extern int ppmacref(struct ppsymbol* symbol, char* file, int line, int type);"
The default macro reference handler that outputs a macro reference pragmas.
May be used as an argument to
.LR ppop(PP_MACREF) ,
or the user may supply an application specific handler.
.L symbol
is the macro
.L ppsymbol
pointer,
.L file
is the reference file,
.L line
is the reference line,
and if
.L type
is non-zero a macro value checksum is also output.
The pragma syntax is
\fB#pragma pp:macref\fP "\fIsymbol\->name\fP" \fIline checksum\fP.
.TP
.L "int ppop(int op, ...)"
.L ppop
is the option control interface.
.L op
determines the type(s) of the remaining argument(s).
Options marked by
.L "/*INIT*/"
must be done before
.LR PP_INIT .
.RS
.TP
.L "(PP_ASSERT, char* string) /*INIT*/"
.L string
is asserted as if by
.LR #assert .
.TP
.L "(PP_BUILTIN, char*(*fun)(char* buf, char* name, char* args)) /*INIT*/"
Installs 
.L fun
as the unknown builtin macro handler.
Builtin macros are of the form
.LR "#(name args)" .
.L fun 
is called with
.L name
set to the unknown builtin macro name and
.L args
set to the arguments.
.L buf
is a
.L MAXTOKEN+1
buffer that can be used for the
.L fun
return value.
.L 0
should be returned on error.
.TP
.L "(PP_COMMENT,void (*fun)(char*head,char*body,char*tail,int line) /*INIT*/"
.TP
.L "(PP_COMPATIBILITY, char* string) /*INIT*/"
.TP
.L "(PP_COMPILE, char* string) /*INIT*/"
.TP
.L "(PP_DEBUG, char* string) /*INIT*/"
.TP
.L "(PP_DEFAULT, char* string) /*INIT*/"
.TP
.L "(PP_DEFINE, char* string) /*INIT*/"
.L string
is defined as if by
.LR #define .
.TP
.L "(PP_DIRECTIVE, char* string) /*INIT*/"
The directive
.BI # string
is executed.
.TP
.L "(PP_DONE, char* string) /*INIT*/"
.TP
.L "(PP_DUMP, char* string) /*INIT*/"
.TP
.L "(PP_FILEDEPS, char* string) /*INIT*/"
.TP
.L "(PP_FILENAME, char* string) /*INIT*/"
.TP
.L "(PP_HOSTDIR, char* string) /*INIT*/"
.TP
.L "(PP_HOSTED, char* string) /*INIT*/"
.TP
.L "(PP_ID, char* string) /*INIT*/"
.TP
.L "(PP_IGNORE, char* string) /*INIT*/"
.TP
.L "(PP_INCLUDE, char* string) /*INIT*/"
.TP
.L "(PP_INCREF, char* string) /*INIT*/"
.TP
.L "(PP_INIT, char* string) /*INIT*/"
.TP
.L "(PP_INPUT, char* string) /*INIT*/"
.TP
.L "(PP_LINE, char* string) /*INIT*/"
.TP
.L "(PP_LINEFILE, char* string) /*INIT*/"
.TP
.L "(PP_LINEID, char* string) /*INIT*/"
.TP
.L "(PP_LINETYPE, char* string) /*INIT*/"
.TP
.L "(PP_LOCAL, char* string) /*INIT*/"
.TP
.L "(PP_MACREF, char* string) /*INIT*/"
.TP
.L "(PP_MULTIPLE, char* string) /*INIT*/"
.TP
.L "(PP_NOHASH, char* string) /*INIT*/"
.TP
.L "(PP_NOID, char* string) /*INIT*/"
.TP
.L "(PP_NOISE, char* string) /*INIT*/"
.TP
.L "(PP_OPTION, char* string) /*INIT*/"
The directive
\fB#pragma pp:\fP\fIstring\fP
is executed.
.TP
.L "(PP_OPTARG, char* string) /*INIT*/"
.TP
.L "(PP_OUTPUT, char* string) /*INIT*/"
.TP
.L "(PP_PASSNEWLINE, char* string) /*INIT*/"
.TP
.L "(PP_PASSTHROUGH, char* string) /*INIT*/"
.TP
.L "(PP_PLUSPLUS, char* string) /*INIT*/"
.TP
.L "(PP_PRAGMA, char* string) /*INIT*/"
.TP
.L "(PP_PREFIX, char* string) /*INIT*/"
.TP
.L "(PP_PROBE, char* string) /*INIT*/"
.TP
.L "(PP_READ, char* string) /*INIT*/"
.TP
.L "(PP_RESERVED, char* string) /*INIT*/"
.TP
.L "(PP_SPACEOUT, char* string) /*INIT*/"
.TP
.L "(PP_STANDALONE, char* string) /*INIT*/"
.TP
.L "(PP_STANDARD, char* string) /*INIT*/"
.TP
.L "(PP_STRICT, char* string) /*INIT*/"
.TP
.L "(PP_TEST, char* string) /*INIT*/"
.TP
.L "(PP_TRUNCATE, char* string) /*INIT*/"
.TP
.L "(PP_UNDEF, char* string) /*INIT*/"
.TP
.L "(PP_WARN, char* string) /*INIT*/"
.RE
.TP
.L "int pppragma(char* dir, char* pass, char* name, char* value, int nl);"
The default handler that
copies unknown directives and pragmas to the output.
May be used as an argument to
.LR ppop(PP_PRAGMA) ,
or the user may supply an application specific handler.
This function is most often called after directive and pragma mapping.
Any of the arguments may be
.LR 0 .
.L dir
is  the directive name,
.L pass
is the pragma pass name,
.L name
is the pragma option name,
.L value
is the pragma option value, and
.L nl
is non-zero
if a trailing newline is required if the pragma is copied to the output.
.TP
.L "int ppprintf(char* format, ...);"
A
.IR printf (3)
interface to the standalone
.I pp
output buffer.
Macros provide limited control over output buffering:
.L "void ppflushout()"
flushes the output buffer,
.L "void ppcheckout()"
flushes the output buffer if over
.L PPBUFSIZ
character are buffered,
.L "int pppendout()"
returns the number of pending character in the output buffer, and
.L "void ppputchar(int c)"
places the character
.L c
in the output buffer.
.SH CAVEATS
The ANSI mode is intended to be true to the standard.
The compatibility mode has been proven in practice, but there are
surely dark corners of some implementations that may have been omitted.
.SH "SEE ALSO"
cc(1), cpp(1), nmake(1), probe(1), yacc(1),
.br
ast(3), error(3), hash(3), optjoin(3)
.SH AUTHOR
Glenn Fowler
.br
(Dennis Ritchie provided the original table driven lexer.)
.br
AT&T Bell Laboratories