pr_getprotobyname.rst (1052B)
1 PR_GetProtoByName 2 ================= 3 4 Looks up a protocol entry based on the protocol's name. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 #include <prnetdb.h> 13 14 PRStatus PR_GetProtoByName( 15 const char* protocolname, 16 char* buffer, 17 PRInt32 bufsize, 18 PRProtoEnt* result); 19 20 21 Parameters 22 ~~~~~~~~~~ 23 24 The function has the following parameters: 25 26 ``protocolname`` 27 A pointer to the character string of the protocol's name. 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:`PRProtoEnt` 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`.