~ubuntu-branches/ubuntu/natty/libgpg-error/natty

« back to all changes in this revision

Viewing changes to src/mkheader.awk

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-12-03 13:46:24 UTC
  • Revision ID: james.westby@ubuntu.com-20101203134624-01r58mt17j1kh6xe
Tags: 1.10-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
  codes_nr = 0;
59
59
# errnos_nr holds the number of system errors.
60
60
  errnos_nr = 0;
 
61
# extra_nr holds the number of extra lines to be included.
 
62
  extra_nr = 0
61
63
 
62
64
# These variables walk us through our input.
63
65
  sources_header = 1;
66
68
  codes_body = 0;
67
69
  between_codes_and_errnos = 0;
68
70
  errnos_body = 0;
 
71
  extra_body = 0;
69
72
  gpg_error_h = 0;
70
73
 
71
 
  print "/* Output of mkheader.awk.  DO NOT EDIT.  */";
 
74
  print "/* Output of mkheader.awk.  DO NOT EDIT.  -*- buffer-read-only: t -*- */";
72
75
  print "";
73
76
 
74
77
}
75
78
 
 
79
 
76
80
sources_header {
77
81
  if ($1 ~ /^[0123456789]+$/)
78
82
    {
148
152
 
149
153
  if ($1 !~ /^[0-9]/)
150
154
    {
151
 
# Note that this assumes that gpg-error.h.in doesn't start with a digit.
 
155
# Note that this assumes that extra_body.in doesn't start with a digit.
152
156
      errnos_body = 0;
153
 
      gpg_error_h = 1;
 
157
      extra_body = 1;
154
158
    }
155
159
  else
156
160
    {
160
164
    }
161
165
}
162
166
 
 
167
extra_body {
 
168
  if (/^##/)
 
169
    next
 
170
 
 
171
  if (/^EOF/)
 
172
    {
 
173
      extra_body = 0;
 
174
      gpg_error_h = 1;
 
175
      next;
 
176
    }
 
177
  else
 
178
    {
 
179
      extra_line[extra_nr] = $0;
 
180
      extra_nr++;
 
181
    }
 
182
}
 
183
 
163
184
gpg_error_h {
164
185
  if ($0 ~ /^@include err-sources/)
165
186
    {
180
201
  else if ($0 ~ /^@include errnos/)
181
202
    {
182
203
      for (i = 0; i < errnos_nr; i++)
 
204
       {
 
205
         print "    " errnos_sym[i] " = " errnos_idx[i] ",";
 
206
#        print "#define " errnos_sym[i] " (" errnos_idx[i] ")";
 
207
       }
 
208
    }
 
209
  else if ($0 ~ /^@include extra-h.in/)
 
210
    {
 
211
      for (i = 0; i < extra_nr; i++)
183
212
        {
184
 
          print "    " errnos_sym[i] " = " errnos_idx[i] ",";
185
 
#         print "#define " errnos_sym[i] " (" errnos_idx[i] ")";
 
213
            print extra_line[i];
186
214
        }
187
215
    }
188
216
  else