[Python] convert c function with varargs in ellipsis style to python equivalent using ctypes

Discussão em 'Python' iniciado por Stack, Setembro 5, 2025.

  1. Stack

    Stack Membro Participativo

    I have a c function with the following signature:

    func(enum_type level, const char* function, const int line, const char* file, const char* msg, ...)


    What would be the equivalent param types that need to be passed in the ctypes decorator call?

    I tried something like this

    @CFUNCTYPE(None, level, POINTER(c_char), c_int, POINTER(c_char), POINTER(c_char),"...")


    Since "..." is not a ctypes type not sure how to handle this.

    Continue reading...

Compartilhe esta Página