/* * call-seq: * server_info * * Queries the server for its information (name, vendor, server version, * notification version) * * Returns FALSE if there were errors, an Hash otherwise * * example: * * h = Notify.server_info * p h[:name] #print the product name of the server * p h[:vendor] #print the vendor * p h[:version] #print the server version * p h[:spec_version] #print the specification version supported */ static VALUE _wrap_notify_get_server_info(VALUE self) { gchar *serv_name = NULL, *vendor = NULL, *serv_version = NULL, *spec_vers = NULL; VALUE rb_info; if(!notify_get_server_info(&serv_name, &vendor, &serv_version, &spec_vers)) return Qfalse; else { rb_info = rb_hash_new(); rb_hash_aset(rb_info, ID2SYM(rb_intern("name")), rb_str_new2(serv_name)); rb_hash_aset(rb_info, ID2SYM(rb_intern("vendor")), rb_str_new2(vendor)); rb_hash_aset(rb_info, ID2SYM(rb_intern("version")), rb_str_new2(serv_version)); rb_hash_aset(rb_info, ID2SYM(rb_intern("spec_version")), rb_str_new2(spec_vers)); g_free(serv_name); g_free(vendor); g_free(serv_version); g_free(spec_vers); } return rb_info; }