diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..df4fb101e --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +Makefile +Makefile.in +libtool +ltmain.sh +stamp-h1 +warnings.log +.deps/ +aclocal.m4 +config.guess +config.log +config.sub +configure +install-sh +autom4te.cache +config.h +config.h.in +config.status +config.cache +compile +depcomp +/m4/libtool.m4 +/m4/ltoptions.m4 +/m4/ltsugar.m4 +/m4/ltversion.m4 +/m4/lt~obsolete.m4 +.libs/ +*.la +*.lo +*.o +*.a +.dirstamp +*_moc.cpp +main/trunk_version.h +main/*/gb*3 + diff --git a/README b/README index 98f1b2272..d15cb3389 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ inspired by Visual Basic and Java. Go to http://gambas.sourceforge.net to get more information: how to compile and install it, where to find binary packages, how to report a bug... -Go to http://gambasdoc.org for language documentation. +Go to http://gambaswiki.org for language documentation. The following pieces of code were borrowed and adapted: @@ -35,4 +35,4 @@ If I forget some borrowed code in the list above, just tell me. Enjoy Gambas! -- -Benoît \ No newline at end of file +Benoît diff --git a/gb.dbus/src/helper.c b/gb.dbus/src/helper.c index 8fa0eb65e..7d9c544d4 100644 --- a/gb.dbus/src/helper.c +++ b/gb.dbus/src/helper.c @@ -245,6 +245,7 @@ static char *array_from_dbus_type(const char *signature) if (type_contents != type) strcpy(type, type_contents); + GB.GetArrayClass(GB.FindClass(type)); strcat(type, "[]"); return type; } diff --git a/main/gbx/gbx_api.c b/main/gbx/gbx_api.c index fe7da0546..ce04db8d5 100644 --- a/main/gbx/gbx_api.c +++ b/main/gbx/gbx_api.c @@ -131,6 +131,7 @@ const void *const GAMBAS_Api[] = (void *)GB_ExistClassLocal, (void *)CLASS_find, (void *)GB_GetArrayType, + (void *)CLASS_get_array_class, (void *)GB_Is, (void *)GB_Ref, (void *)GB_Unref, diff --git a/main/gbx/gbx_c_collection.c b/main/gbx/gbx_c_collection.c index e55750bf4..003f2dd7b 100644 --- a/main/gbx/gbx_c_collection.c +++ b/main/gbx/gbx_c_collection.c @@ -272,6 +272,30 @@ BEGIN_PROPERTY(Collection_Default) END_PROPERTY +static void return_node_key(HASH_TABLE *hash_table, HASH_NODE *node) +{ + char *key; + int len; + + HASH_TABLE_get_key(hash_table, node, &key, &len); + if (len) + GB_ReturnNewString(key, len); + else + GB_ReturnNull(); + +} + +BEGIN_PROPERTY(Collection_First) + + return_node_key(THIS->hash_table, THIS->hash_table->sfirst); + +END_PROPERTY + +BEGIN_PROPERTY(Collection_Last) + + return_node_key(THIS->hash_table, THIS->hash_table->slast); + +END_PROPERTY #endif @@ -285,6 +309,8 @@ GB_DESC NATIVE_Collection[] = GB_PROPERTY_READ("Count", "i", Collection_Count), GB_PROPERTY_READ("Length", "i", Collection_Count), + GB_PROPERTY_READ("First", "s", Collection_First), + GB_PROPERTY_READ("Last", "s", Collection_Last), GB_PROPERTY("Key", "s", Collection_Key), GB_PROPERTY("Default", "v", Collection_Default), diff --git a/main/share/gambas.h b/main/share/gambas.h index 47588d4cf..b7ec792c3 100644 --- a/main/share/gambas.h +++ b/main/share/gambas.h @@ -977,6 +977,7 @@ typedef bool (*ExistClassLocal)(const char *); GB_CLASS (*FindClassLocal)(const char *); GB_TYPE (*GetArrayType)(GB_CLASS); + GB_CLASS (*GetArrayClass)(GB_CLASS); bool (*Is)(void *, GB_CLASS); void (*Ref)(void *); void (*Unref)(void **);