Changes in tools/autogen.py [147a066:795e2bf] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autogen.py

    r147a066 r795e2bf  
    3434def usage():
    3535        print("%s - Automated structure and offsets generator" % sys.argv[0])
    36         print("%s file.ag depend|probe|generate struct.ag" % sys.argv[0])
     36        print("%s file.ag probe|generate struct.ag" % sys.argv[0])
    3737        sys.exit()
    38 
    39 def depend(struct):
    40         deps = ""
    41         for include in struct['includes']:
    42                 if 'depends' in include.keys():
    43                         deps = deps + include['depends'] + "\n"
    44         return deps.strip()
    4538
    4639def generate_includes(struct):
     
    5952
    6053def generate_struct(struct):
    61         packed = ""
    62         if ('packed' in struct.keys() and struct['packed']):
    63                 packed = "__attribute__ ((packed)) "
    6454        code = "typedef struct %s {\n" % struct['name']
    6555        for i in range(len(struct['members'])):
     
    6959                else:
    7060                        code = code + "\t%s %s;\n" % (member['type'], member['name'])
    71         code = code + "} %s%s_t;" % (packed, struct['name'])
     61        code = code + "} %s_t;" % struct['name']
    7262        return code
    7363
     
    167157                struct = yaml.load(fp)
    168158
    169         if sys.argv[1] == "depend":
    170                 deps = depend(struct)
    171                 print(deps)
    172         elif sys.argv[1] == "probe":
     159        if sys.argv[1] == "probe":
    173160                code = probe(struct)
    174161                print(code)
Note: See TracChangeset for help on using the changeset viewer.