pike.git / lib / modules / Protocols.pmod / DNS_SD.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/DNS_SD.pmod:1: - // $Id: DNS_SD.pmod,v 1.1 2005/04/09 21:07:21 jonasw Exp $ + // $Id: DNS_SD.pmod,v 1.2 2008/06/28 16:36:56 nilsson Exp $   // Interface to DNS Service Discovery. Written by Jonas Walldén.         #pike __REAL_VERSION__      #if constant(_Protocols_DNS_SD.Service)         //! This class provides an interface to DNS Service Discovery. The   //! functionality of DNS-SD is described at <http://www.dns-sd.org/>.
pike.git/lib/modules/Protocols.pmod/DNS_SD.pmod:19: Inside #if constant(_Protocols_DNS_SD.Service)
  //! specify a TXT record. The contents of the TXT record varies between   //! different services; for example, a web server can announce a path   //! to a web page, and a printer spooler is able to list printer   //! features such as color support or two-sided printing.   //!   //! The service is registered on the network for as long as the instance   //! of the Service class is valid.   class Service {    inherit _Protocols_DNS_SD.Service;    -  private static string clip_utf8_str(string s, int maxlen) +  private protected string clip_utf8_str(string s, int maxlen)    {    // Clip before UTF-8 encoding to limit loop to a few iterations at most    s = s[..maxlen - 1];    string s_utf8 = string_to_utf8(s);    while (strlen(s_utf8) > maxlen) {    // Shorten one (possibly wide) character    s = s[..strlen(s) - 2];    s_utf8 = string_to_utf8(s);    }    return s_utf8;    }       -  private static string get_flat_txt_record(void|string|array(string) txt) +  private protected string get_flat_txt_record(void|string|array(string) txt)    {    string txt_flat;       if (txt && stringp(txt))    txt = ({ txt });    if (arrayp(txt) && sizeof(txt)) {    txt_flat = "";    foreach(txt, string entry) {    entry = clip_utf8_str(entry, 255);    txt_flat += sprintf("%c%s", (int) strlen(entry), entry);
pike.git/lib/modules/Protocols.pmod/DNS_SD.pmod:110: Inside #if constant(_Protocols_DNS_SD.Service)
      // Pack array of text message records    string txt_flat = get_flat_txt_record(txt);       // Invoke C code    ::create(name || "", service, domain || "", port, txt_flat || "");    }      };   #endif +