* More MSVC fixes, using XINLINE instead of inline, MSVC has troubles

with inline. Thanks to David Maass for reporting.
* Changed XINLINE to UPNP_INLINE.
* Lots of white space changes.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@192 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2007-05-23 13:20:55 +00:00
parent d8ba182d85
commit 81635d74c1
23 changed files with 335 additions and 302 deletions

View File

@ -2,6 +2,11 @@
Version 1.4.7
*******************************************************************************
2007-05-21 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* More MSVC fixes, using XINLINE instead of inline, MSVC has troubles
with inline. Thanks to David Maass for reporting.
* Changed XINLINE to UPNP_INLINE.
2007-05-21 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Added the file build/inc/msvc/inttypes.h. This file is for use with
MSVC only, because it does not provide C99 compatibility.

View File

@ -39,7 +39,7 @@
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
#ifndef WIN32
#define XINLINE inline
#define UPNP_INLINE inline
#endif
#define MEMBUF_DEF_SIZE_INC 20

View File

@ -65,20 +65,35 @@
#else
#define EXPORT_SPEC
#endif
#ifdef UPNP_USE_MSVCPP // define some things the M$ VC++ doesn't know
#ifdef UPNP_USE_MSVCPP
// define some things the M$ VC++ doesn't know
#define UPNP_INLINE
typedef __int64 int64_t;
#define PRId64 "I64d"
#define PRIzu "lu"
#endif
#ifdef UPNP_USE_BCBPP // define some things Borland Builder doesn't know
#ifdef UPNP_USE_BCBPP
// define some things Borland Builder doesn't know
#define UPNP_INLINE inline
typedef __int64 int64_t;
#warning The Borland C compiler is probably broken on PRId64, please someone provide a proper fix here
#define PRId64 "I64d"
#define PRIzu "zu"
#endif
#else
#define EXPORT_SPEC
#define UPNP_INLINE inline
// Invented this macro so that we can live a little longer with MSVC lack of C99.
#define PRIzu "zu"
#endif
//
// Defining this macro here gives some interesting information about unused
// functions in the code. Of course, this should never go uncommented on a
// release.
//
//#define inline
#ifndef WIN32
#define UpnpCloseSocket close

View File

@ -106,6 +106,7 @@ typedef enum Upnp_LogLevel_e {
*
* Description:
* This functions initializes the log files
*
* Returns: int
* -1 : If fails
* UPNP_E_SUCCESS : if success
@ -113,7 +114,7 @@ typedef enum Upnp_LogLevel_e {
#ifdef DEBUG
int UpnpInitLog();
#else
static inline int UpnpInitLog() { return UPNP_E_SUCCESS; }
static UPNP_INLINE int UpnpInitLog() { return UPNP_E_SUCCESS; }
#endif
// for backward compatibility
@ -132,7 +133,7 @@ static inline int UpnpInitLog() { return UPNP_E_SUCCESS; }
#ifdef DEBUG
void UpnpSetLogLevel(Upnp_LogLevel log_level);
#else
static inline void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
#endif
@ -148,7 +149,7 @@ static inline void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
#ifdef DEBUG
void UpnpCloseLog();
#else
static inline void UpnpCloseLog() {}
static UPNP_INLINE void UpnpCloseLog() {}
#endif
// for backward compatibility
@ -174,7 +175,7 @@ void UpnpSetLogFileNames(
const char *ErrFileName,
const char *InfoFileName);
#else
static inline void UpnpSetLogFileNames(
static UPNP_INLINE void UpnpSetLogFileNames(
const char *ErrFileName,
const char *InfoFileName) {}
#endif
@ -202,7 +203,7 @@ static inline void UpnpSetLogFileNames(
#ifdef DEBUG
FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module);
#else
static inline FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module)
static UPNP_INLINE FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module)
{
return NULL;
}
@ -232,7 +233,7 @@ int DebugAtThisLevel(
IN Upnp_LogLevel DLevel,
IN Dbg_Module Module);
#else
static inline int DebugAtThisLevel(
static UPNP_INLINE int DebugAtThisLevel(
IN Upnp_LogLevel DLevel,
IN Dbg_Module Module) { return 0; }
#endif
@ -269,7 +270,7 @@ void UpnpPrintf (Upnp_LogLevel DLevel, Dbg_Module Module,
#endif
;
#else
static inline void UpnpPrintf(
static UPNP_INLINE void UpnpPrintf(
Upnp_LogLevel DLevel,
Dbg_Module Module,
const char* DbgFileName,
@ -300,7 +301,7 @@ void UpnpDisplayBanner(
size_t size,
int starlength);
#else
static inline void UpnpDisplayBanner(
static UPNP_INLINE void UpnpDisplayBanner(
FILE *fd,
const char **lines,
size_t size,
@ -328,7 +329,7 @@ void UpnpDisplayFileAndLine(
const char *DbgFileName,
int DbgLineNo);
#else
static inline void UpnpDisplayFileAndLine(
static UPNP_INLINE void UpnpDisplayFileAndLine(
FILE *fd,
const char *DbgFileName,
int DbgLineNo) {}

View File

@ -94,6 +94,7 @@ UpnpSetLogFileNames ( IN const char *ErrFileName,
*
* Description:
* This functions initializes the log files
*
* Returns: int
* -1 : If fails
* UPNP_E_SUCCESS : if success

View File

@ -188,7 +188,7 @@ free_notify_struct( IN notify_thread_struct * input )
*
* Note : called by genaNotify
****************************************************************************/
static XINLINE int
static UPNP_INLINE int
notify_send_and_recv( IN uri_type * destination_url,
IN membuffer * mid_msg,
IN char *propertySet,

View File

@ -215,7 +215,7 @@ dispatch_request( IN SOCKINFO * info,
*
* Note :
************************************************************************/
static XINLINE void
static UPNP_INLINE void
handle_error( IN SOCKINFO * info,
int http_error_code,
int major,
@ -333,7 +333,7 @@ handle_request( void *args )
*
* Note :
************************************************************************/
static XINLINE void
static UPNP_INLINE void
schedule_request_job( IN int connfd,
IN struct sockaddr_in *clientAddr )
{

View File

@ -121,7 +121,7 @@ str_int_entry Http_Header_Names[NUM_HTTP_HEADER_NAMES] = {
*
* Note :
************************************************************************/
static XINLINE void
static UPNP_INLINE void
scanner_init( OUT scanner_t * scanner,
IN membuffer * bufptr )
{
@ -142,7 +142,7 @@ scanner_init( OUT scanner_t * scanner,
*
* Note :
************************************************************************/
static XINLINE xboolean
static UPNP_INLINE xboolean
is_separator_char( IN char c )
{
return strchr( " \t()<>@,;:\\\"/[]?={}", c ) != NULL;
@ -160,7 +160,7 @@ is_separator_char( IN char c )
*
* Note :
************************************************************************/
static XINLINE xboolean
static UPNP_INLINE xboolean
is_identifier_char( IN char c )
{
return ( c >= 32 && c <= 126 ) && !is_separator_char( c );
@ -178,7 +178,7 @@ is_identifier_char( IN char c )
*
* Note :
************************************************************************/
static XINLINE xboolean
static UPNP_INLINE xboolean
is_control_char( IN char c )
{
return ( ( c >= 0 && c <= 31 ) || ( c == 127 ) );
@ -196,7 +196,7 @@ is_control_char( IN char c )
*
* Note :
************************************************************************/
static XINLINE xboolean
static UPNP_INLINE xboolean
is_qdtext_char( IN char cc )
{
unsigned char c = ( unsigned char )cc;
@ -375,7 +375,7 @@ scanner_get_token( INOUT scanner_t * scanner,
*
* Note :
************************************************************************/
static XINLINE char *
static UPNP_INLINE char *
scanner_get_str( IN scanner_t * scanner )
{
return scanner->msg->buf + scanner->cursor;
@ -395,7 +395,9 @@ scanner_get_str( IN scanner_t * scanner )
*
* Note :
************************************************************************/
static XINLINE void
#warning The only use of the function 'scanner_pushback()' in the code is commented out.
#warning 'scanner_pushback()' is a good candidate for removal.
static UPNP_INLINE void
scanner_pushback( INOUT scanner_t * scanner,
IN size_t pushback_bytes )
{
@ -614,7 +616,7 @@ httpmsg_find_hdr( IN http_message_t * msg,
*
* Note :
************************************************************************/
static XINLINE int
static UPNP_INLINE int
skip_blank_lines( INOUT scanner_t * scanner )
{
memptr token;
@ -651,7 +653,7 @@ skip_blank_lines( INOUT scanner_t * scanner )
*
* Note :
************************************************************************/
static XINLINE int
static UPNP_INLINE int
skip_lws( INOUT scanner_t * scanner )
{
memptr token;
@ -698,7 +700,7 @@ skip_lws( INOUT scanner_t * scanner )
*
* Description : Match a string without whitespace or CRLF (%S)
*
* Return : XINLINE parse_status_t ;
* Return : UPNP_INLINE parse_status_t ;
* PARSE_OK
* PARSE_NO_MATCH
* PARSE_FAILURE
@ -706,7 +708,7 @@ skip_lws( INOUT scanner_t * scanner )
*
* Note :
************************************************************************/
static XINLINE parse_status_t
static UPNP_INLINE parse_status_t
match_non_ws_string( INOUT scanner_t * scanner,
OUT memptr * str )
{
@ -772,7 +774,7 @@ match_non_ws_string( INOUT scanner_t * scanner,
*
* Note :
************************************************************************/
static XINLINE parse_status_t
static UPNP_INLINE parse_status_t
match_raw_value( INOUT scanner_t * scanner,
OUT memptr * raw_value )
{
@ -863,7 +865,7 @@ match_raw_value( INOUT scanner_t * scanner,
* PARSE_FAILURE -- bad input
* PARSE_INCOMPLETE
************************************************************************/
static XINLINE int
static UPNP_INLINE int
match_int( INOUT scanner_t * scanner,
IN int base,
OUT int *value )
@ -922,7 +924,7 @@ match_int( INOUT scanner_t * scanner,
* PARSE_FAILURE
* PARSE_INCOMPLETE
************************************************************************/
static XINLINE int
static UPNP_INLINE int
read_until_crlf( INOUT scanner_t * scanner,
OUT memptr * str )
{
@ -963,7 +965,9 @@ read_until_crlf( INOUT scanner_t * scanner,
* PARSE_FAILURE
* PARSE_INCOMPLETE
************************************************************************/
static XINLINE int
#warning There are currently no uses of the function 'skip_to_end_of_header()' in the code.
#warning 'skip_to_end_of_header()' is a good candidate for removal.
static UPNP_INLINE int
skip_to_end_of_header( INOUT scanner_t * scanner )
{
memptr dummy_raw_value;
@ -990,7 +994,7 @@ skip_to_end_of_header( INOUT scanner_t * scanner )
* PARSE_NO_MATCH
* PARSE_INCOMPLETE
************************************************************************/
static XINLINE parse_status_t
static UPNP_INLINE parse_status_t
match_char( INOUT scanner_t * scanner,
IN char c,
IN xboolean case_sensitive )
@ -1337,7 +1341,7 @@ matchstr( IN char *str,
* Returns:
* void
************************************************************************/
static XINLINE void
static UPNP_INLINE void
parser_init( OUT http_parser_t * parser )
{
memset( parser, 0, sizeof( http_parser_t ) );
@ -1872,7 +1876,7 @@ parser_parse_headers_old( INOUT http_parser_t * parser )
* PARSE_FAILURE -- entity length > content-length value
* PARSE_SUCCESS
************************************************************************/
static XINLINE parse_status_t
static UPNP_INLINE parse_status_t
parser_parse_entity_using_clen( INOUT http_parser_t * parser )
{
//int entity_length;
@ -1919,7 +1923,7 @@ parser_parse_entity_using_clen( INOUT http_parser_t * parser )
* PARSE_FAILURE -- entity length > content-length value
* PARSE_SUCCESS
************************************************************************/
static XINLINE parse_status_t
static UPNP_INLINE parse_status_t
parser_parse_chunky_body( INOUT http_parser_t * parser )
{
parse_status_t status;
@ -1964,7 +1968,7 @@ parser_parse_chunky_body( INOUT http_parser_t * parser )
* PARSE_FAILURE -- entity length > content-length value
* PARSE_SUCCESS
************************************************************************/
static XINLINE parse_status_t
static UPNP_INLINE parse_status_t
parser_parse_chunky_headers( INOUT http_parser_t * parser )
{
parse_status_t status;
@ -2004,7 +2008,7 @@ parser_parse_chunky_headers( INOUT http_parser_t * parser )
* PARSE_SUCCESS
* PARSE_CONTINUE_1
************************************************************************/
static XINLINE parse_status_t
static UPNP_INLINE parse_status_t
parser_parse_chunky_entity( INOUT http_parser_t * parser )
{
scanner_t *scanner = &parser->scanner;
@ -2055,7 +2059,7 @@ parser_parse_chunky_entity( INOUT http_parser_t * parser )
* Returns:
* PARSE_INCOMPLETE_ENTITY
************************************************************************/
static XINLINE parse_status_t
static UPNP_INLINE parse_status_t
parser_parse_entity_until_close( INOUT http_parser_t * parser )
{
size_t cursor;
@ -2090,7 +2094,7 @@ parser_parse_entity_until_close( INOUT http_parser_t * parser )
* PARSE_FAILURE
* PARSE_COMPLETE -- no more reading to do
************************************************************************/
XINLINE parse_status_t
UPNP_INLINE parse_status_t
parser_get_entity_read_method( INOUT http_parser_t * parser )
{
http_message_t *hmsg = &parser->msg;
@ -2195,7 +2199,7 @@ parser_get_entity_read_method( INOUT http_parser_t * parser )
* PARSE_FAILURE
* PARSE_COMPLETE -- no more reading to do
************************************************************************/
XINLINE parse_status_t
UPNP_INLINE parse_status_t
parser_parse_entity( INOUT http_parser_t * parser )
{
parse_status_t status = PARSE_OK;

View File

@ -2343,7 +2343,7 @@ http_OpenHttpGetEx( IN const char *url_str,
* Description : Returns the server information for the operating
* system
*
* Return : XINLINE void
* Return : UPNP_INLINE void
*
* Note :
************************************************************************/

View File

@ -118,7 +118,7 @@ static xboolean gInitialized = FALSE;
* Returns:
* void
************************************************************************/
static XINLINE void
static UPNP_INLINE void
init_table( IN const char *encoded_str,
OUT const char *table[],
IN int tbl_size )
@ -144,7 +144,7 @@ init_table( IN const char *encoded_str,
* Returns:
* void
************************************************************************/
static XINLINE void
static UPNP_INLINE void
init_tables( void )
{
init_table( Http1xxStr, Http1xxCodes, NUM_1XX_CODES );

View File

@ -205,7 +205,7 @@ extern str_int_entry Http_Header_Names[NUM_HTTP_HEADER_NAMES];
* Returns:
* void
************************************************************************/
static XINLINE void
static UPNP_INLINE void
media_list_init( void )
{
int i;
@ -243,7 +243,7 @@ media_list_init( void )
* 0 on success;
* -1 on error
************************************************************************/
static XINLINE int
static UPNP_INLINE int
search_extension( IN const char *extension,
OUT const char **con_type,
OUT const char **con_subtype )
@ -290,7 +290,7 @@ search_extension( IN const char *extension,
* 0 - On Sucess
* UPNP_E_OUTOF_MEMORY - on memory allocation failures
************************************************************************/
XINLINE int
UPNP_INLINE int
get_content_type( IN const char *filename,
OUT DOMString * content_type )
{
@ -348,7 +348,7 @@ get_content_type( IN const char *filename,
* Returns:
* void
************************************************************************/
static XINLINE void
static UPNP_INLINE void
glob_alias_init( void )
{
struct xml_alias_t *alias = &gAliasDoc;
@ -370,7 +370,7 @@ glob_alias_init( void )
* Returns:
* BOOLEAN
************************************************************************/
static XINLINE xboolean
static UPNP_INLINE xboolean
is_valid_alias( IN const struct xml_alias_t *alias )
{
return alias->doc.buf != NULL;
@ -700,7 +700,7 @@ web_server_set_root_dir( IN const char *root_dir )
* TRUE - On Success
* FALSE if request is not an alias
************************************************************************/
static XINLINE xboolean
static UPNP_INLINE xboolean
get_alias( IN const char *request_file,
OUT struct xml_alias_t *alias,
OUT struct File_Info *info )

View File

@ -171,7 +171,7 @@ memptr_cmp_nocase( IN memptr * m,
*
* Note :
************************************************************************/
static XINLINE void
static UPNP_INLINE void
membuffer_initialize( INOUT membuffer * m )
{
m->buf = NULL;

View File

@ -491,7 +491,7 @@ const char* method_to_str( IN http_method_t method );
#ifdef DEBUG
void print_http_headers( IN http_message_t *hmsg );
#else
static inline void print_http_headers( IN http_message_t *hmsg ) {}
static UPNP_INLINE void print_http_headers( IN http_message_t *hmsg ) {}
#endif
#ifdef __cplusplus

View File

@ -269,7 +269,7 @@ void printService(
Dbg_Level level,
Dbg_Module module);
#else
static inline void printService(
static UPNP_INLINE void printService(
service_info *service,
Dbg_Level level,
Dbg_Module module) {}
@ -296,7 +296,7 @@ void printServiceList(
Dbg_Level level,
Dbg_Module module);
#else
static inline void printServiceList(
static UPNP_INLINE void printServiceList(
service_info *service,
Dbg_Level level,
Dbg_Module module) {}
@ -324,7 +324,7 @@ void printServiceTable(
Dbg_Level level,
Dbg_Module module);
#else
static inline void printServiceTable(
static UPNP_INLINE void printServiceTable(
service_table *table,
Dbg_Level level,
Dbg_Module module) {}

View File

@ -241,7 +241,8 @@ static inline void ssdp_handle_device_request(
* Returns: void
*
***************************************************************************/
void ssdp_handle_ctrlpt_msg( IN http_message_t* hmsg,
void ssdp_handle_ctrlpt_msg(
IN http_message_t* hmsg,
IN struct sockaddr_in* dest_addr,
IN xboolean timeout,
IN void* cookie );
@ -333,12 +334,10 @@ int ssdp_request_type(IN char * cmd, OUT SsdpEvent * Evt);
* Function : SearchByTarget
*
* Parameters:
* IN int Mx:Number of seconds to wait, to collect all the
* responses.
* IN int Mx:Number of seconds to wait, to collect all the responses.
* char *St: Search target.
* void *Cookie: cookie provided by control point application. This
* cokie will be returned to application in the
* callback.
* cokie will be returned to application in the callback.
*
* Description:
* This function creates and send the search request for a specific URL.
@ -354,10 +353,9 @@ int SearchByTarget(IN int Mx, IN char *St, IN void *Cookie);
* Parameters:
* IN char *DevType : type of the device
* IN int RootDev : flag to indicate if the device is root device
* IN char * nt : value of NT
* IN char * usn :
* IN char * location :Location URL.
* IN int duration :Service duration in sec.
* IN char *Udn :
* IN char *Location: Location URL.
* IN int Duration : Service duration in sec.
*
* Description:
* This function creates the device advertisement request based on
@ -366,8 +364,12 @@ int SearchByTarget(IN int Mx, IN char *St, IN void *Cookie);
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
***************************************************************************/
int DeviceAdvertisement(IN char * DevType, int RootDev,char * Udn,
IN char * Location, IN int Duration);
int DeviceAdvertisement(
IN char *DevType,
IN int RootDev,
IN char *Udn,
IN char *Location,
IN int Duration);
/************************************************************************
@ -388,7 +390,8 @@ int DeviceAdvertisement(IN char * DevType, int RootDev,char * Udn,
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
***************************************************************************/
int DeviceShutdown( IN char * DevType,
int DeviceShutdown(
IN char *DevType,
IN int RootDev,
IN char *Udn,
IN char *_Server,
@ -405,7 +408,7 @@ int DeviceShutdown( IN char * DevType,
* IN char *Udn: Device UDN
* IN char *Location: Location of Device description document.
* IN int Duration :Life time of this device.
*
* Description:
* This function creates the reply packet based on the input parameter,
* and send it to the client address given in its input parameter DestAddr.
@ -413,7 +416,8 @@ int DeviceShutdown( IN char * DevType,
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
***************************************************************************/
int DeviceReply(IN struct sockaddr_in * DestAddr,
int DeviceReply(
IN struct sockaddr_in * DestAddr,
IN char *DevType,
IN int RootDev,
IN char *Udn,
@ -439,7 +443,8 @@ int DeviceReply(IN struct sockaddr_in * DestAddr,
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
***************************************************************************/
int SendReply(IN struct sockaddr_in * DestAddr,
int SendReply(
IN struct sockaddr_in * DestAddr,
IN char *DevType,
IN int RootDev,
IN char *Udn,
@ -455,16 +460,16 @@ int SendReply(IN struct sockaddr_in * DestAddr,
* IN char *ServType: Service Type.
* IN char * Location: Location of Device description document.
* IN int Duration :Life time of this device.
*
* Description:
* This function creates the advertisement packet based
* on the input parameter, and send it to the multicast channel.
*
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
***************************************************************************/
int ServiceAdvertisement( IN char * Udn,
int ServiceAdvertisement(
IN char *Udn,
IN char *ServType,
IN char *Location,
IN int Duration);
@ -479,16 +484,16 @@ int ServiceAdvertisement( IN char * Udn,
* IN char *Server: Not used
* IN char *Location: Location of Device description document.
* IN int Duration :Life time of this device.
*
* Description:
* This function creates the advertisement packet based
* on the input parameter, and send it to the multicast channel.
*
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
***************************************************************************/
int ServiceReply(IN struct sockaddr_in *DestAddr,
int ServiceReply(
IN struct sockaddr_in *DestAddr,
IN char *ServType,
IN char *Udn,
IN char *Location,
@ -502,7 +507,7 @@ int ServiceReply(IN struct sockaddr_in *DestAddr,
* IN char *ServType: Service Type.
* IN char *Location: Location of Device description document.
* IN int Duration :Service duration in sec.
*
* Description:
* This function creates a HTTP service shutdown request packet
* and sent it to the multicast channel through RequestHandler.
@ -510,7 +515,9 @@ int ServiceReply(IN struct sockaddr_in *DestAddr,
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
***************************************************************************/
int ServiceShutdown( IN char * Udn, IN char * ServType,
int ServiceShutdown(
IN char *Udn,
IN char *ServType,
IN char *Location,
IN int Duration);
@ -534,7 +541,8 @@ void * advertiseAndReplyThread(IN void * data);
* Function : AdvertiseAndReply
*
* Parameters:
* IN int AdFlag: -1 = Send shutdown, 0 = send reply,
* IN int AdFlag: -1 = Send shutdown,
* 0 = send reply,
* 1 = Send Advertisement
* IN UpnpDevice_Handle Hnd: Device handle
* IN enum SsdpSearchType SearchType:Search type for sending replies
@ -550,7 +558,8 @@ void * advertiseAndReplyThread(IN void * data);
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
***************************************************************************/
int AdvertiseAndReply(IN int AdFlag,
int AdvertiseAndReply(
IN int AdFlag,
IN UpnpDevice_Handle Hnd,
IN enum SsdpSearchType SearchType,
IN struct sockaddr_in *DestAddr,

View File

@ -38,10 +38,9 @@
#ifndef WIN32
#include <sys/socket.h>
#else
#define XINLINE
typedef int socklen_t;
#define EAFNOSUPPORT 97
#endif
#endif // GENLIB_NET_UNIXUTIL_H

View File

@ -190,7 +190,7 @@ void free_URL_list(URL_list * list);
#ifdef DEBUG
void print_uri(uri_type *in);
#else
static inline void print_uri(uri_type *in) {}
static UPNP_INLINE void print_uri(uri_type *in) {}
#endif
/************************************************************************
@ -208,7 +208,7 @@ static inline void print_uri(uri_type *in) {}
#ifdef DEBUG
void print_token(token *in);
#else
static inline void print_token(token * in) {}
static UPNP_INLINE void print_token(token * in) {}
#endif
/************************************************************************

View File

@ -136,14 +136,10 @@ void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen
#endif
//////////////////////////////////
// C specific
#ifndef __cplusplus
#ifndef WIN32
#define XINLINE inline
#else
#ifdef WIN32
#ifndef S_ISREG
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
@ -164,3 +160,4 @@ void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen
#endif // __cplusplus
#endif /* GENLIB_UTIL_UTIL_H */

View File

@ -244,7 +244,7 @@ get_node_value( IN IXML_Node * node )
*
* Note :
****************************************************************************/
static XINLINE int
static UPNP_INLINE int
get_host_and_path( IN char *ctrl_url,
OUT const memptr *host,
OUT const memptr *path,
@ -277,7 +277,7 @@ get_host_and_path( IN char *ctrl_url,
*
* Note :
****************************************************************************/
static XINLINE int
static UPNP_INLINE int
get_action_name( IN char *action,
OUT memptr * name )
{
@ -303,7 +303,7 @@ get_action_name( IN char *action,
*
* Note :
****************************************************************************/
static XINLINE int
static UPNP_INLINE int
add_man_header( INOUT membuffer * headers )
{
char *soap_action_hdr;

View File

@ -85,7 +85,7 @@ const char *ContentTypeHeader =
* 0 if successful else returns appropriate error.
* Note :
****************************************************************************/
static XINLINE int
static UPNP_INLINE int
get_request_type( IN http_message_t * request,
OUT memptr * action_name )
{
@ -262,7 +262,7 @@ send_error_response( IN SOCKINFO * info,
*
* Note :
****************************************************************************/
static XINLINE void
static UPNP_INLINE void
send_var_query_response( IN SOCKINFO * info,
IN const char *var_value,
IN http_message_t * hmsg )
@ -326,12 +326,12 @@ send_var_query_response( IN SOCKINFO * info,
* Description : This function separates the action node from
* the root DOM node.
*
* Return : static XINLINE int
* Return : static UPNP_INLINE int
* 0 if successful, or -1 if fails.
*
* Note :
****************************************************************************/
static XINLINE int
static UPNP_INLINE int
get_action_node( IN IXML_Document * TempDoc,
IN char *NodeName,
OUT IXML_Document ** RespNode )
@ -681,7 +681,7 @@ get_device_info( IN http_message_t * request,
*
* Note :
****************************************************************************/
static XINLINE void
static UPNP_INLINE void
send_action_response( IN SOCKINFO * info,
IN IXML_Document * action_resp,
IN http_message_t * request )
@ -769,7 +769,7 @@ error_handler:
* returns 0 if successful else returns -1.
* Note :
****************************************************************************/
static XINLINE int
static UPNP_INLINE int
get_var_name( IN IXML_Document * TempDoc,
OUT char *VarName )
{
@ -840,7 +840,7 @@ error_handler:
*
* Note :
****************************************************************************/
static XINLINE void
static UPNP_INLINE void
handle_query_variable( IN SOCKINFO * info,
IN http_message_t * request,
IN IXML_Document * xml_doc )

View File

@ -365,7 +365,9 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
* Returns: void
*
***************************************************************************/
static XINLINE void
#warning There are currently no uses of the function 'process_reply()' in the code.
#warning 'process_reply()' is a good candidate for removal.
static UPNP_INLINE void
process_reply( IN char *request_buf,
IN int buf_len,
IN struct sockaddr_in *dest_addr,

View File

@ -641,7 +641,7 @@ free_ssdp_event_handler_data( void *the_data )
* Returns: xboolean
* returns TRUE if msg is valid else FALSE
***************************************************************************/
static XINLINE xboolean
static UPNP_INLINE xboolean
valid_ssdp_msg( IN http_message_t * hmsg )
{
memptr hdr_value;
@ -683,7 +683,7 @@ valid_ssdp_msg( IN http_message_t * hmsg )
* Returns: int
* 0 if successful -1 if error
***************************************************************************/
static XINLINE int
static UPNP_INLINE int
start_event_handler( void *Data )
{

View File

@ -62,7 +62,7 @@
*
* Note :
************************************************************************/
static XINLINE void
static UPNP_INLINE void
addrToString( IN const struct sockaddr_in *addr,
OUT char ipaddr_port[] )
{
@ -87,7 +87,7 @@ addrToString( IN const struct sockaddr_in *addr,
*
* Note : 'newAlias' should be freed using free()
************************************************************************/
static XINLINE int
static UPNP_INLINE int
calc_alias( IN const char *alias,
IN const char *rootPath,
OUT char **newAlias )
@ -148,7 +148,7 @@ calc_alias( IN const char *alias,
*
* Note :
************************************************************************/
static XINLINE int
static UPNP_INLINE int
calc_descURL( IN const char *ipPortStr,
IN const char *alias,
OUT char descURL[LINE_SIZE] )