girepository/ginvoke.c girepository/girepository.h

2008-02-21  Mark Doffman  <mark.doffman@codethink.co.uk>

    * girepository/ginvoke.c
    * girepository/girepository.h
    * girepository/gmetadata.c
    * girepository/gmetadata.h
    * tools/generate.c
    * tools/gidlparser.c

      Modify TYPE_TAG_INTERFACE to TYPE_TAG_SYMBOL
      to avoid confusion with the interface blob.

    * tools/generate.c
    * tools/gidlparser.c

      Remove magic numbers and replace with type-tag
      enumeration symbols.

    * girepository/gmetadata.c
      Add validate declaration.

WARNING: This commit does not compile. It is a partial change.

svn path=/trunk/; revision=129
This commit is contained in:
Mark Doffman 2008-03-10 17:44:06 +00:00 committed by Johan Dahlin
parent 2fb6877346
commit d349902ce6
4 changed files with 13 additions and 12 deletions

View File

@ -100,8 +100,8 @@ get_ffi_type (GITypeInfo *info)
break; break;
case GI_TYPE_TAG_UTF8: case GI_TYPE_TAG_UTF8:
case GI_TYPE_TAG_FILENAME: case GI_TYPE_TAG_FILENAME:
case GI_TYPE_TAG_SYMBOL:
case GI_TYPE_TAG_ARRAY: case GI_TYPE_TAG_ARRAY:
case GI_TYPE_TAG_INTERFACE:
case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GLIST:
case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GSLIST:
case GI_TYPE_TAG_GHASH: case GI_TYPE_TAG_GHASH:

View File

@ -277,8 +277,8 @@ typedef enum {
GI_TYPE_TAG_DOUBLE = 17, GI_TYPE_TAG_DOUBLE = 17,
GI_TYPE_TAG_UTF8 = 18, GI_TYPE_TAG_UTF8 = 18,
GI_TYPE_TAG_FILENAME = 19, GI_TYPE_TAG_FILENAME = 19,
GI_TYPE_TAG_ARRAY = 20, GI_TYPE_TAG_SYMBOL = 20,
GI_TYPE_TAG_INTERFACE = 21, GI_TYPE_TAG_ARRAY = 21,
GI_TYPE_TAG_GLIST = 22, GI_TYPE_TAG_GLIST = 22,
GI_TYPE_TAG_GSLIST = 23, GI_TYPE_TAG_GSLIST = 23,
GI_TYPE_TAG_GHASH = 24, GI_TYPE_TAG_GHASH = 24,

View File

@ -30,6 +30,11 @@
#define ALIGN_VALUE(this, boundary) \ #define ALIGN_VALUE(this, boundary) \
(( ((unsigned long)(this)) + (((unsigned long)(boundary)) -1)) & (~(((unsigned long)(boundary))-1))) (( ((unsigned long)(this)) + (((unsigned long)(boundary)) -1)) & (~(((unsigned long)(boundary))-1)))
static gboolean
validate_blob (GMetadata *metadata,
guint32 offset,
GError **error);
DirEntry * DirEntry *
g_metadata_get_dir_entry (GMetadata *metadata, g_metadata_get_dir_entry (GMetadata *metadata,
@ -419,9 +424,9 @@ validate_type_blob (GMetadata *metadata,
signature_offset, return_type, error)) signature_offset, return_type, error))
return FALSE; return FALSE;
break; break;
case TYPE_TAG_INTERFACE: case TYPE_TAG_SYMBOL:
if (!validate_iface_type_blob (metadata, simple->offset, if (!validate_blob (metadata, simple->offset,
signature_offset, return_type, error)) error))
return FALSE; return FALSE;
break; break;
case TYPE_TAG_LIST: case TYPE_TAG_LIST:

View File

@ -95,10 +95,6 @@ typedef struct
guint32 offset; guint32 offset;
} DirEntry; } DirEntry;
#define TYPE_POINTER_MASK 1 << 7
#define TYPE_TAG_MASK 63
typedef enum typedef enum
{ {
TYPE_TAG_VOID = 0, TYPE_TAG_VOID = 0,
@ -121,8 +117,8 @@ typedef enum
TYPE_TAG_DOUBLE = 17, TYPE_TAG_DOUBLE = 17,
TYPE_TAG_UTF8 = 18, TYPE_TAG_UTF8 = 18,
TYPE_TAG_FILENAME = 19, TYPE_TAG_FILENAME = 19,
TYPE_TAG_ARRAY = 20, TYPE_TAG_SYMBOL = 20,
TYPE_TAG_INTERFACE = 21, TYPE_TAG_ARRAY = 21,
TYPE_TAG_LIST = 22, TYPE_TAG_LIST = 22,
TYPE_TAG_SLIST = 23, TYPE_TAG_SLIST = 23,
TYPE_TAG_HASH = 24, TYPE_TAG_HASH = 24,