# Path: progSpec.py
# def cdlog(lvl, mesg):
#     global MaxLogLevelToShow
#     global lastLogMesgs
#     global highestLvl
#     highestLvl=lvl
#     resizeLogArray(lvl)
#     lastLogMesgs[lvl]=mesg
#     for i in range(highestLvl+1, len(lastLogMesgs)):
#         lastLogMesgs[i]=''
#     if(lvl<=MaxLogLevelToShow):
#         if(lvl==0): print('')
#         printAtLvl(lvl, mesg, '|    ')
# 
# def cdErr(mesg):
#     global lastLogMesgs
#     global highestLvl
#     highestLvl+=1
#     lastLogMesgs[highestLvl]="\n\nError: "+mesg
#     exit(1)


import progSpec
import codeDogParser
from progSpec import cdlog, cdErr
#/////////////////   pattern_WriteCallProxy.py
#/////////////////  Use this pattern to gererate call proxies. e.g. callback functions

def findStructRef(classes, structTypeName):
    structRef = progSpec.findSpecOf(classes, structTypeName, 'struct')
    if structRef==None:
        cdErr('To build a list GUI for list of "'+structTypeName+'" a struct is needed but is not found.')
    return structRef
def getFieldSpec(fieldName, structRef):
    #print "    Searching",structRef['name'],"for", fieldName
    if structRef==None:

# Path: progSpec.py
# def cdlog(lvl, mesg):
#     global MaxLogLevelToShow
#     global lastLogMesgs
#     global highestLvl
#     highestLvl=lvl
#     resizeLogArray(lvl)
#     lastLogMesgs[lvl]=mesg
#     for i in range(highestLvl+1, len(lastLogMesgs)):
#         lastLogMesgs[i]=''
#     if(lvl<=MaxLogLevelToShow):
#         if(lvl==0): print('')
#         printAtLvl(lvl, mesg, '|    ')
# 
# def cdErr(mesg):
#     global lastLogMesgs
#     global highestLvl
#     highestLvl+=1
#     lastLogMesgs[highestLvl]="\n\nError: "+mesg
#     exit(1)


# Path: pattern_WriteCallProxy.py
import progSpec
import codeDogParser
from progSpec import cdlog, cdErr

#/////////////////   pattern_WriteCallProxy.py
#/////////////////  Use this pattern to gererate call proxies. e.g. callback functions

def findStructRef(classes, structTypeName):
    structRef = progSpec.findSpecOf(classes, structTypeName, 'struct')
    if structRef==None:
        cdErr('To build a list GUI for list of "'+structTypeName+'" a struct is needed but is not found.')
    return structRef
def getFieldSpec(fieldName, structRef):
    #print "    Searching",structRef['name'],"for", fieldName
    if structRef==None:

        cdErr('To build a list GUI for list of "'+structTypeName+'" a struct is needed but is not found.')