Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

building C headers

Name: Anonymous 2009-04-30 9:02



#!/usr/bin/env python

import sys

if len(sys.argv) < 2:
    print "Creates a new C module with standard C template"
    print "Usage %s <modname>" % sys.argv[0]
    sys.exit(1)

templ_name = '__%s_H__' % sys.argv[1].upper()

h = open(sys.argv[1] + '.h', 'wt')
h.write('#ifndef %(tmpl)s\n#define %(tmpl)s\n\n\n#endif /* %(tmpl)s */' % \
        {'tmpl':templ_name})
h.close()

c = open(sys.argv[1] + '.c', 'wt')
c.write('#include %s.h' % sys.argv[1])
c.close()

sys.exit(0)

Name: Anonymous 2009-04-30 14:42

>>3
You patched the wrong way, moron.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List