Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 3.99 KB | None | 0 0
  1. /*
  2. The vapi file is found in util/uuid.vapi
  3.  
  4. The library is compiles with :
  5. libw3cwidgets_la_VALAFLAGS = -v -g --library w3c-widgets -H w3c-widgets.h --pkg gio-2.0 --pkg libxml-2.0 --pkg gee-1.0 --pkg libsoup-2.4 --pkg uuid --vapidir ./util
  6.  
  7. With *NO* error
  8.  
  9. The program linking to the library is compile with:
  10.  
  11. w3c_widgets_test_VALAFLAGS = -g --pkg gio-2.0 --pkg libxml-2.0 --pkg gee-1.0 --pkg libsoup-2.4  --vapidir $(top_builddir)/src/util --vapidir $(top_builddir)/src/ --pkg w3c-widgets --pkg libuuid
  12.  
  13. Outputting this error because uuid.uuid.h is not included in my lib's public header, even if the symbols are attributed with [CCode(cheader_filename = "uuid/uuid.h", lower_case_cprefix = "uuid_", cprefix = "UUID_")]
  14.  
  15. In file included from w3c_widgets_test.c:10:0:
  16. ../src/w3c-widgets.h:639:34: erreur: ‘UUID_VARIANT_NCS’ undeclared here (not in a function)
  17. ../src/w3c-widgets.h:640:34: erreur: ‘UUID_VARIANT_DCE’ undeclared here (not in a function)
  18. ../src/w3c-widgets.h:641:40: erreur: ‘UUID_VARIANT_MICROSOFT’ undeclared here (not in a function)
  19. ../src/w3c-widgets.h:642:36: erreur: ‘UUID_VARIANT_OTHER’ undeclared here (not in a function)
  20. ../src/w3c-widgets.h:646:32: erreur: ‘UUID_TYPE_DCE_TIME’ undeclared here (not in a function)
  21. ../src/w3c-widgets.h:647:34: erreur: ‘UUID_TYPE_DCE_RANDOM’ undeclared here (not in a function)
  22.  
  23. */
  24.  
  25. [CCode(cheader_filename = "uuid/uuid.h", lower_case_cprefix = "uuid_", cprefix = "UUID_")]
  26. namespace Native.LibUUID {
  27.     // Constants
  28.  
  29.     [CCode(cheader_filename = "uuid/uuid.h", cprefix="UUID_VARIANT_")] 
  30.     public enum  Variant {
  31.     [CCode(cheader_filename = "uuid/uuid.h", cprefix="UUID_VARIANT_")]
  32.     NCS,
  33.     [CCode(cheader_filename = "uuid/uuid.h", cprefix="UUID_VARIANT_")]
  34.     DCE,
  35.     [CCode(cheader_filename = "uuid/uuid.h", cprefix="UUID_VARIANT_")]
  36.     MICROSOFT,
  37.     [CCode(cheader_filename = "uuid/uuid.h", cprefix="UUID_VARIANT_")]
  38.     OTHER
  39.     }
  40.    
  41.  
  42.     [CCode(cheader_filename = "uuid/uuid.h", cprefix="UUID_TYPE_DCE_")]
  43.     public enum Type {
  44.         [CCode(cheader_filename = "uuid/uuid.h", cprefix="UUID_TYPE_DCE_")]
  45.         TIME,
  46.         [CCode(cheader_filename = "uuid/uuid.h", cprefix="UUID_TYPE_DCE_")]
  47.         RANDOM
  48.     }
  49.    
  50.     [CCode(cname = "time_t")]
  51.     public struct time_t : int{}
  52.  
  53.     [CCode(cname = "struct timeval")]
  54.     public struct timeval {
  55.         public int tv_sec;
  56.         public int tv_usec;
  57.     }
  58.  
  59.     [CCode(cname = "uuid_t", cheader_filename = "uuid/uuid.h")]
  60.     public struct UUID : char {}
  61.  
  62.  
  63.     [CCode(cheader_filename = "uuid/uuid.h")]  
  64.     public void clear(UUID uu);
  65.     [CCode(cheader_filename = "uuid/uuid.h")]
  66.     public void copy(UUID dest, UUID src);
  67.     [CCode(cheader_filename = "uuid/uuid.h")]
  68.     public void generate(UUID outp);
  69.     [CCode(cheader_filename = "uuid/uuid.h")]
  70.     public void generate_random(UUID outp);
  71.     [CCode(cheader_filename = "uuid/uuid.h")]
  72.     public void generate_time(UUID outp);
  73.     [CCode(cheader_filename = "uuid/uuid.h")]
  74.     public void unparse(UUID uu,
  75.             [CCode(array_length = false, array_null_terminated = false)]
  76.             char[] outp);
  77.     [CCode(cheader_filename = "uuid/uuid.h")]
  78.     public void unparse_upper(UUID uu,
  79.                      [CCode(array_length = false, array_null_terminated = false)]
  80.                  char[] outp);
  81.     [CCode(cheader_filename = "uuid/uuid.h")]
  82.     public void unparse_lower(UUID uu,
  83.                  [CCode(array_length = false, array_null_terminated = false)]
  84.                   char[] outp);
  85.     [CCode(cheader_filename = "uuid/uuid.h")]
  86.     public int compare(UUID uu1, UUID uu2);
  87.     [CCode(cheader_filename = "uuid/uuid.h")]
  88.     public int is_null(UUID uu);
  89.     [CCode(cheader_filename = "uuid/uuid.h")]
  90.     public int parse(string uu_in, UUID outp);
  91.     [CCode(cheader_filename = "uuid/uuid.h")]
  92.     public int type(UUID uu);
  93.     [CCode(cheader_filename = "uuid/uuid.h")]
  94.     public int variant(UUID uu);
  95.     [CCode(cheader_filename = "uuid/uuid.h")]
  96.     public time_t time(UUID uu, out timeval TimeInfo);
  97.  
  98.     [CCode(cname = "ctime_r", cheader_filename = "time.h")]
  99.     public unowned string unixtime_to_string(ref time_t secs, [CCode(array_length = false,array_null_terminated = false)]
  100.                      char[] ret);
  101.  
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement