aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/gawk.info220
-rw-r--r--doc/gawk.texi21
-rw-r--r--doc/gawktexi.in21
-rw-r--r--gawkapi.h7
6 files changed, 151 insertions, 128 deletions
diff --git a/ChangeLog b/ChangeLog
index fc322609..5212622c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (gawk_api_major_version, gawk_api_minor_version): Add
+ CPP #define values to support conditional compilation.
+
2016-05-02 Arnold D. Robbins <arnold@skeeve.com>
* dfa.h, dfa.c: Sync with grep.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index c7b9d543..4a154218 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawktexi.in: Document new CPP defines gawk_api_major_version and
+ gawk_api_minor_version.
+
2016-04-13 Arnold D. Robbins <arnold@skeeve.com>
* gawkinet.texi: Some general cleanups. Remove stuff commented
diff --git a/doc/gawk.info b/doc/gawk.info
index 16f06d4c..248df6d5 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -25123,13 +25123,16 @@ File: gawk.info, Node: Extension Versioning, Next: Extension API Informational
.............................................
The API provides both a "major" and a "minor" version number. The API
-versions are available at compile time as constants:
+versions are available at compile time as C preprocessor defines to
+support conditional compilation, and as enum constants to facilitate
+debugging:
-'GAWK_API_MAJOR_VERSION'
- The major version of the API
+API Version C preprocessor define enum constant
+---------------------------------------------------------------------------
+Major gawk_api_major_version GAWK_API_MAJOR_VERSION
+Minor gawk_api_minor_version GAWK_API_MINOR_VERSION
-'GAWK_API_MINOR_VERSION'
- The minor version of the API
+Table 16.2: gawk API version constants
The minor version increases when new functions are added to the API.
Such new functions are always added to the end of the API 'struct'.
@@ -26317,7 +26320,7 @@ number and the file name, separated by a forward slash character. On
systems where the directory entry contains the file type, the record has
a third field (also separated by a slash), which is a single letter
indicating the type of the file. The letters and their corresponding
-file types are shown in *note Table 16.2: table-readdir-file-types.
+file types are shown in *note Table 16.3: table-readdir-file-types.
Letter File type
--------------------------------------------------------------------------
@@ -26330,7 +26333,7 @@ Letter File type
's' Socket
'u' Anything else (unknown)
-Table 16.2: File types returned by the 'readdir' extension
+Table 16.3: File types returned by the 'readdir' extension
On systems without the file type information, the third field is
always 'u'.
@@ -35712,106 +35715,107 @@ Node: Creating Arrays1013229
Node: Redirection API1018000
Node: Extension API Variables1020831
Node: Extension Versioning1021464
-Node: Extension API Informational Variables1023355
-Node: Extension API Boilerplate1024419
-Node: Finding Extensions1028233
-Node: Extension Example1028792
-Node: Internal File Description1029590
-Node: Internal File Ops1033670
-Ref: Internal File Ops-Footnote-11045432
-Node: Using Internal File Ops1045572
-Ref: Using Internal File Ops-Footnote-11047955
-Node: Extension Samples1048229
-Node: Extension Sample File Functions1049758
-Node: Extension Sample Fnmatch1057407
-Node: Extension Sample Fork1058894
-Node: Extension Sample Inplace1060112
-Node: Extension Sample Ord1063322
-Node: Extension Sample Readdir1064158
-Ref: table-readdir-file-types1065047
-Node: Extension Sample Revout1065852
-Node: Extension Sample Rev2way1066441
-Node: Extension Sample Read write array1067181
-Node: Extension Sample Readfile1069123
-Node: Extension Sample Time1070218
-Node: Extension Sample API Tests1071566
-Node: gawkextlib1072058
-Node: Extension summary1074505
-Node: Extension Exercises1078197
-Node: Language History1079694
-Node: V7/SVR3.11081350
-Node: SVR41083502
-Node: POSIX1084936
-Node: BTL1086315
-Node: POSIX/GNU1087044
-Node: Feature History1092906
-Node: Common Extensions1107276
-Node: Ranges and Locales1108559
-Ref: Ranges and Locales-Footnote-11113175
-Ref: Ranges and Locales-Footnote-21113202
-Ref: Ranges and Locales-Footnote-31113437
-Node: Contributors1113658
-Node: History summary1119227
-Node: Installation1120607
-Node: Gawk Distribution1121551
-Node: Getting1122035
-Node: Extracting1122996
-Node: Distribution contents1124634
-Node: Unix Installation1130728
-Node: Quick Installation1131410
-Node: Shell Startup Files1133824
-Node: Additional Configuration Options1134902
-Node: Configuration Philosophy1136707
-Node: Non-Unix Installation1139076
-Node: PC Installation1139534
-Node: PC Binary Installation1140854
-Node: PC Compiling1142706
-Ref: PC Compiling-Footnote-11145730
-Node: PC Testing1145839
-Node: PC Using1147019
-Node: Cygwin1151133
-Node: MSYS1151903
-Node: VMS Installation1152404
-Node: VMS Compilation1153195
-Ref: VMS Compilation-Footnote-11154424
-Node: VMS Dynamic Extensions1154482
-Node: VMS Installation Details1156167
-Node: VMS Running1158420
-Node: VMS GNV1162699
-Node: VMS Old Gawk1163434
-Node: Bugs1163905
-Node: Other Versions1168102
-Node: Installation summary1174686
-Node: Notes1175744
-Node: Compatibility Mode1176609
-Node: Additions1177391
-Node: Accessing The Source1178316
-Node: Adding Code1179751
-Node: New Ports1185970
-Node: Derived Files1190458
-Ref: Derived Files-Footnote-11195943
-Ref: Derived Files-Footnote-21195978
-Ref: Derived Files-Footnote-31196576
-Node: Future Extensions1196690
-Node: Implementation Limitations1197348
-Node: Extension Design1198531
-Node: Old Extension Problems1199685
-Ref: Old Extension Problems-Footnote-11201203
-Node: Extension New Mechanism Goals1201260
-Ref: Extension New Mechanism Goals-Footnote-11204624
-Node: Extension Other Design Decisions1204813
-Node: Extension Future Growth1206926
-Node: Old Extension Mechanism1207762
-Node: Notes summary1209525
-Node: Basic Concepts1210707
-Node: Basic High Level1211388
-Ref: figure-general-flow1211670
-Ref: figure-process-flow1212355
-Ref: Basic High Level-Footnote-11215656
-Node: Basic Data Typing1215841
-Node: Glossary1219169
-Node: Copying1251115
-Node: GNU Free Documentation License1288654
-Node: Index1313772
+Ref: gawk-api-version1021901
+Node: Extension API Informational Variables1023657
+Node: Extension API Boilerplate1024721
+Node: Finding Extensions1028535
+Node: Extension Example1029094
+Node: Internal File Description1029892
+Node: Internal File Ops1033972
+Ref: Internal File Ops-Footnote-11045734
+Node: Using Internal File Ops1045874
+Ref: Using Internal File Ops-Footnote-11048257
+Node: Extension Samples1048531
+Node: Extension Sample File Functions1050060
+Node: Extension Sample Fnmatch1057709
+Node: Extension Sample Fork1059196
+Node: Extension Sample Inplace1060414
+Node: Extension Sample Ord1063624
+Node: Extension Sample Readdir1064460
+Ref: table-readdir-file-types1065349
+Node: Extension Sample Revout1066154
+Node: Extension Sample Rev2way1066743
+Node: Extension Sample Read write array1067483
+Node: Extension Sample Readfile1069425
+Node: Extension Sample Time1070520
+Node: Extension Sample API Tests1071868
+Node: gawkextlib1072360
+Node: Extension summary1074807
+Node: Extension Exercises1078499
+Node: Language History1079996
+Node: V7/SVR3.11081652
+Node: SVR41083804
+Node: POSIX1085238
+Node: BTL1086617
+Node: POSIX/GNU1087346
+Node: Feature History1093208
+Node: Common Extensions1107578
+Node: Ranges and Locales1108861
+Ref: Ranges and Locales-Footnote-11113477
+Ref: Ranges and Locales-Footnote-21113504
+Ref: Ranges and Locales-Footnote-31113739
+Node: Contributors1113960
+Node: History summary1119529
+Node: Installation1120909
+Node: Gawk Distribution1121853
+Node: Getting1122337
+Node: Extracting1123298
+Node: Distribution contents1124936
+Node: Unix Installation1131030
+Node: Quick Installation1131712
+Node: Shell Startup Files1134126
+Node: Additional Configuration Options1135204
+Node: Configuration Philosophy1137009
+Node: Non-Unix Installation1139378
+Node: PC Installation1139836
+Node: PC Binary Installation1141156
+Node: PC Compiling1143008
+Ref: PC Compiling-Footnote-11146032
+Node: PC Testing1146141
+Node: PC Using1147321
+Node: Cygwin1151435
+Node: MSYS1152205
+Node: VMS Installation1152706
+Node: VMS Compilation1153497
+Ref: VMS Compilation-Footnote-11154726
+Node: VMS Dynamic Extensions1154784
+Node: VMS Installation Details1156469
+Node: VMS Running1158722
+Node: VMS GNV1163001
+Node: VMS Old Gawk1163736
+Node: Bugs1164207
+Node: Other Versions1168404
+Node: Installation summary1174988
+Node: Notes1176046
+Node: Compatibility Mode1176911
+Node: Additions1177693
+Node: Accessing The Source1178618
+Node: Adding Code1180053
+Node: New Ports1186272
+Node: Derived Files1190760
+Ref: Derived Files-Footnote-11196245
+Ref: Derived Files-Footnote-21196280
+Ref: Derived Files-Footnote-31196878
+Node: Future Extensions1196992
+Node: Implementation Limitations1197650
+Node: Extension Design1198833
+Node: Old Extension Problems1199987
+Ref: Old Extension Problems-Footnote-11201505
+Node: Extension New Mechanism Goals1201562
+Ref: Extension New Mechanism Goals-Footnote-11204926
+Node: Extension Other Design Decisions1205115
+Node: Extension Future Growth1207228
+Node: Old Extension Mechanism1208064
+Node: Notes summary1209827
+Node: Basic Concepts1211009
+Node: Basic High Level1211690
+Ref: figure-general-flow1211972
+Ref: figure-process-flow1212657
+Ref: Basic High Level-Footnote-11215958
+Node: Basic Data Typing1216143
+Node: Glossary1219471
+Node: Copying1251417
+Node: GNU Free Documentation License1288956
+Node: Index1314074

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index fd71dbc9..75deb196 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -34155,15 +34155,18 @@ information about how @command{gawk} was invoked.
@cindex extension API version
The API provides both a ``major'' and a ``minor'' version number.
-The API versions are available at compile time as constants:
-
-@table @code
-@item GAWK_API_MAJOR_VERSION
-The major version of the API
-
-@item GAWK_API_MINOR_VERSION
-The minor version of the API
-@end table
+The API versions are available at compile time as C preprocessor defines
+to support conditional compilation, and as enum constants to facilitate
+debugging:
+
+@float Table,gawk-api-version
+@caption{gawk API version constants}
+@multitable @columnfractions .33 .33 .33
+@headitem API Version @tab C preprocessor define @tab enum constant
+@item Major @tab gawk_api_major_version @tab GAWK_API_MAJOR_VERSION
+@item Minor @tab gawk_api_minor_version @tab GAWK_API_MINOR_VERSION
+@end multitable
+@end float
The minor version increases when new functions are added to the API. Such
new functions are always added to the end of the API @code{struct}.
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index f47c8459..a044c45e 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -33246,15 +33246,18 @@ information about how @command{gawk} was invoked.
@cindex extension API version
The API provides both a ``major'' and a ``minor'' version number.
-The API versions are available at compile time as constants:
-
-@table @code
-@item GAWK_API_MAJOR_VERSION
-The major version of the API
-
-@item GAWK_API_MINOR_VERSION
-The minor version of the API
-@end table
+The API versions are available at compile time as C preprocessor defines
+to support conditional compilation, and as enum constants to facilitate
+debugging:
+
+@float Table,gawk-api-version
+@caption{gawk API version constants}
+@multitable @columnfractions .33 .33 .33
+@headitem API Version @tab C preprocessor define @tab enum constant
+@item Major @tab gawk_api_major_version @tab GAWK_API_MAJOR_VERSION
+@item Minor @tab gawk_api_minor_version @tab GAWK_API_MINOR_VERSION
+@end multitable
+@end float
The minor version increases when new functions are added to the API. Such
new functions are always added to the end of the API @code{struct}.
diff --git a/gawkapi.h b/gawkapi.h
index c708db67..bf6750de 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -260,10 +260,13 @@ typedef struct awk_two_way_processor {
awk_const struct awk_two_way_processor *awk_const next; /* for use by gawk */
} awk_two_way_processor_t;
+#define gawk_api_major_version 1
+#define gawk_api_minor_version 2
+
/* Current version of the API. */
enum {
- GAWK_API_MAJOR_VERSION = 1,
- GAWK_API_MINOR_VERSION = 2
+ GAWK_API_MAJOR_VERSION = gawk_api_major_version,
+ GAWK_API_MINOR_VERSION = gawk_api_minor_version
};
/* A number of typedefs related to different types of values. */