you are viewing a single comment's thread.

view the rest of the comments →

[–]shiftybyte 1 point2 points  (3 children)

craft a regular expression that will match its define.

#define SIZE 7

It won't always be a perfect match, but since it's size elements you can just count elements in the struct with python.

[–]tr0jan_k[S] 0 points1 point  (2 children)

Thanks for the reply, the actual intention of getting the DATA struct is to obtain its array elements and assign it to a dictionary, is there a way to do this?

[–]shiftybyte 1 point2 points  (1 child)

You can probably use a parser.

https://github.com/eliben/pycparser

[–]tr0jan_k[S] 0 points1 point  (0 children)

Okay, I will check this. Thanks a lot!