tor-browser

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

pr_enumeratehostent.rst (1741B)


      1 PR_EnumerateHostEnt
      2 ===================
      3 
      4 Evaluates each of the possible addresses of a :ref:`PRHostEnt` structure,
      5 acquired from :ref:`PR_GetHostByName` or :ref:`PR_GetHostByAddr`.
      6 
      7 
      8 Syntax
      9 ------
     10 
     11 .. code::
     12 
     13   #include <prnetdb.h>
     14 
     15   PRIntn PR_EnumerateHostEnt(
     16     PRIntn enumIndex,
     17     const PRHostEnt *hostEnt,
     18     PRUint16 port,
     19     PRNetAddr *address);
     20 
     21 
     22 Parameters
     23 ~~~~~~~~~~
     24 
     25 The function has the following parameters:
     26 
     27 ``enumIndex``
     28   The index of the enumeration. To begin an enumeration, this argument
     29   is set to zero. To continue an enumeration (thereby getting
     30   successive addresses from the host entry structure), the value should
     31   be set to the function's last returned value. The enumeration is
     32   complete when a value of zero is returned.
     33 ``hostEnt``
     34   A pointer to a :ref:`PRHostEnt` structure obtained from
     35   :ref:`PR_GetHostByName` or :ref:`PR_GetHostByAddr`.
     36 ``port``
     37   The port number to be assigned as part of the :ref:`PRNetAddr`
     38   structure. This parameter is not checked for validity.
     39 ``address``
     40   On input, a pointer to a :ref:`PRNetAddr` structure. On output, this
     41   structure is filled in by the runtime if the result of the call is
     42   greater than 0.
     43 
     44 
     45 Returns
     46 ~~~~~~~
     47 
     48 The function returns one of the following values:
     49 
     50 -  If successful, the function returns the value you should specify in
     51   the ``enumIndex`` parameter for the next call of the enumerator. If
     52   the function returns 0, the enumeration is ended.
     53 -  If unsuccessful, the function returns -1. You can retrieve the reason
     54   for the failure by calling :ref:`PR_GetError`.
     55 
     56 
     57 Description
     58 -----------
     59 
     60 :ref:`PR_EnumerateHostEnt` is a stateless enumerator. The principle input,
     61 the :ref:`PRHostEnt` structure, is not modified.