KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm accessing a C struct which contains some time_t fields using python ctypes module. Given its non completely portable nature, I cannot define these fields statically as of c_int or c_long type. How can I define them to make my code portable? Example C struct definition: #import <sys/types.h> #import <time.h> typedef struct my_struct { time_t timestap; uint16_t code; }; Respective python ctypes structure: from ctypes import * c_time = ? # What do I have to put here? class MyStruct(Structure): _fields_ = [ ('timestamp', c_time), ('code', c_int16), ]
Tags (comma-separated)
Save Edits
Cancel