Skip to content

Commit f568d04

Browse files
committed
Updated Fortran wrapping script to include FieldmlIoApi.h
1 parent 19ed784 commit f568d04

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

Fortran/InterfaceGen.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def processLine( line, state ):
203203
return state
204204

205205

206-
def processFile():
206+
def processFiles():
207207
headerFile = open( "../core/src/fieldml_api.h" )
208208

209209
state = ParseState.InHeader
@@ -235,6 +235,37 @@ def processFile():
235235

236236
headerFile.close()
237237

238+
headerFile = open( "../io/src/FieldmlIoApi.h" )
239+
240+
state = ParseState.InHeader
241+
inComment = False
242+
243+
for line in headerFile:
244+
startSegment = 0
245+
246+
if( inComment ):
247+
pos = line.find( "*/" )
248+
if( pos == -1 ):
249+
continue
250+
inComment = False
251+
startSegment = pos + 2
252+
253+
#Does not cope with mixing line and block comments.
254+
endSegment = line.find( "/*", startSegment )
255+
while( endSegment != -1 ):
256+
state = processLine( line[ startSegment : endSegment ], state )
257+
startSegment = line.find( "*/", endSegment + 2 )
258+
if( startSegment == -1 ):
259+
break
260+
endSegment = line.find( "/*", startSegment )
261+
262+
if( startSegment == -1 ):
263+
inComment = True
264+
else:
265+
state = processLine( line[ startSegment : ], state )
266+
267+
headerFile.close()
268+
238269

239270
writeHeader()
240271

@@ -261,4 +292,4 @@ def processFile():
261292

262293
writeFooter()
263294

264-
processFile()
295+
processFiles()

0 commit comments

Comments
 (0)