c_ext/c_ext.py
changeset 1734 750eeb7230a1
parent 1511 91538d0c242c
child 1735 c02818d7e29f
equal deleted inserted replaced
1733:dea107dce0c4 1734:750eeb7230a1
    99         text += self.CodeFile.globals.getanyText().strip()
    99         text += self.CodeFile.globals.getanyText().strip()
   100         text += "\n"
   100         text += "\n"
   101         
   101         
   102         # Adding Beremiz confnode functions
   102         # Adding Beremiz confnode functions
   103         text += "/* Beremiz confnode functions */\n"
   103         text += "/* Beremiz confnode functions */\n"
   104         text += "int __init_%s(int argc,char **argv)\n{\n"%location_str
   104         text += "int __init_%s(int argc,char **argv)\n{\n" % location_str
   105         text += self.CodeFile.initFunction.getanyText().strip()
   105         text += self.CodeFile.initFunction.getanyText().strip()
   106         text += "  return 0;\n}\n\n"
   106         text += "  return 0;\n}\n\n"
   107         
   107         
   108         text += "void __cleanup_%s(void)\n{\n"%location_str
   108         text += "void __cleanup_%s(void)\n{\n" % location_str
   109         text += self.CodeFile.cleanUpFunction.getanyText().strip()
   109         text += self.CodeFile.cleanUpFunction.getanyText().strip()
   110         text += "\n}\n\n"
   110         text += "\n}\n\n"
   111         
   111         
   112         text += "void __retrieve_%s(void)\n{\n"%location_str
   112         text += "void __retrieve_%s(void)\n{\n" % location_str
   113         text += self.CodeFile.retrieveFunction.getanyText().strip()
   113         text += self.CodeFile.retrieveFunction.getanyText().strip()
   114         text += "\n}\n\n"
   114         text += "\n}\n\n"
   115         
   115         
   116         text += "void __publish_%s(void)\n{\n"%location_str
   116         text += "void __publish_%s(void)\n{\n" % location_str
   117         text += self.CodeFile.publishFunction.getanyText().strip()
   117         text += self.CodeFile.publishFunction.getanyText().strip()
   118         text += "\n}\n\n"
   118         text += "\n}\n\n"
   119         
   119         
   120         Gen_Cfile_path = os.path.join(buildpath, "CFile_%s.c"%location_str)
   120         Gen_Cfile_path = os.path.join(buildpath, "CFile_%s.c" % location_str)
   121         cfile = open(Gen_Cfile_path,'w')
   121         cfile = open(Gen_Cfile_path,'w')
   122         cfile.write(text)
   122         cfile.write(text)
   123         cfile.close()
   123         cfile.close()
   124         
   124         
   125         matiec_CFLAGS = '"-I%s"'%os.path.abspath(self.GetCTRoot().GetIECLibPath())
   125         matiec_CFLAGS = '"-I%s"' % os.path.abspath(self.GetCTRoot().GetIECLibPath())
   126         
   126         
   127         return [(Gen_Cfile_path, str(self.CExtension.getCFLAGS() + matiec_CFLAGS))],str(self.CExtension.getLDFLAGS()),True
   127         return [(Gen_Cfile_path, str(self.CExtension.getCFLAGS() + matiec_CFLAGS))],str(self.CExtension.getLDFLAGS()),True
   128 
   128