plugins/c_ext/c_ext.py
changeset 137 187a4e2412e5
parent 106 9810689febb0
child 145 94855f7b08a9
equal deleted inserted replaced
136:f49f586a0a43 137:187a4e2412e5
   142             f.write("/* Header generated by Beremiz c_ext plugin */\n")
   142             f.write("/* Header generated by Beremiz c_ext plugin */\n")
   143             f.write("#include \"iec_std_lib.h\"\n")
   143             f.write("#include \"iec_std_lib.h\"\n")
   144             f.write("#define EXT_C_INIT __init_%s\n"%location_str)
   144             f.write("#define EXT_C_INIT __init_%s\n"%location_str)
   145             f.write("#define EXT_C_CLEANUP __init_%s\n"%location_str)
   145             f.write("#define EXT_C_CLEANUP __init_%s\n"%location_str)
   146             f.write("#define EXT_C_PUBLISH __init_%s\n"%location_str)
   146             f.write("#define EXT_C_PUBLISH __init_%s\n"%location_str)
   147             f.write("#define EXT_C_RETRIVE __init_%s\n"%location_str)
   147             f.write("#define EXT_C_RETRIEVE __init_%s\n"%location_str)
   148             for loc in locations:
   148             for loc in locations:
   149                 f.write(loc["IEC_TYPE"]+" "+loc["NAME"]+";\n")
   149                 f.write(loc["IEC_TYPE"]+" "+loc["NAME"]+";\n")
   150             f.write("/* End of header generated by Beremiz c_ext plugin */\n\n")
   150             f.write("/* End of header generated by Beremiz c_ext plugin */\n\n")
   151             src_file = open(self.CFileName(CFile),'r')
   151             src_file = open(self.CFileName(CFile),'r')
   152             f.write(src_file.read())
   152             f.write(src_file.read())