Commit f3eeb7de authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Add support for [Compact] class attribute, register non-compact classes

2008-05-25  Juerg Billeter  <j@bitron.ch>

	* vala/valaclass.vala:
	* vala/valainterfacewriter.vala:
	* gobject/valaccodeclassbinding.vala:
	* gobject/valaccodegenerator.vala:
	* gobject/valaccodememberaccessbinding.vala:
	* gobject/valaccodemethodbinding.vala:
	* gobject/valatyperegisterfunction.vala:

	Add support for [Compact] class attribute, register non-compact
	classes with GType, fixes bug 532518

	* gee/hashmap.vala:
	* gee/hashset.vala:
	* gobject-introspection/gidl.vapi:
	* tests/classes.exp:
	* tests/classes.vala:
	* vapi/glib-2.0.vapi:

	Update to use compact classes where appropriate

svn path=/trunk/; revision=1425
parent 15989e7d
2008-05-25 Jürg Billeter <j@bitron.ch>
* vala/valaclass.vala:
* vala/valainterfacewriter.vala:
* gobject/valaccodeclassbinding.vala:
* gobject/valaccodegenerator.vala:
* gobject/valaccodememberaccessbinding.vala:
* gobject/valaccodemethodbinding.vala:
* gobject/valatyperegisterfunction.vala:
Add support for [Compact] class attribute, register non-compact
classes with GType, fixes bug 532518
* gee/hashmap.vala:
* gee/hashset.vala:
* gobject-introspection/gidl.vapi:
* tests/classes.exp:
* tests/classes.vala:
* vapi/glib-2.0.vapi:
Update to use compact classes where appropriate
2008-05-25 Jürg Billeter <j@bitron.ch>
* vala/valaparser.vala:
......
......@@ -168,6 +168,7 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
clear ();
}
[Compact]
private class Node<K,V> {
public K key;
public V value;
......
......@@ -152,6 +152,7 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
clear ();
}
[Compact]
private class Node<G> {
public G key;
public Node<G> next;
......
......@@ -26,7 +26,8 @@ namespace GLib {
namespace Idl {
public List<IdlModule> parse_file (string filename) throws MarkupError;
}
[Compact]
[CCode (free_function = "g_idl_module_free", cheader_filename = "gidlmodule.h")]
public class IdlModule {
public string name;
......@@ -56,13 +57,15 @@ namespace GLib {
FIELD,
XREF
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNode {
public IdlNodeTypeId type;
public string name;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeFunction {
public bool deprecated;
......@@ -79,6 +82,7 @@ namespace GLib {
public List<IdlNodeParam> parameters;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeVFunc
{
......@@ -91,7 +95,8 @@ namespace GLib {
public IdlNodeParam result;
public int offset;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeSignal {
public bool deprecated;
......@@ -112,7 +117,8 @@ namespace GLib {
public List<IdlNodeParam> parameters;
public IdlNodeParam result;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeBoxed {
public bool deprecated;
......@@ -122,7 +128,8 @@ namespace GLib {
public List<IdlNode> members;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeEnum {
public bool deprecated;
......@@ -132,7 +139,8 @@ namespace GLib {
public List<IdlNode> values;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeField {
public bool readable;
......@@ -142,7 +150,8 @@ namespace GLib {
public IdlNodeType type;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeConstant {
public bool deprecated;
......@@ -151,7 +160,8 @@ namespace GLib {
public string value;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeInterface {
public bool deprecated;
......@@ -166,7 +176,8 @@ namespace GLib {
public List<IdlNode> members;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeParam {
public bool @in;
......@@ -180,7 +191,8 @@ namespace GLib {
public IdlNodeType type;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeProperty {
public bool deprecated;
......@@ -194,21 +206,24 @@ namespace GLib {
public IdlNodeType type;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeStruct {
public bool deprecated;
public List<IdlNode> members;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeUnion {
public bool deprecated;
public List<IdlNode> members;
}
[Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeType {
public bool is_pointer;
......
......@@ -46,9 +46,9 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
codegen.current_type_symbol = cl;
codegen.current_class = cl;
bool is_gtypeinstance = cl.is_subtype_of (codegen.gtypeinstance_type);
bool is_gtypeinstance = !cl.is_compact;
bool is_gobject = cl.is_subtype_of (codegen.gobject_type);
bool is_fundamental = (cl.base_class == codegen.gtypeinstance_type);
bool is_fundamental = is_gtypeinstance && cl.base_class == null;
if (cl.get_cname().len () < 3) {
cl.error = true;
......@@ -106,9 +106,9 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
if (cl.base_class != null) {
codegen.instance_struct.add_field (cl.base_class.get_cname (), "parent_instance");
if (is_fundamental) {
codegen.instance_struct.add_field ("volatile int", "ref_count");
}
} else if (is_fundamental) {
codegen.instance_struct.add_field ("GTypeInstance", "parent_instance");
codegen.instance_struct.add_field ("volatile int", "ref_count");
}
if (is_gtypeinstance) {
......
......@@ -101,7 +101,6 @@ public class Vala.CCodeGenerator : CodeGenerator {
public DataType float_type;
public DataType double_type;
public Typesymbol gtype_type;
public Typesymbol gtypeinstance_type;
public Typesymbol gobject_type;
public ErrorType gerror_type;
public Class glist_type;
......@@ -228,7 +227,6 @@ public class Vala.CCodeGenerator : CodeGenerator {
var glib_ns = root_symbol.scope.lookup ("GLib");
gtype_type = (Typesymbol) glib_ns.scope.lookup ("Type");
gtypeinstance_type = (Typesymbol) glib_ns.scope.lookup ("TypeInstance");
gobject_type = (Typesymbol) glib_ns.scope.lookup ("Object");
gerror_type = new ErrorType (null, null);
glist_type = (Class) glib_ns.scope.lookup ("List");
......@@ -508,7 +506,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
f.accept_children (this);
var cl = f.parent_symbol as Class;
bool is_gtypeinstance = (cl != null && cl.is_subtype_of (gtypeinstance_type));
bool is_gtypeinstance = (cl != null && !cl.is_compact);
CCodeExpression lhs = null;
CCodeStruct st = null;
......@@ -2991,7 +2989,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, instance));
} else if (expr.type_reference.data_type is Class) {
var cl = (Class) expr.type_reference.data_type;
if (cl.base_class == gtypeinstance_type) {
if (!cl.is_compact && cl.base_class == null) {
creation_call.add_argument (new CCodeIdentifier (cl.get_type_id ()));
}
}
......@@ -3190,9 +3188,9 @@ public class Vala.CCodeGenerator : CodeGenerator {
}
public override void visit_cast_expression (CastExpression expr) {
if (expr.type_reference.data_type != null
&& expr.type_reference.data_type.is_subtype_of (gtypeinstance_type)
&& expr.type_reference.data_type != gtypeinstance_type) {
var cl = expr.type_reference.data_type as Class;
var iface = expr.type_reference.data_type as Interface;
if (iface != null || (cl != null && !cl.is_compact)) {
// checked cast for strict subtypes of GTypeInstance
if (expr.is_silent_cast) {
var ccomma = new CCodeCommaExpression ();
......@@ -3436,9 +3434,9 @@ public class Vala.CCodeGenerator : CodeGenerator {
return cexpr;
}
if (context.checking && target_type.data_type != null
&& target_type.data_type.is_subtype_of (gtypeinstance_type)
&& target_type.data_type != gtypeinstance_type) {
var cl = target_type.data_type as Class;
var iface = target_type.data_type as Interface;
if (context.checking && (iface != null || (cl != null && !cl.is_compact))) {
// checked cast for strict subtypes of GTypeInstance
return new InstanceCast (cexpr, target_type.data_type);
} else if (target_type.data_type != null && expression_type.get_cname () != target_type.get_cname ()) {
......
......@@ -86,7 +86,8 @@ public class Vala.CCodeMemberAccessBinding : CCodeExpressionBinding {
var instance_target_type = codegen.get_data_type_for_symbol ((Typesymbol) f.parent_symbol);
CCodeExpression typed_inst = codegen.get_implicit_cast_expression (pub_inst, instance_expression_type, instance_target_type);
bool is_gtypeinstance = (instance_target_type.data_type.is_subtype_of (codegen.gtypeinstance_type));
var cl = instance_target_type.data_type as Class;
bool is_gtypeinstance = (cl == null || !cl.is_compact);
CCodeExpression inst;
if (is_gtypeinstance && f.access == SymbolAccessibility.PRIVATE) {
......
......@@ -60,9 +60,9 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
if (m is CreationMethod) {
codegen.in_creation_method = true;
var cl = codegen.current_type_symbol as Class;
if (cl != null && cl.is_subtype_of (codegen.gtypeinstance_type)) {
if (cl != null && !cl.is_compact) {
in_gtypeinstance_creation_method = true;
if (cl.base_class == codegen.gtypeinstance_type) {
if (cl.base_class == null) {
in_fundamental_creation_method = true;
} else if (cl.is_subtype_of (codegen.gobject_type)) {
in_gobject_creation_method = true;
......@@ -785,7 +785,7 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
private Class find_fundamental_class (Class cl) {
var fundamental_class = cl;
while (fundamental_class != null && fundamental_class.base_class != codegen.gtypeinstance_type) {
while (fundamental_class != null && fundamental_class.base_class != null) {
fundamental_class = fundamental_class.base_class;
}
return fundamental_class;
......
......@@ -36,7 +36,7 @@ public abstract class Vala.TypeRegisterFunction : Object {
public void init_from_type (bool plugin = false) {
bool fundamental = false;
Class cl = get_type_declaration () as Class;
if (cl != null && cl.base_class != null && cl.base_class.name == "TypeInstance" && cl.base_class.parent_symbol.name == "GLib") {
if (cl != null && !cl.is_compact && cl.base_class == null) {
fundamental = true;
}
......
Classes Test:
new SimpleClass ()
new CompactClass ()
new DerivedClass ()
new PublicClass ()
new ClassWithCreationMethod ()
ClassWithCreationMethod
new ClassWithNamedCreationMethod ()
ClassWithNamedCreationMethod
new ClassWithDestructor ()
~ClassWithDestructor
new CompactClassWithDestructor ()
~CompactClassWithDestructor
new SimpleGTypeInstanceClass ()
new DerivedGTypeInstanceClass ()
new PublicGTypeInstanceClass ()
......@@ -20,6 +20,6 @@ new DerivedGObjectClass ()
new PublicGObjectClass ()
new GObjectClassWithCreationMethod ()
new GObjectClassWithNamedCreationMethod ()
new SimpleClass () { field = 1 }
simple_class.field = 1
new CompactClass () { field = 1 }
compact_class.field = 1
.
using GLib;
class SimpleClass {
[Compact]
class CompactClass {
public int field;
}
class ClassWithDestructor {
~ClassWithDestructor () {
stdout.printf ("~ClassWithDestructor\n");
[Compact]
class CompactClassWithDestructor {
~CompactClassWithDestructor () {
stdout.printf ("~CompactClassWithDestructor\n");
}
/* FIXME bug 533977 */
public char dummy;
}
class DerivedClass : SimpleClass {
class DerivedClass : CompactClass {
}
[Compact]
public class PublicClass {
public int field;
}
[Compact]
abstract class AbstractClass {
public int field;
}
[Compact]
class ClassWithCreationMethod {
public ClassWithCreationMethod () {
stdout.printf ("ClassWithCreationMethod\n");
......@@ -32,6 +37,7 @@ class ClassWithCreationMethod {
public int field;
}
[Compact]
class ClassWithNamedCreationMethod {
public ClassWithNamedCreationMethod.named () {
stdout.printf ("ClassWithNamedCreationMethod\n");
......@@ -40,22 +46,22 @@ class ClassWithNamedCreationMethod {
public int field;
}
class SimpleGTypeInstanceClass : TypeInstance {
class SimpleGTypeInstanceClass {
}
class DerivedGTypeInstanceClass : SimpleGTypeInstanceClass {
}
public class PublicGTypeInstanceClass : TypeInstance {
public class PublicGTypeInstanceClass {
}
class GTypeInstanceClassWithCreationMethod : TypeInstance {
class GTypeInstanceClassWithCreationMethod {
public GTypeInstanceClassWithCreationMethod () {
stdout.printf ("GTypeInstanceClassWithCreationMethod\n");
}
}
class GTypeInstanceClassWithNamedCreationMethod : TypeInstance {
class GTypeInstanceClassWithNamedCreationMethod {
public GTypeInstanceClassWithNamedCreationMethod.named () {
stdout.printf ("GTypeInstanceClassWithNamedCreationMethod\n");
}
......@@ -86,8 +92,8 @@ class GObjectClassWithNamedCreationMethod : Object {
void main () {
stdout.printf ("Classes Test:\n");
stdout.printf ("new SimpleClass ()\n");
var simple_class = new SimpleClass ();
stdout.printf ("new CompactClass ()\n");
var compact_class = new CompactClass ();
stdout.printf ("new DerivedClass ()\n");
var derived_class = new DerivedClass ();
stdout.printf ("new PublicClass ()\n");
......@@ -96,9 +102,9 @@ void main () {
var class_with_creation_method = new ClassWithCreationMethod ();
stdout.printf ("new ClassWithNamedCreationMethod ()\n");
var class_with_named_creation_method = new ClassWithNamedCreationMethod.named ();
stdout.printf ("new ClassWithDestructor ()\n");
var class_with_destructor = new ClassWithDestructor ();
class_with_destructor = null;
stdout.printf ("new CompactClassWithDestructor ()\n");
var compact_class_with_destructor = new CompactClassWithDestructor ();
compact_class_with_destructor = null;
stdout.printf ("new SimpleGTypeInstanceClass ()\n");
var simple_gtypeinstance_class = new SimpleGTypeInstanceClass ();
......@@ -122,9 +128,9 @@ void main () {
stdout.printf ("new GObjectClassWithNamedCreationMethod ()\n");
var gobject_class_with_named_creation_method = new GObjectClassWithNamedCreationMethod.named ();
stdout.printf ("new SimpleClass () { field = 1 }\n");
simple_class = new SimpleClass () { field = 1 };
stdout.printf ("simple_class.field = %d\n", simple_class.field);
stdout.printf ("new CompactClass () { field = 1 }\n");
compact_class = new CompactClass () { field = 1 };
stdout.printf ("compact_class.field = %d\n", compact_class.field);
stdout.printf (".\n");
}
......
......@@ -44,6 +44,23 @@ public class Vala.Class : Typesymbol {
*/
public bool is_static { get; set; }
/**
* Instances of compact classes are fast to create and have a
* compact memory layout. Compact classes don't support runtime
* type information or virtual methods.
*/
public bool is_compact {
get {
if (base_class != null) {
return base_class.is_compact;
}
return _is_compact;
}
set {
_is_compact = value;
}
}
/**
* Specifies whether this class has private fields.
*/
......@@ -53,7 +70,6 @@ public class Vala.Class : Typesymbol {
private string const_cname;
private string lower_case_cprefix;
private string lower_case_csuffix;
private bool has_type_id;
private string type_id;
private string ref_function;
private string unref_function;
......@@ -63,6 +79,7 @@ public class Vala.Class : Typesymbol {
private string get_value_function;
private string set_value_function;
private string? type_signature;
private bool _is_compact;
private Gee.List<TypeParameter> type_parameters = new ArrayList<TypeParameter> ();
......@@ -498,9 +515,6 @@ public class Vala.Class : Typesymbol {
if (a.has_argument ("free_function")) {
set_free_function (a.get_string ("free_function"));
}
if (a.has_argument ("has_type_id")) {
has_type_id = a.get_bool ("has_type_id");
}
if (a.has_argument ("type_id")) {
type_id = a.get_string ("type_id");
}
......@@ -546,17 +560,15 @@ public class Vala.Class : Typesymbol {
process_ccode_attribute (a);
} else if (a.name == "ErrorBase") {
is_error_base = true;
} else if (a.name == "Compact") {
is_compact = true;
}
}
}
private bool get_has_type_id () {
return has_type_id || (base_class != null && base_class.get_has_type_id ());
}
public override string? get_type_id () {
if (type_id == null) {
if (get_has_type_id ()) {
if (!is_compact) {
type_id = get_upper_case_cname ("TYPE_");
} else {
type_id = "G_TYPE_POINTER";
......@@ -611,9 +623,7 @@ public class Vala.Class : Typesymbol {
}
bool is_fundamental () {
if (base_class != null
&& base_class.name == "TypeInstance"
&& base_class.parent_symbol.name == "GLib") {
if (!is_compact && base_class == null) {
return true;
}
return false;
......
......@@ -92,7 +92,13 @@ public class Vala.InterfaceWriter : CodeVisitor {
if (!check_accessibility (cl)) {
return;
}
if (cl.is_compact) {
write_indent ();
write_string ("[Compact]");
write_newline ();
}
write_indent ();
write_string ("[CCode (");
......
......@@ -544,6 +544,7 @@ public enum UnicodeBreakType {
HANGUL_LVT_SYLLABLE
}
[Compact]
[CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "G_TYPE_STRING", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string", type_signature = "s")]
public class string {
[CCode (cname = "strstr")]
......@@ -692,12 +693,12 @@ namespace GLib {
public uint instance_size;
}
// deprecated
[CCode (has_type_id = true)]
public class TypeInstance {
[CCode (cname = "G_TYPE_FROM_INSTANCE")]
public Type get_type ();
}
[Compact]
[CCode (ref_function = "g_type_class_ref", unref_function = "g_type_class_unref")]
public class TypeClass {
[CCode (cname = "G_TYPE_FROM_CLASS")]
......@@ -715,6 +716,7 @@ namespace GLib {
public interface TypePlugin {
}
[Compact]
public class TypeModule : TypePlugin {
public bool use ();
public void unuse ();
......@@ -722,8 +724,7 @@ namespace GLib {
}
[CCode (ref_function = "g_param_spec_ref", unref_function = "g_param_spec_unref")]
public class ParamSpec : TypeInstance {
public TypeInstance g_type_instance;
public class ParamSpec {
public string name;
public ParamFlags flags;
public Type value_type;
......@@ -798,6 +799,7 @@ namespace GLib {
public weak EnumValue? get_value_by_nick (string name);
}
[Compact]
public class EnumValue {
public int value;
public weak string value_name;
......@@ -811,12 +813,14 @@ namespace GLib {
public weak FlagsValue? get_value_by_nick (string name);
}
[Compact]
public class FlagsValue {
public int value;
public weak string value_name;
public weak string value_nick;
}
[Compact]
[CCode (cname = "gpointer", has_type_id = true, type_id = "G_TYPE_BOXED", marshaller_type_name = "BOXED", get_value_function = "g_value_get_boxed", set_value_function = "g_value_set_boxed")]
public abstract class Boxed {
}
......@@ -917,6 +921,7 @@ namespace GLib {
public static delegate void Callback ();
[Compact]
public class Closure : Boxed {
}
......@@ -1104,7 +1109,8 @@ namespace GLib {
}
/* The Main Event Loop */
[Compact]
[CCode (ref_function = "g_main_loop_ref", unref_function = "g_main_loop_unref")]
public class MainLoop {
public MainLoop (MainContext? context, bool is_running);
......@@ -1121,7 +1127,8 @@ namespace GLib {
DEFAULT_IDLE,
LOW
}
[Compact]
[CCode (ref_function = "g_main_context_ref", unref_function = "g_main_context_unref")]
public class MainContext {
public MainContext ();
......@@ -1195,7 +1202,8 @@ namespace GLib {
public IOCondition events;
public IOCondition revents;
}
[Compact]
[CCode (ref_function = "g_source_ref", unref_function = "g_source_unref")]
public class Source {
public Source (SourceFuncs source_funcs, uint struct_size /* = sizeof (Source) */);
......@@ -1226,6 +1234,7 @@ namespace GLib {
public static delegate bool SourceDispatchFunc (Source source, SourceFunc _callback);
public static delegate void SourceFinalizeFunc (Source source);
[Compact]
public class SourceFuncs {
public SourcePrepareFunc prepare;
public SourceCheckFunc check;
......@@ -1237,6 +1246,7 @@ namespace GLib {
public static delegate void SourceCallbackUnrefFunc (void* cb_data);
public static delegate void SourceCallbackGetFunc (void* cb_data, Source source, SourceFunc func);
[Compact]
public class SourceCallbackFuncs {
public SourceCallbackRefFunc @ref;
public SourceCallbackUnrefFunc unref;
......@@ -1250,6 +1260,7 @@ namespace GLib {
}
/* Thread support */
[Compact]
public class ThreadFunctions {
}
......@@ -1263,6 +1274,7 @@ namespace GLib {
URGENT
}
[Compact]
public class Thread {
public static void init (ThreadFunctions? vtable = null);
public static bool supported ();
......@@ -1279,6 +1291,7 @@ namespace GLib {
public static void usleep (ulong microseconds);
}
[Compact]
[CCode (free_function = "g_mutex_free")]
public class Mutex {
public Mutex ();
......@@ -1296,6 +1309,7 @@ namespace GLib {
public void lock_full ();
}
[Compact]
[CCode (free_function = "g_cond_free")]
public class Cond {
public Cond ();
......@@ -1306,7 +1320,8 @@ namespace GLib {
}
/* Thread Pools */
[Compact]
[CCode (free_function = "g_thread_pool_free")]
public class ThreadPool {
public ThreadPool (Func func, void* user_data, int max_threads, bool exclusive) throws ThreadError;
......@@ -1325,7 +1340,8 @@ namespace GLib {
}
/* Asynchronous Queues */
[Compact]
[CCode (ref_function = "g_async_queue_ref", unref_function = "g_async_queue_unref")]
public class AsyncQueue {
public AsyncQueue ();
......@@ -1374,7 +1390,8 @@ namespace GLib {
}
/* IO Channels */
[Compact]
[CCode (ref_function = "g_io_channel_ref", unref_function = "g_io_channel_unref")]
public class IOChannel : Boxed {
[CCode (cname = "g_io_channel_unix_new")]
......@@ -1465,6 +1482,7 @@ namespace GLib {
/* Error Reporting */
[Compact]
[ErrorBase]
[CCode (copy_function = "g_error_copy", free_function = "g_error_free")]
public class Error {
......@@ -1602,6 +1620,7 @@ namespace GLib {
public ssize_t get_length ();
}
[Compact]
[CCode (free_function = "g_checksum_free")]
public class Checksum {
public Checksum (ChecksumType checksum_type);
......@@ -1769,7 +1788,8 @@ namespace GLib {
}
/* Random Numbers */
[Compact]
[CCode (copy_function = "g_rand_copy", free_function = "g_rand_free")]
public class Rand {
public Rand.with_seed (uint32 seed);
......@@ -1884,6 +1904,7 @@ namespace GLib {
/* Lexical Scanner */
[Compact]
[CCode (free_function = "g_scanner_destroy")]
public class Scanner {
public Scanner (ScannerConfig config_templ);
......@@ -2012,6 +2033,7 @@ namespace GLib {
/* Timers */
[Compact]
[CCode (free_function = "g_timer_destroy")]
public class Timer {
public Timer ();
......@@ -2155,6 +2177,7 @@ namespace GLib {
EXISTS
}
[Compact]
[CCode (cname = "FILE", free_function = "fclose", cheader_filename = "stdio.h")]
public class FileStream {
[CCode (cname = "fopen")]
......@@ -2205,6 +2228,7 @@ namespace GLib {
public struct Stat {
}
[Compact]
[CCode (free_function = "g_dir_close")]
public class Dir {
public static Dir open (string filename, uint _flags = 0) throws FileError;
......@@ -2220,7 +2244,8 @@ namespace GLib {
[CCode (cname = "mkdtemp")]
public static weak string mkdtemp (string template);
}