Python/C "defs" file - what is it?
        Posted  
        
            by detly
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by detly
        
        
        
        Published on 2010-04-26T08:37:52Z
        Indexed on 
            2010/04/26
            8:43 UTC
        
        
        Read the original article
        Hit count: 322
        
In the nautilus-python bindings, there is a file "nautilus.defs". It contains stanzas like
(define-interface MenuProvider
  (in-module "Nautilus")
  (c-name "NautilusMenuProvider")
  (gtype-id "NAUTILUS_TYPE_MENU_PROVIDER")
)
or
(define-method get_mime_type
  (of-object "NautilusFileInfo")
  (c-name "nautilus_file_info_get_mime_type")
  (return-type "char*")
)
Now I can see what most of these do (eg. that last one means that I can call the method "get_mime_type" on a "FileInfo" object). But I'd like to know: what is this file, exactly (ie. what do I search the web for to find out more info)? Is it a common thing to find in Python/C bindings? What is the format, and where is it documented? What program actually processes it?
(So far, I've managed to glean that it gets transformed into a C source file, and it looks a bit like lisp to me.)
© Stack Overflow or respective owner