#undef TRACEPOINT_PROVIDER
#define TRACEPOINT_PROVIDER {providerName}
-#undef TRACEPOINT_INCLUDE_FILE
-#define TRACEPOINT_INCLUDE_FILE ./{headerFilename}
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "./{headerFilename}"
#ifdef __cplusplus
extern "C"{{
def write(self):
outputFile = open(self.outputFilename,"w")
- includeGuard = self.outputFilename.upper().replace(".","_")
+ # Include guard macro will be created by uppercasing the filename and
+ # replacing all non alphanumeric characters with '_'
+ includeGuard = re.sub('[^0-9a-zA-Z]', '_', self.outputFilename.upper())
outputFile.write(HeaderFile.HEADER_TPL.format(providerName=self.template.domain,
includeGuard = includeGuard,
opts, args = getopt.gnu_getopt(argv[1:], "ho:a", ["help"])
except getopt.error, msg:
raise Usage(msg)
- if len(args) == 0:
- raise Usage("No template file given")
except Usage, err:
print >>sys.stderr, err.msg
outputNames.append(a)
if o in ("-a",""):
all = True
+ try:
+ if len(args) == 0:
+ raise Usage("No template file given")
+
+ except Usage, err:
+ print >>sys.stderr, err.msg
+ print >>sys.stderr, "for help use --help"
+ return 2
doCFile = None
doHeader = None
# process arguments
for arg in args:
+ if arg[-3:] != ".tp":
+ print arg + " does not end in .tp. Skipping."
+ continue
tpl = None
try: