Changeset 348


Ignore:
Timestamp:
Mar 22, 2006 11:48:33 AM (19 years ago)
Author:
bennylp
Message:

Added pj_inet_addr2()

Location:
pjproject/trunk/pjlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/sock.h

    r338 r348  
    328328PJ_DECL(pj_in_addr) pj_inet_addr(const pj_str_t *cp); 
    329329 
     330/** 
     331 * Convert address string with numbers and dots to binary IP address. 
     332 *  
     333 * @param cp        The IP address in numbers and dots notation. 
     334 * @return          If success, the IP address is returned in network 
     335 *                  byte order. If failed, PJ_INADDR_NONE will be 
     336 *                  returned. 
     337 * @remark 
     338 * This is an obsolete interface to #pj_inet_aton(); it is obsolete 
     339 * because -1 is a valid address (255.255.255.255), and #pj_inet_aton() 
     340 * provides a cleaner way to indicate error return. 
     341 */ 
     342PJ_DECL(pj_in_addr) pj_inet_addr2(const char *cp); 
    330343 
    331344/** 
  • pjproject/trunk/pjlib/src/pj/sock_bsd.c

    r338 r348  
    186186 
    187187/* 
     188 * Convert address string with numbers and dots to binary IP address. 
     189 */  
     190PJ_DEF(pj_in_addr) pj_inet_addr2(const char *cp) 
     191{ 
     192    pj_str_t str = pj_str((char*)cp); 
     193    return pj_inet_addr(&str); 
     194} 
     195 
     196/* 
    188197 * Set the IP address of an IP socket address from string address,  
    189198 * with resolving the host if necessary. The string address may be in a 
Note: See TracChangeset for help on using the changeset viewer.