tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

pr_gethostbyname.rst (1157B)


      1 PR_GetHostByName
      2 ================
      3 
      4 Looks up a host by name.
      5 
      6 
      7 Syntax
      8 ------
      9 
     10 .. code::
     11 
     12   #include <prnetdb.h>
     13 
     14   PRStatus PR_GetHostByName(
     15     const char *hostname,
     16     char *buf,
     17     PRIntn bufsize,
     18     PRHostEnt *hostentry);
     19 
     20 
     21 Parameters
     22 ~~~~~~~~~~
     23 
     24 The function has the following parameters:
     25 
     26 ``hostname``
     27   The character string defining the host name of interest.
     28 ``buf``
     29   A pointer to a buffer, allocated by the caller, that is filled in
     30   with host data on output. All of the pointers in the ``hostentry``
     31   structure point to data saved in this buffer. This buffer is
     32   referenced by the runtime during a call to :ref:`PR_EnumerateHostEnt`.
     33 ``bufsize``
     34   Number of bytes in the ``buf`` parameter. The buffer must be at least
     35   :ref:`PR_NETDB_BUF_SIZE` bytes.
     36 ``hostentry``
     37   This structure is allocated by the caller. On output, this structure
     38   is filled in by the runtime if the function returns ``PR_SUCCESS``.
     39 
     40 
     41 Returns
     42 ~~~~~~~
     43 
     44 The function returns one of the following values:
     45 
     46 -  If successful, ``PR_SUCCESS``.
     47 -  If unsuccessful, ``PR_FAILURE``. You can retrieve the reason for the
     48   failure by calling :ref:`PR_GetError`.