/* * call-seq: * init(name) * * name = application name (required) * * Initialize libnotify. This must be called before any other functions. * Throw an expection If name is empty or nil * * Returns TRUE if the library initialized properly, FALSE otherwise */ static VALUE _wrap_notify_init(VALUE self, VALUE app_name) { gboolean init; char *name = NIL_P(app_name) ? NULL : StringValuePtr(app_name); if(name == NULL || *name == '\0') rb_raise(rb_eRuntimeError, "You MUST call this method with a valid string that will be used as Application name"); else init = notify_init(name); if(init == TRUE) return Qtrue; return Qfalse; }