summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2011-12-26 21:35:57 +0000
committerHisham Muhammad <hisham@gobolinux.org>2011-12-26 21:35:57 +0000
commit84281bdc44ea42e110efd256cdcdd37a84276204 (patch)
tree77b2b1f5e8bfc57bd6bdb82ac215e84d9f3179e2 /scripts
parent81e44312b4976d5516f129f36a67fe381bcb6883 (diff)
major header cleanup
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/MakeHeader.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/MakeHeader.py b/scripts/MakeHeader.py
index a84ae74b..55eeed45 100755
--- a/scripts/MakeHeader.py
+++ b/scripts/MakeHeader.py
@@ -30,6 +30,7 @@ out.write( "" )
out.write( "#ifndef HEADER_" + name )
out.write( "#define HEADER_" + name )
+is_blank = False
for line in file.readlines():
line = line[:-1]
if state == ANY:
@@ -37,6 +38,8 @@ for line in file.readlines():
state = COPY
elif line == selfheader:
pass
+ elif line.find("#include") == 0:
+ pass
elif line.find("htop - ") == 0 and line[-2:] == ".c":
out.write(line[:-2] + ".h")
elif line.find("static ") != -1:
@@ -58,14 +61,22 @@ for line in file.readlines():
state = SKIP
else:
out.write( line )
+ is_blank = False
+ elif line == "":
+ if not is_blank:
+ out.write( line )
+ is_blank = True
else:
out.write( line )
+ is_blank = False
elif state == COPY:
+ is_blank = False
if line == "}*/":
state = ANY
else:
out.write( line )
elif state == SKIP:
+ is_blank = False
if len(line) >= 1 and line[0] == "}":
if static == 1:
state = SKIPONE
@@ -73,6 +84,7 @@ for line in file.readlines():
state = ANY
static = 0
elif state == SKIPONE:
+ is_blank = False
state = ANY
out.write( "" )

© 2014-2024 Faster IT GmbH | imprint | privacy policy