From The Compiler, 5 Years ago, written in Python.
Embed
  1. #### ctypedefs.pxd
  2.  
  3. cdef extern from "glib.h":
  4.     ctypedef struct GString:
  5.         pass
  6.  
  7. cdef extern from "X11/Xlib.h":
  8.     ctypedef struct Display:
  9.         pass
  10.  
  11. cdef extern from "stdbool.h":
  12.     ctypedef struct bool:
  13.         pass
  14.  
  15. ##### cherbstclient.pxd
  16.  
  17. cimport ctypedefs
  18.  
  19. cdef extern from "herbstclient.h":
  20.     ctypedef struct HCConnection:
  21.         pass
  22.  
  23.     HCConnection* hc_connect()
  24.     HCConnection* hc_connect_to_display(Display* display)
  25.     void hc_disconnect(HCConnection* con)
  26.     bool hc_create_client_window(HCConnection* con)
  27.  
  28.     bool hc_send_command(HCConnection* con, int argc, char* argv[],
  29.                          GString** ret_out, int* ret_status)
  30.     bool hc_send_command_once(int argc, char* argv[],
  31.                               GString** ret_out, int* ret_status)
  32.  
  33.     bool hc_hook_window_connect(HCConnection* con)
  34.     bool hc_next_hook(HCConnection* con, int* argc, char** argv[]
  35.  
  36. ##### errors
  37. #
  38. # cherbstclient.pxd:8:40: 'Display' is not a type identifier
  39. # cherbstclient.pxd:10:4: 'bool' is not a type identifier