Commit 1896a794 authored by Jehan Monnier's avatar Jehan Monnier

prepare wince port

parent 798b8e72
......@@ -36,7 +36,7 @@ AM_PROG_CC_C_O
case $target_os in
*mingw32ce)
CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501 -Dstrerror="
CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501"
CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
LIBS="$LIBS -lws2 -liphlpapi"
mingw_found=yes
......
......@@ -26,10 +26,12 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef _WIN32_WCE
#include <errno.h>
#include <unistd.h>
#endif /*_WIN32_WCE*/
#include <limits.h>
#include <ctype.h>
#include <unistd.h>
#include <linphonecore.h>
#include "linphonec.h"
......@@ -282,7 +284,7 @@ linphonec_command_generator(const char *text, int state)
if (strncmp(name, text, len) == 0)
{
return strdup(name);
return ortp_strdup(name);
}
}
......@@ -577,10 +579,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args)
args+=4;
if ( ! *args ) return 0;
friend_num = strtol(args, NULL, 10);
#ifndef _WIN32_WCE
if ( errno == ERANGE ) {
linphonec_out("Invalid friend number\n");
return 0;
}
#endif /*_WIN32_WCE*/
linphonec_friend_call(lc, friend_num);
return 1;
}
......@@ -597,10 +601,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args)
else
{
friend_num = strtol(args, NULL, 10);
#ifndef _WIN32_WCE
if ( errno == ERANGE ) {
linphonec_out("Invalid friend number\n");
return 0;
}
#endif /*_WIN32_WCE*/
}
linphonec_friend_delete(lc, friend_num);
return 1;
......@@ -1401,9 +1407,9 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args){
static int lpc_cmd_status(LinphoneCore *lc, char *args)
{
if ( ! args ) return 0;
LinphoneProxyConfig *cfg;
if ( ! args ) return 0;
linphone_core_get_default_proxy(lc,&cfg);
if (strstr(args,"register"))
{
......
......@@ -23,24 +23,28 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
****************************************************************************/
#include <errno.h>
#include <string.h>
#ifndef _WIN32_WCE
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include "private.h" /*coreapi/private.h, needed for LINPHONE_VERSION */
#endif /*_WIN32_WCE*/
#include <limits.h>
#include <ctype.h>
#include <linphonecore.h>
#include "private.h" /*coreapi/private.h, needed for LINPHONE_VERSION */
#include "linphonec.h"
#ifdef WIN32
#include <ws2tcpip.h>
#include <ctype.h>
#ifndef _WIN32_WCE
#include <conio.h>
#endif /*_WIN32_WCE*/
#else
#include <sys/socket.h>
#include <netdb.h>
......@@ -48,6 +52,21 @@
#include <sys/stat.h>
#endif
#if defined(_WIN32_WCE)
#if !defined(PATH_MAX)
#define PATH_MAX 256
#endif /*PATH_MAX*/
#if !defined(strdup)
#define strdup _strdup
#endif /*strdup*/
/*
#if !defined(access)
#define access _access
#endif*/ /*access*/
#endif /*_WIN32_WCE*/
#ifdef HAVE_GETTEXT
#include <libintl.h>
......@@ -78,7 +97,9 @@ typedef struct {
char *lpc_strip_blanks(char *input);
static int handle_configfile_migration(void);
#if !defined(_WIN32_WCE)
static int copy_file(const char *from, const char *to);
#endif /*_WIN32_WCE*/
static int linphonec_parse_cmdline(int argc, char **argv);
static int linphonec_init(int argc, char **argv);
static int linphonec_main_loop (LinphoneCore * opm, char * sipAddr);
......@@ -135,15 +156,22 @@ static int trace_level = 0;
static char *logfile_name = NULL;
static char configfile_name[PATH_MAX];
static char *sipAddr = NULL; /* for autocall */
#if !defined(_WIN32_WCE)
static ortp_pipe_t client_sock=ORTP_PIPE_INVALID;
#endif /*_WIN32_WCE*/
char prompt[PROMPT_MAX_LEN];
#if !defined(_WIN32_WCE)
static ortp_thread_t pipe_reader_th;
static bool_t pipe_reader_run=FALSE;
#endif /*_WIN32_WCE*/
#if !defined(_WIN32_WCE)
static ortp_pipe_t server_sock;
#endif /*_WIN32_WCE*/
LinphoneCoreVTable linphonec_vtable = {
LinphoneCoreVTable linphonec_vtable
#if !defined (_MSC_VER)
= {
.show =(ShowInterfaceCb) stub,
.inv_recv = linphonec_call_received,
.bye_recv = linphonec_bye_received,
......@@ -162,7 +190,9 @@ LinphoneCoreVTable linphonec_vtable = {
.text_received=linphonec_text_received,
.general_state=linphonec_general_state,
.dtmf_received=linphonec_dtmf_received
};
}
#endif /*_WIN32_WCE*/
;
......@@ -380,14 +410,14 @@ static void start_prompt_reader(void){
ms_mutex_init(&prompt_mutex,NULL);
ortp_thread_create(&th,NULL,prompt_reader_thread,NULL);
}
#if !defined(_WIN32_WCE)
static ortp_pipe_t create_server_socket(void){
char path[128];
#ifndef WIN32
snprintf(path,sizeof(path)-1,"linphonec-%i",getuid());
#else
{
char username[128];
TCHAR username[128];
DWORD size=sizeof(username)-1;
GetUserName(username,&size);
snprintf(path,sizeof(path)-1,"linphonec-%s",username);
......@@ -396,6 +426,7 @@ static ortp_pipe_t create_server_socket(void){
return ortp_server_pipe_create(path);
}
static void *pipe_thread(void*p){
char tmp[250];
server_sock=create_server_socket();
......@@ -446,6 +477,7 @@ static void stop_pipe_reader(void){
ortp_server_pipe_close(server_sock);
ortp_thread_join(pipe_reader_th,NULL);
}
#endif /*_WIN32_WCE*/
#ifdef HAVE_READLINE
#define BOOL_HAVE_READLINE 1
......@@ -462,8 +494,10 @@ char *linphonec_readline(char *prompt){
prompt_reader_started=TRUE;
}
if (unix_socket && !pipe_reader_started){
#if !defined(_WIN32_WCE)
start_pipe_reader();
pipe_reader_started=TRUE;
#endif /*_WIN32_WCE*/
}
fprintf(stdout,"%s",prompt);
fflush(stdout);
......@@ -498,19 +532,23 @@ void linphonec_out(const char *fmt,...){
va_end (args);
printf("%s",res);
fflush(stdout);
#if !defined(_WIN32_WCE)
if (client_sock!=ORTP_PIPE_INVALID){
if (ortp_pipe_write(client_sock,(uint8_t*)res,strlen(res))==-1){
fprintf(stderr,"Fail to send output via pipe: %s",strerror(errno));
}
}
#endif /*_WIN32_WCE*/
ortp_free(res);
}
void linphonec_command_finished(void){
#if !defined(_WIN32_WCE)
if (client_sock!=ORTP_PIPE_INVALID){
ortp_server_pipe_close_client(client_sock);
client_sock=ORTP_PIPE_INVALID;
}
#endif /*_WIN32_WCE*/
}
void linphonec_set_autoanswer(bool_t enabled){
......@@ -530,9 +568,35 @@ bool_t linphonec_get_autoanswer(){
* - char *histfile_name
* - FILE *mylogfile
*/
#if defined (_MSC_VER)
int _tmain(int argc, _TCHAR* argv[]) {
trace_level=1;
linphonec_vtable.show =(ShowInterfaceCb) stub;
linphonec_vtable.inv_recv = linphonec_call_received;
linphonec_vtable.bye_recv = linphonec_bye_received;
linphonec_vtable.notify_recv = linphonec_notify_received;
linphonec_vtable.new_unknown_subscriber = linphonec_new_unknown_subscriber;
linphonec_vtable.auth_info_requested = linphonec_prompt_for_auth;
linphonec_vtable.display_status = linphonec_display_status;
linphonec_vtable.display_message=linphonec_display_something;
#ifdef VINCENT_MAURY_RSVP
/* the yes/no dialog box */
linphonec_vtable.display_yes_no= (DisplayMessageCb) stub;
#endif
linphonec_vtable.display_warning=linphonec_display_warning;
linphonec_vtable.display_url=linphonec_display_url;
linphonec_vtable.display_question=(DisplayQuestionCb)stub;
linphonec_vtable.text_received=linphonec_text_received;
linphonec_vtable.general_state=linphonec_general_state;
linphonec_vtable.dtmf_received=linphonec_dtmf_received;
#else
int
main (int argc, char *argv[])
{
main (int argc, char *argv[]) {
#endif
if (! linphonec_init(argc, argv) ) exit(EXIT_FAILURE);
......@@ -556,9 +620,13 @@ linphonec_init(int argc, char **argv)
* Set initial values for global variables
*/
mylogfile = NULL;
snprintf(configfile_name, PATH_MAX, "%s/.linphonerc",
#if !defined(_WIN32_WCE)
getenv("HOME"));
#else
".");
#endif /*_WIN32_WCE*/
/* Handle configuration filename changes */
switch (handle_configfile_migration())
......@@ -623,12 +691,13 @@ linphonec_init(int argc, char **argv)
*/
linphonec_initialize_readline();
#endif
#if !defined(_WIN32_WCE)
/*
* Initialize signal handlers
*/
signal(SIGTERM, linphonec_finish);
signal(SIGINT, linphonec_finish);
#endif /*_WIN32_WCE*/
return 1;
}
......@@ -652,9 +721,10 @@ linphonec_finish(int exit_status)
#ifdef HAVE_READLINE
linphonec_finish_readline();
#endif
#if !defined(_WIN32_WCE)
if (pipe_reader_run)
stop_pipe_reader();
#endif /*_WIN32_WCE*/
linphone_core_uninit (&linphonec);
......@@ -976,7 +1046,7 @@ linphonec_parse_cmdline(int argc, char **argv)
else if (strncmp ("-c", argv[arg_num], 2) == 0)
{
if ( ++arg_num >= argc ) print_usage(EXIT_FAILURE);
#if !defined(_WIN32_WCE)
if (access(argv[arg_num],F_OK)!=0 )
{
fprintf (stderr,
......@@ -984,6 +1054,7 @@ linphonec_parse_cmdline(int argc, char **argv)
argv[arg_num]);
exit(EXIT_FAILURE);
}
#endif /*_WIN32_WCE*/
snprintf(configfile_name, PATH_MAX, "%s", argv[arg_num]);
}
else if (strncmp ("-s", argv[arg_num], 2) == 0)
......@@ -1016,7 +1087,9 @@ linphonec_parse_cmdline(int argc, char **argv)
("--version", argv[arg_num],
strlen ("--version")) == 0))
{
#if !defined(_WIN32_WCE)
printf ("version: " LINPHONE_VERSION "\n");
#endif
exit (EXIT_SUCCESS);
}
else if (strncmp ("-S", argv[arg_num], 2) == 0)
......@@ -1058,11 +1131,15 @@ linphonec_parse_cmdline(int argc, char **argv)
static int
handle_configfile_migration()
{
#if !defined(_WIN32_WCE)
char *old_cfg_gui;
char *old_cfg_cli;
char *new_cfg;
#if !defined(_WIN32_WCE)
const char *home = getenv("HOME");
#else
const char *home = ".";
#endif /*_WIN32_WCE*/
new_cfg = ms_strdup_printf("%s/.linphonerc", home);
/*
......@@ -1119,9 +1196,10 @@ handle_configfile_migration()
free(old_cfg_gui);
free(new_cfg);
#endif /*_WIN32_WCE*/
return 0;
}
#if !defined(_WIN32_WCE)
/*
* Copy file "from" to file "to".
* Destination file is truncated if existing.
......@@ -1169,6 +1247,7 @@ copy_file(const char *from, const char *to)
return 1;
}
#endif /*_WIN32_WCE*/
#ifdef HAVE_READLINE
static char **
......@@ -1332,3 +1411,4 @@ lpc_strip_blanks(char *input)
*
*
****************************************************************************/
......@@ -46,6 +46,7 @@
#endif
#endif
/**************************************************************************
*
* Compile-time defines
......
......@@ -42,9 +42,9 @@ endif
AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \
$(ORTP_CFLAGS) \
$(OSIP_CFLAGS) \
$(EXOSIP_CFLAGS) \
$(ORTP_CFLAGS) \
-DENABLE_TRACE \
-DLOG_DOMAIN=\"LinphoneCore\" \
$(IPV6_CFLAGS) \
......
......@@ -692,7 +692,9 @@ int linphone_accept_audio_offer(sdp_context_t *ctx,sdp_payload_t *payload)
/* refuse all other audio lines*/
if(params->line!=payload->line) {
ms_message("Only one audio line can be accepted.");
#if !defined(_WIN32_WCE)
abort();
#endif /*_WIN32_WCE*/
return -1;
}
}
......
......@@ -163,7 +163,12 @@ void linphone_call_destroy(LinphoneCall *obj)
/*prevent a gcc bug with %c*/
static size_t my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm){
#if !defined(_WIN32_WCE)
return strftime(s, max, fmt, tm);
#else
return 0;
/*FIXME*/
#endif /*_WIN32_WCE*/
}
LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, char *from, char *to){
......@@ -171,7 +176,10 @@ LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, char *from, char *to
struct tm loctime;
cl->dir=call->dir;
#ifdef WIN32
#if !defined(_WIN32_WCE)
loctime=*localtime(&call->start_time);
/*FIXME*/
#endif /*_WIN32_WCE*/
#else
localtime_r(&call->start_time,&loctime);
#endif
......@@ -396,7 +404,7 @@ void sound_config_read(LinphoneCore *lc)
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
tmpbuf=lp_config_get_string(lc->config,"sound","local_ring",tmpbuf);
if (access(tmpbuf,F_OK)==-1) {
if (ortp_file_exist(tmpbuf)==-1) {
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
}
if (strstr(tmpbuf,".wav")==NULL){
......@@ -408,7 +416,7 @@ void sound_config_read(LinphoneCore *lc)
tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING;
tmpbuf=lp_config_get_string(lc->config,"sound","remote_ring",tmpbuf);
if (access(tmpbuf,F_OK)==-1){
if (ortp_file_exist(tmpbuf)==-1){
tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING;
}
if (strstr(tmpbuf,".wav")==NULL){
......
......@@ -30,7 +30,9 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#if !defined(_WIN32_WCE)
#include <errno.h>
#endif /*_WIN32_WCE*/
#include <sys/types.h>
#include <sys/stat.h>
......@@ -102,14 +104,14 @@ struct _LpConfig{
LpItem * lp_item_new(const char *key, const char *value){
LpItem *item=lp_new0(LpItem,1);
item->key=strdup(key);
item->value=strdup(value);
item->key=ortp_strdup(key);
item->value=ortp_strdup(value);
return item;
}
LpSection *lp_section_new(const char *name){
LpSection *sec=lp_new0(LpSection,1);
sec->name=strdup(name);
sec->name=ortp_strdup(name);
return sec;
}
......@@ -211,16 +213,18 @@ void lp_config_parse(LpConfig *lpconfig){
LpConfig * lp_config_new(const char *filename){
LpConfig *lpconfig=lp_new0(LpConfig,1);
if (filename!=NULL){
lpconfig->filename=strdup(filename);
lpconfig->filename=ortp_strdup(filename);
lpconfig->file=fopen(filename,"rw");
if (lpconfig->file!=NULL){
lp_config_parse(lpconfig);
fclose(lpconfig->file);
#if !defined(_WIN32_WCE)
/* make existing configuration files non-group/world-accessible */
if (chmod(filename, S_IRUSR | S_IWUSR) == -1)
ms_warning("unable to correct permissions on "
"configuration file: %s",
strerror(errno));
#endif /*_WIN32_WCE*/
lpconfig->file=NULL;
lpconfig->modified=0;
}
......@@ -230,7 +234,7 @@ LpConfig * lp_config_new(const char *filename){
void lp_item_set_value(LpItem *item, const char *value){
free(item->value);
item->value=strdup(value);
item->value=ortp_strdup(value);
}
......
......@@ -30,7 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <unistd.h>
#include <fcntl.h>
#include <strings.h>
#if !defined(_WIN32_WCE)
#include <errno.h>
#endif /*_WIN32_WCE*/
#undef snprintf
#include <ortp/stun.h>
......@@ -100,15 +102,17 @@ char *int2str(int number)
void check_sound_device(LinphoneCore *lc)
{
int fd,len;
int fd=0;
int len;
int a;
char *file=NULL;
char *i810_audio=NULL;
char *snd_pcm_oss=NULL;
char *snd_mixer_oss=NULL;
char *snd_pcm=NULL;
#if !defined(_WIN32_WCE)
fd=open("/proc/modules",O_RDONLY);
#endif /*_WIN32_WCE*/
if (fd>0){
/* read the entire /proc/modules file and check if sound conf seems correct */
/*a=fstat(fd,&statbuf);
......@@ -158,7 +162,9 @@ void check_sound_device(LinphoneCore *lc)
*/
end:
if (file!=NULL) ms_free(file);
#if !defined(_WIN32_WCE)
if (fd>0) close(fd);
#endif /*_WIN32_WCE*/
}
#define UDP_HDR_SZ 8
......@@ -353,12 +359,10 @@ void linphone_core_setup_local_rtp_profile(LinphoneCore *lc)
PayloadType *payload;
bool_t prepend;
lc->local_profile=rtp_profile_clone_full(&av_profile);
/* first look at the list given by configuration file to see if
it is correct */
audiopt=fix_codec_list(lc->local_profile,lc->codecs_conf.audio_codecs);
videopt=fix_codec_list(lc->local_profile,lc->codecs_conf.video_codecs);
/* now find and add payloads that are not listed in the configuration
codec list */
for (i=0;i<127;i++)
......@@ -798,7 +802,7 @@ int linphone_core_get_local_ip_for(const char *dest, char *result){
if (err<0) {
ms_error("Error in connect: %s",strerror(errno));
freeaddrinfo(res);
close(sock);
close_socket(sock);
return -1;
}
freeaddrinfo(res);
......@@ -807,14 +811,14 @@ int linphone_core_get_local_ip_for(const char *dest, char *result){
err=getsockname(sock,(struct sockaddr*)&addr,&s);
if (err!=0) {
ms_error("Error in getsockname: %s",strerror(errno));
close(sock);
close_socket(sock);
return -1;
}
err=getnameinfo((struct sockaddr *)&addr,s,result,LINPHONE_IPADDR_SIZE,NULL,0,NI_NUMERICHOST);
if (err!=0){
ms_error("getnameinfo error: %s",strerror(errno));
}
close(sock);
close_socket(sock);
ms_message("Local interface to reach %s is %s.",dest,result);
return 0;
}
......@@ -191,7 +191,12 @@ sdp_context_add_payload (sdp_context_t * ctx, sdp_payload_t * payload, char *med
{
eXosip_trace (OSIP_ERROR,
("You must not call sdp_context_add_*_payload outside the write_offer callback\n"));
abort ();
#if !defined(_WIN32_WCE)
abort();
#else
exit(-1);
#endif /*_WIN32_WCE*/
}
if (payload->proto == NULL)
payload->proto = "RTP/AVP";
......
......@@ -125,6 +125,7 @@ if test $GCC = yes && test $wall_werror = yes; then
fi
macosx_found=no
mingw32ce_found=no
dnl add thread flags
case $target_os in
......@@ -140,6 +141,7 @@ case $target_os in
dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux
LIBS="$LIBS -lws2"
mingw_found=yes
mingw32ce_found=yes
build_tests=no
;;
*mingw*)
......@@ -480,6 +482,7 @@ MS_CHECK_VIDEO
AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true")
AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes")
AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes")
AM_CONDITIONAL(BUILD_WIN32_WCE, test "$mingw32ce_found" = "yes")
dnl *********************************************
dnl setup oRTP dependency
......
......@@ -30,6 +30,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ortp/event.h"
#include <time.h>
#if defined(_WIN32_WCE)
#define time ms_time
time_t ms_time (time_t *t);
#endif /*_WIN32_WCE*/
typedef enum EchoLimiterType{
ELInactive,
ELControlMic,
......
......@@ -162,7 +162,9 @@ libmediastreamer_la_LIBADD+= -lole32 \
endif
endif
if BUILD_WIN32_WCE
libmediastreamer_la_LIBADD+= -lmmtimer
endif
AM_CFLAGS= -I$(top_srcdir) \
$(ORTP_CFLAGS) \
......
......@@ -127,7 +127,7 @@ RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6){
#if defined(_WIN32_WCE)
time_t
time (time_t *t)
ms_time (time_t *t)
{
DWORD timemillis = GetTickCount();
if (timemillis>0)
......
......@@ -103,7 +103,7 @@ static void volume_uninit(MSFilter *f){
static int volume_get(MSFilter *f, void *arg){
float *farg=(float*)arg;
Volume *v=(Volume*)f->data;
*farg=10*log10f((v->energy+1)/max_e);
*farg=10*ortp_log10f((v->energy+1)/max_e);
return 0;
}
......
......@@ -183,6 +183,28 @@ int WIN_cond_destroy(ortp_cond_t * cond);
#define SOCKET_OPTION_VALUE char *
#define inline __inline
#if defined(_WIN32_WCE)
#define ortp_log10f(x) (float)log10 ((double)x)
#ifdef assert
#undef assert
#endif /*assert*/
#define assert(exp) ((void)0)
#ifdef errno
#undef errno
#endif /*errno*/
#define errno GetLastError()
#ifdef strerror
#undef strerror
#endif /*strerror*/
const char * ortp_strerror(DWORD value);
#define strerror ortp_strerror
#endif /*_WIN32_WCE*/
const char *getWinSocketError(int error);
#define getSocketErrorCode() WSAGetLastError()
#define getSocketError() getWinSocketError(WSAGetLastError())
......@@ -240,6 +262,8 @@ char *ortp_strndup(const char *str,int n);
char *ortp_strdup_printf(const char *fmt,...);
char *ortp_strdup_vprintf(const char *fmt, va_list ap);
int ortp_file_exist(const char *pathname);
/* portable named pipes */
#if !defined(_WIN32_WCE)
#ifdef WIN32
......@@ -269,6 +293,7 @@ int ortp_pipe_write(ortp_pipe_t p, const uint8_t *buf, int len);
#ifdef __cplusplus
}
#endif
......
......@@ -60,7 +60,7 @@
#include <assert.h>
#include <string.h>
#include "ortp/port.h"
/* /////////////////////////////////////////////////////////////////////////////
* Constants and definitions
*/
......
......@@ -124,7 +124,23 @@ int close_socket(ortp_socket_t sock){
#endif
}
#if defined (_WIN32_WCE)
int ortp_file_exist(const char *pathname) {
FILE* fd;
if (pathname==NULL) return -1;
fd=fopen(pathname,"r");
if (fd==NULL) {
return -1;
} else {
fclose(fd);
return 0;
}
}
#else
int ortp_file_exist(const char *pathname) {
return access(pathname,F_OK);
}
#endif /*_WIN32_WCE*/
#if !defined(_WIN32) && !defined(_WIN32_WCE)
/* Use UNIX inet_aton method */
......@@ -276,6 +292,21 @@ int WIN_cond_destroy(ortp_cond_t * hCond)
#if defined(_WIN32_WCE)
#include <time.h>
const char * ortp_strerror(DWORD value) {
static TCHAR msgBuf[256];
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,