pr_getprotobynumber.rst (1034B)
1 PR_GetProtoByNumber 2 =================== 3 4 Looks up a protocol entry based on protocol's number. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 #include <prnetdb.h> 13 14 PRStatus PR_GetProtoByNumber( 15 PRInt32 protocolnumber, 16 char* buffer, 17 PRInt32 bufsize, 18 PRProtoEnt* result); 19 20 21 Parameters 22 ~~~~~~~~~~ 23 24 The function has the following parameters: 25 26 ``protocolnumber`` 27 The number assigned to the protocol. 28 ``buffer`` 29 A pointer to a scratch buffer for the runtime to return result. This 30 buffer is allocated by the caller. 31 ``bufsize`` 32 Number of bytes in the ``buffer`` parameter. The buffer must be at 33 least :ref:`PR_NETDB_BUF_SIZE` bytes. 34 ``result`` 35 On input, a pointer to a :ref:`PRNetAddr` structure. On output, this 36 structure is filled in by the runtime if the function returns 37 ``PR_SUCCESS``. 38 39 40 Returns 41 ~~~~~~~ 42 43 The function returns one of the following values: 44 45 - If successful, ``PR_SUCCESS``. 46 - If unsuccessful, ``PR_FAILURE``. You can retrieve the reason for the 47 failure by calling :ref:`PR_GetError`.