3 This script extracts #defines from those OpenCV headers that can't be
4 directly parsed by current SWIG versions and must be pre-filtered by
5 the C preprocessor (that erases all #defines).
10 for fn in sys.argv[1:]:
13 for l in f.xreadlines():
14 if re.match( r"^#define\s+(CV_|IPL_|cv)\w+\s+", l ):
16 if re.match (r"^#define\s+CV_MAKETYPE", l):
18 if re.match (r"^#define\s+CV_CN", l):
20 if re.match (r"^#define\s+CV_MAT_TYPE", l):
22 if re.match (r"^#define\s+CV_MAT_DEPTH", l):
25 print l[:l.find ('/*')]
26 if not l.endswith( "\\\n" ):