/* * Return the hostname of a Fam::Event object. * * Note: some versions of FAM (ex. the Debian package) ship without * remote support. In those instances, this method will always return * "localhost". * * Aliases: * Fam::Event#host * * Examples: * host = ev.hostname * host = ev.host * */ static VALUE fam_ev_host(VALUE self) { FAMEvent *ev; Data_Get_Struct(self, FAMEvent, ev); if (ev->hostname && *ev->hostname) return rb_str_new2(ev->hostname); else return rb_str_new2("localhost"); }