Next: New Ports, Previous: Accessing The Source, Up: Additions [Contents][Index]
You are free to add any new features you like to gawk
.
However, if you want your changes to be incorporated into the gawk
distribution, there are several steps that you need to take in order to
make it possible to include them:
gawk
itself,
consider writing it as an extension
(see Dynamic Extensions).
If that’s not possible, continue with the rest of the steps in this list.
gawk
, or better yet,
relative to the latest code in the Git repository. If your version of
gawk
is very old, I may not be able to integrate your changes at all.
(See Getting,
for information on getting the latest version of gawk
.)
gawk
.
(The GNU Coding Standards are available from
the GNU Project’s
website.
Texinfo, Info, and DVI versions are also available.)
gawk
coding style.
The C code for gawk
follows the instructions in the
GNU Coding Standards, with minor exceptions. The code is formatted
using the traditional “K&R” style, particularly as regards to the placement
of braces and the use of TABs. In brief, the coding rules for gawk
are as follows:
int
, on the
line above the line with the name and arguments of the function.
if
, while
, for
, do
, switch
,
and return
).
for
loop initialization and increment parts, and in macro bodies.
NULL
and '\0'
in the conditions of
if
, while
, and for
statements, as well as in the case
s
of switch
statements, instead of just the
plain pointer or character value.
true
and false
for bool
values,
the NULL
symbolic constant for pointer values,
and the character constant '\0'
where appropriate, instead of 1
and 0
.
alloca()
function for allocating memory off the
stack. Its use causes more portability trouble than is worth the minor
benefit of not having to free the storage. Instead, use malloc()
and free()
.
strcmp()
is not a boolean!”
Instead, use ‘strcmp(a, b) == 0’.
0x001
, 0x002
, 0x004
, and son on) instead of
shifting one left by successive amounts (‘(1<<0)’, ‘(1<<1)’,
and so on).
NOTE: If I have to reformat your code to follow the coding style used in
gawk
, I may not bother to integrate your changes at all.
man
page as well.
You will also have to sign paperwork for your documentation changes.
gawk
source tree with your version.
I recommend using the GNU version of diff
, or best of all,
‘git diff’ or ‘git format-patch’.
Send the output produced by diff
to me when you
submit your changes.
(See Bugs, for the electronic mail
information.)
Using this format makes it easy for me to apply your changes to the
master version of the gawk
source code (using patch
).
If I have to apply the changes manually, using a text editor, I may
not do so, particularly if there are lots of changes.
Although this sounds like a lot of work, please remember that while you may write the new code, I have to maintain it and support it. If it isn’t possible for me to do that with a minimum of extra work, then I probably will not.
Next: New Ports, Previous: Accessing The Source, Up: Additions [Contents][Index]