|
@@ -22,9 +22,9 @@ errfile_files = ('../../src/include/gpxe/errfile.h',
|
22
|
22
|
'../../src/arch/i386/include/bits/errfile.h')
|
23
|
23
|
posix_errno_files = ('../../src/include/errno.h', )
|
24
|
24
|
|
25
|
|
-PXENV_STATUS_RE = re.compile(r'^#define\s+(PXENV_STATUS_[^\s]+)\s+(.+)$')
|
26
|
|
-ERRFILE_RE = re.compile(r'^#define\s+(ERRFILE_[^\s]+)\s+(.+)$')
|
27
|
|
-POSIX_ERRNO_RE = re.compile(r'^#define\s+(E[A-Z]+)\s+.*(0x[0-9a-f]+).*$')
|
|
25
|
+PXENV_STATUS_RE = re.compile(r'^#define\s+(PXENV_STATUS_[^\s]+)\s+(.+)$', re.M)
|
|
26
|
+ERRFILE_RE = re.compile(r'^#define\s+(ERRFILE_[^\s]+)\s+(.+)$', re.M)
|
|
27
|
+POSIX_ERRNO_RE = re.compile(r'^#define\s+(E[A-Z0-9]+)\s+(?:\\\n)?.*(0x[0-9a-f]+).*$', re.M)
|
28
|
28
|
|
29
|
29
|
def err(msg):
|
30
|
30
|
sys.stderr.write('%s: %s\n' % (sys.argv[0], msg))
|
|
@@ -41,11 +41,10 @@ def to_posix_errno(errno):
|
41
|
41
|
|
42
|
42
|
def load_header_file(filename, regexp):
|
43
|
43
|
defines = {}
|
44
|
|
- for line in open(filename, 'r'):
|
45
|
|
- m = regexp.match(line)
|
46
|
|
- if m:
|
47
|
|
- key, val = m.groups()
|
48
|
|
- defines[key] = val
|
|
44
|
+ data = open(filename, 'r').read()
|
|
45
|
+ for m in regexp.finditer(data):
|
|
46
|
+ key, val = m.groups()
|
|
47
|
+ defines[key] = val
|
49
|
48
|
return defines
|
50
|
49
|
|
51
|
50
|
def evaluate(defines, expr):
|