emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

:family extension for make_network_process


From: 山本和彦
Subject: :family extension for make_network_process
Date: Mon, 12 Dec 2005 14:59:43 +0900 (JST)

Hello, 

I would report one documentation mistake and propose an extension for
make_network_process.

DOC: 

Recently many OSes have implemented getaddrinfo. In this case, AF_UNSPEC
is used. Thus, the documentation of the :family arguments should be
        "The default address family is IPv6 or IPv4"
instead of
        "The default address family is Inet (or IPv4)".

EXTENSION:

Since nil for :family cannot ensure to choose IPv4, I would propose
two more symbols for the :family arguments:
        'inet for IPv4
        'inet6 for IPv6

Note the :family arguments: can take an integer but it is not
practical to tell the value of AF_INET (or AF_INET6) from the Elisp
level in ALL environments.

The following is a sample code to implement this. Please merge this
code if possible.

Please don't delete my e-mail address from the To: field when you
reply. Thanks.

--Kazu Yamamoto

Index: process.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/process.c,v
retrieving revision 1.467
diff -c -r1.467 process.c
*** process.c   8 Nov 2005 21:38:37 -0000       1.467
--- process.c   10 Dec 2005 11:40:39 -0000
***************
*** 141,146 ****
--- 141,147 ----
  Lisp_Object Qrun, Qstop, Qsignal;
  Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten;
  Lisp_Object Qlocal, Qdatagram;
+ Lisp_Object Qinet, Qinet6;
  Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype;
  Lisp_Object QClocal, QCremote, QCcoding;
  Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
***************
*** 2596,2603 ****
  
  :family FAMILY -- FAMILY is the address (and protocol) family for the
  service specified by HOST and SERVICE.  The default address family is
! Inet (or IPv4) for the host and port number specified by HOST and
  SERVICE.  Other address families supported are:
    local -- for a local (i.e. UNIX) address specified by SERVICE.
  
  :local ADDRESS -- ADDRESS is the local address used for the connection.
--- 2597,2606 ----
  
  :family FAMILY -- FAMILY is the address (and protocol) family for the
  service specified by HOST and SERVICE.  The default address family is
! IPv6 or IPv4 for the host and port number specified by HOST and
  SERVICE.  Other address families supported are:
+   inet  -- for an IPv4 address specified by SERVICE.
+   inet6 -- for an IPv6 address specified by SERVICE.
    local -- for a local (i.e. UNIX) address specified by SERVICE.
  
  :local ADDRESS -- ADDRESS is the local address used for the connection.
***************
*** 2859,2866 ****
      family = XINT (tem);
    else
      {
!       if (NILP (tem))
        family = AF_INET;
  #ifdef HAVE_LOCAL_SOCKETS
        else if (EQ (tem, Qlocal))
        family = AF_LOCAL;
--- 2862,2871 ----
      family = XINT (tem);
    else
      {
!       if (NILP (tem) || EQ (tem, Qinet))
        family = AF_INET;
+       else if (EQ (tem, Qinet6))
+       family = AF_INET6;
  #ifdef HAVE_LOCAL_SOCKETS
        else if (EQ (tem, Qlocal))
        family = AF_LOCAL;
***************
*** 6724,6729 ****
--- 6729,6736 ----
  #ifdef HAVE_LOCAL_SOCKETS
     ADD_SUBFEATURE (QCfamily, Qlocal);
  #endif
+    ADD_SUBFEATURE (QCfamily, Qinet);
+    ADD_SUBFEATURE (QCfamily, Qinet6);
  #ifdef HAVE_GETSOCKNAME
     ADD_SUBFEATURE (QCservice, Qt);
  #endif
***************
*** 6782,6787 ****
--- 6789,6798 ----
    staticpro (&Qlisten);
    Qlocal = intern ("local");
    staticpro (&Qlocal);
+   Qinet = intern ("inet");
+   staticpro (&Qinet);
+   Qinet6 = intern ("inet6");
+   staticpro (&Qinet6);
    Qdatagram = intern ("datagram");
    staticpro (&Qdatagram);
  








reply via email to

[Prev in Thread] Current Thread [Next in Thread]