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

prepare wince port

parent 798b8e72
...@@ -36,7 +36,7 @@ AM_PROG_CC_C_O ...@@ -36,7 +36,7 @@ AM_PROG_CC_C_O
case $target_os in case $target_os in
*mingw32ce) *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" CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
LIBS="$LIBS -lws2 -liphlpapi" LIBS="$LIBS -lws2 -liphlpapi"
mingw_found=yes mingw_found=yes
......
...@@ -26,10 +26,12 @@ ...@@ -26,10 +26,12 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef _WIN32_WCE
#include <errno.h> #include <errno.h>
#include <unistd.h>
#endif /*_WIN32_WCE*/
#include <limits.h> #include <limits.h>
#include <ctype.h> #include <ctype.h>
#include <unistd.h>
#include <linphonecore.h> #include <linphonecore.h>
#include "linphonec.h" #include "linphonec.h"
...@@ -282,7 +284,7 @@ linphonec_command_generator(const char *text, int state) ...@@ -282,7 +284,7 @@ linphonec_command_generator(const char *text, int state)
if (strncmp(name, text, len) == 0) if (strncmp(name, text, len) == 0)
{ {
return strdup(name); return ortp_strdup(name);
} }
} }
...@@ -577,10 +579,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args) ...@@ -577,10 +579,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args)
args+=4; args+=4;
if ( ! *args ) return 0; if ( ! *args ) return 0;
friend_num = strtol(args, NULL, 10); friend_num = strtol(args, NULL, 10);
#ifndef _WIN32_WCE
if ( errno == ERANGE ) { if ( errno == ERANGE ) {
linphonec_out("Invalid friend number\n"); linphonec_out("Invalid friend number\n");
return 0; return 0;
} }
#endif /*_WIN32_WCE*/
linphonec_friend_call(lc, friend_num); linphonec_friend_call(lc, friend_num);
return 1; return 1;
} }
...@@ -597,10 +601,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args) ...@@ -597,10 +601,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args)
else else
{ {
friend_num = strtol(args, NULL, 10); friend_num = strtol(args, NULL, 10);
#ifndef _WIN32_WCE
if ( errno == ERANGE ) { if ( errno == ERANGE ) {
linphonec_out("Invalid friend number\n"); linphonec_out("Invalid friend number\n");
return 0; return 0;
} }
#endif /*_WIN32_WCE*/
} }
linphonec_friend_delete(lc, friend_num); linphonec_friend_delete(lc, friend_num);
return 1; return 1;
...@@ -1401,9 +1407,9 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args){ ...@@ -1401,9 +1407,9 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args){
static int lpc_cmd_status(LinphoneCore *lc, char *args) static int lpc_cmd_status(LinphoneCore *lc, char *args)
{ {
if ( ! args ) return 0;
LinphoneProxyConfig *cfg; LinphoneProxyConfig *cfg;
if ( ! args ) return 0;
linphone_core_get_default_proxy(lc,&cfg); linphone_core_get_default_proxy(lc,&cfg);
if (strstr(args,"register")) if (strstr(args,"register"))
{ {
......
...@@ -23,24 +23,28 @@ ...@@ -23,24 +23,28 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
****************************************************************************/ ****************************************************************************/
#include <string.h>
#include <errno.h> #ifndef _WIN32_WCE
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include "private.h" /*coreapi/private.h, needed for LINPHONE_VERSION */
#endif /*_WIN32_WCE*/
#include <limits.h> #include <limits.h>
#include <ctype.h> #include <ctype.h>
#include <linphonecore.h> #include <linphonecore.h>
#include "private.h" /*coreapi/private.h, needed for LINPHONE_VERSION */
#include "linphonec.h" #include "linphonec.h"
#ifdef WIN32 #ifdef WIN32
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <ctype.h> #include <ctype.h>
#ifndef _WIN32_WCE
#include <conio.h> #include <conio.h>
#endif /*_WIN32_WCE*/
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <netdb.h> #include <netdb.h>
...@@ -48,6 +52,21 @@ ...@@ -48,6 +52,21 @@
#include <sys/stat.h> #include <sys/stat.h>
#endif #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 #ifdef HAVE_GETTEXT
#include <libintl.h> #include <libintl.h>
...@@ -71,14 +90,16 @@ typedef struct { ...@@ -71,14 +90,16 @@ typedef struct {
/*************************************************************************** /***************************************************************************
* *
* Forward declarations * Forward declarations
* *
***************************************************************************/ ***************************************************************************/
char *lpc_strip_blanks(char *input); char *lpc_strip_blanks(char *input);
static int handle_configfile_migration(void); static int handle_configfile_migration(void);
#if !defined(_WIN32_WCE)
static int copy_file(const char *from, const char *to); 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_parse_cmdline(int argc, char **argv);
static int linphonec_init(int argc, char **argv); static int linphonec_init(int argc, char **argv);
static int linphonec_main_loop (LinphoneCore * opm, char * sipAddr); static int linphonec_main_loop (LinphoneCore * opm, char * sipAddr);
...@@ -111,7 +132,7 @@ static void linphonec_dtmf_received(LinphoneCore *lc, int dtmf); ...@@ -111,7 +132,7 @@ static void linphonec_dtmf_received(LinphoneCore *lc, int dtmf);
static void print_prompt(LinphoneCore *opm); static void print_prompt(LinphoneCore *opm);
/*************************************************************************** /***************************************************************************
* *
* Global variables * Global variables
* *
***************************************************************************/ ***************************************************************************/
...@@ -135,18 +156,25 @@ static int trace_level = 0; ...@@ -135,18 +156,25 @@ static int trace_level = 0;
static char *logfile_name = NULL; static char *logfile_name = NULL;
static char configfile_name[PATH_MAX]; static char configfile_name[PATH_MAX];
static char *sipAddr = NULL; /* for autocall */ static char *sipAddr = NULL; /* for autocall */
#if !defined(_WIN32_WCE)
static ortp_pipe_t client_sock=ORTP_PIPE_INVALID; static ortp_pipe_t client_sock=ORTP_PIPE_INVALID;
#endif /*_WIN32_WCE*/
char prompt[PROMPT_MAX_LEN]; char prompt[PROMPT_MAX_LEN];
#if !defined(_WIN32_WCE)
static ortp_thread_t pipe_reader_th; static ortp_thread_t pipe_reader_th;
static bool_t pipe_reader_run=FALSE; static bool_t pipe_reader_run=FALSE;
#endif /*_WIN32_WCE*/
#if !defined(_WIN32_WCE)
static ortp_pipe_t server_sock; static ortp_pipe_t server_sock;
#endif /*_WIN32_WCE*/
LinphoneCoreVTable linphonec_vtable = { LinphoneCoreVTable linphonec_vtable
#if !defined (_MSC_VER)
= {
.show =(ShowInterfaceCb) stub, .show =(ShowInterfaceCb) stub,
.inv_recv = linphonec_call_received, .inv_recv = linphonec_call_received,
.bye_recv = linphonec_bye_received, .bye_recv = linphonec_bye_received,
.notify_recv = linphonec_notify_received, .notify_recv = linphonec_notify_received,
.new_unknown_subscriber = linphonec_new_unknown_subscriber, .new_unknown_subscriber = linphonec_new_unknown_subscriber,
.auth_info_requested = linphonec_prompt_for_auth, .auth_info_requested = linphonec_prompt_for_auth,
...@@ -162,7 +190,9 @@ LinphoneCoreVTable linphonec_vtable = { ...@@ -162,7 +190,9 @@ LinphoneCoreVTable linphonec_vtable = {
.text_received=linphonec_text_received, .text_received=linphonec_text_received,
.general_state=linphonec_general_state, .general_state=linphonec_general_state,
.dtmf_received=linphonec_dtmf_received .dtmf_received=linphonec_dtmf_received
}; }
#endif /*_WIN32_WCE*/
;
...@@ -173,7 +203,7 @@ LinphoneCoreVTable linphonec_vtable = { ...@@ -173,7 +203,7 @@ LinphoneCoreVTable linphonec_vtable = {
***************************************************************************/ ***************************************************************************/
/* /*
* Linphone core callback * Linphone core callback
*/ */
static void static void
linphonec_display_something (LinphoneCore * lc, const char *something) linphonec_display_something (LinphoneCore * lc, const char *something)
...@@ -183,7 +213,7 @@ linphonec_display_something (LinphoneCore * lc, const char *something) ...@@ -183,7 +213,7 @@ linphonec_display_something (LinphoneCore * lc, const char *something)
} }
/* /*
* Linphone core callback * Linphone core callback
*/ */
static void static void
linphonec_display_status (LinphoneCore * lc, const char *something) linphonec_display_status (LinphoneCore * lc, const char *something)
...@@ -193,7 +223,7 @@ linphonec_display_status (LinphoneCore * lc, const char *something) ...@@ -193,7 +223,7 @@ linphonec_display_status (LinphoneCore * lc, const char *something)
} }
/* /*
* Linphone core callback * Linphone core callback
*/ */
static void static void
linphonec_display_warning (LinphoneCore * lc, const char *something) linphonec_display_warning (LinphoneCore * lc, const char *something)
...@@ -203,7 +233,7 @@ linphonec_display_warning (LinphoneCore * lc, const char *something) ...@@ -203,7 +233,7 @@ linphonec_display_warning (LinphoneCore * lc, const char *something)
} }
/* /*
* Linphone core callback * Linphone core callback
*/ */
static void static void
linphonec_display_url (LinphoneCore * lc, const char *something, const char *url) linphonec_display_url (LinphoneCore * lc, const char *something, const char *url)
...@@ -213,7 +243,7 @@ linphonec_display_url (LinphoneCore * lc, const char *something, const char *url ...@@ -213,7 +243,7 @@ linphonec_display_url (LinphoneCore * lc, const char *something, const char *url
/* /*
* Linphone core callback * Linphone core callback
*/ */
static void static void
linphonec_call_received(LinphoneCore *lc, const char *from) linphonec_call_received(LinphoneCore *lc, const char *from)
...@@ -225,7 +255,7 @@ linphonec_call_received(LinphoneCore *lc, const char *from) ...@@ -225,7 +255,7 @@ linphonec_call_received(LinphoneCore *lc, const char *from)
} }
/* /*
* Linphone core callback * Linphone core callback
*/ */
static void static void
linphonec_prompt_for_auth(LinphoneCore *lc, const char *realm, const char *username) linphonec_prompt_for_auth(LinphoneCore *lc, const char *realm, const char *username)
...@@ -235,15 +265,15 @@ linphonec_prompt_for_auth(LinphoneCore *lc, const char *realm, const char *usern ...@@ -235,15 +265,15 @@ linphonec_prompt_for_auth(LinphoneCore *lc, const char *realm, const char *usern
linphone_core_abort_authentication(lc,NULL); linphone_core_abort_authentication(lc,NULL);
}else{ }else{
LinphoneAuthInfo *pending_auth; LinphoneAuthInfo *pending_auth;
if ( auth_stack.nitems+1 > MAX_PENDING_AUTH ) if ( auth_stack.nitems+1 > MAX_PENDING_AUTH )
{ {
fprintf(stderr, fprintf(stderr,
"Can't accept another authentication request.\n" "Can't accept another authentication request.\n"
"Consider incrementing MAX_PENDING_AUTH macro.\n"); "Consider incrementing MAX_PENDING_AUTH macro.\n");
return; return;
} }
pending_auth=linphone_auth_info_new(username,NULL,NULL,NULL,realm); pending_auth=linphone_auth_info_new(username,NULL,NULL,NULL,realm);
auth_stack.elem[auth_stack.nitems++]=pending_auth; auth_stack.elem[auth_stack.nitems++]=pending_auth;
} }
...@@ -268,8 +298,8 @@ linphonec_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf, ...@@ -268,8 +298,8 @@ linphonec_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf,
const char *url) const char *url)
{ {
printf("Friend %s requested subscription " printf("Friend %s requested subscription "
"(accept/deny is not implemented yet)\n", url); "(accept/deny is not implemented yet)\n", url);
// This means that this person wishes to be notified // This means that this person wishes to be notified
// of your presence information (online, busy, away...). // of your presence information (online, busy, away...).
} }
...@@ -304,7 +334,7 @@ static void linphonec_dtmf_received(LinphoneCore *lc, int dtmf){ ...@@ -304,7 +334,7 @@ static void linphonec_dtmf_received(LinphoneCore *lc, int dtmf){
fflush(stdout); fflush(stdout);
} }
static void static void
linphonec_general_state (LinphoneCore * lc, LinphoneGeneralState *gstate) linphonec_general_state (LinphoneCore * lc, LinphoneGeneralState *gstate)
{ {
if (show_general_state) { if (show_general_state) {
...@@ -352,11 +382,11 @@ linphonec_general_state (LinphoneCore * lc, LinphoneGeneralState *gstate) ...@@ -352,11 +382,11 @@ linphonec_general_state (LinphoneCore * lc, LinphoneGeneralState *gstate)
printf("GSTATE_CALL_ERROR"); printf("GSTATE_CALL_ERROR");
break; break;
default: default:
printf("GSTATE_UNKNOWN_%d",gstate->new_state); printf("GSTATE_UNKNOWN_%d",gstate->new_state);
} }
if (gstate->message) printf(" %s", gstate->message); if (gstate->message) printf(" %s", gstate->message);
printf("\n"); printf("\n");
} }
} }
static char received_prompt[PROMPT_MAX_LEN]; static char received_prompt[PROMPT_MAX_LEN];
...@@ -380,14 +410,14 @@ static void start_prompt_reader(void){ ...@@ -380,14 +410,14 @@ static void start_prompt_reader(void){
ms_mutex_init(&prompt_mutex,NULL); ms_mutex_init(&prompt_mutex,NULL);
ortp_thread_create(&th,NULL,prompt_reader_thread,NULL); ortp_thread_create(&th,NULL,prompt_reader_thread,NULL);
} }
#if !defined(_WIN32_WCE)
static ortp_pipe_t create_server_socket(void){ static ortp_pipe_t create_server_socket(void){
char path[128]; char path[128];
#ifndef WIN32 #ifndef WIN32
snprintf(path,sizeof(path)-1,"linphonec-%i",getuid()); snprintf(path,sizeof(path)-1,"linphonec-%i",getuid());
#else #else
{ {
char username[128]; TCHAR username[128];
DWORD size=sizeof(username)-1; DWORD size=sizeof(username)-1;
GetUserName(username,&size); GetUserName(username,&size);
snprintf(path,sizeof(path)-1,"linphonec-%s",username); snprintf(path,sizeof(path)-1,"linphonec-%s",username);
...@@ -396,6 +426,7 @@ static ortp_pipe_t create_server_socket(void){ ...@@ -396,6 +426,7 @@ static ortp_pipe_t create_server_socket(void){
return ortp_server_pipe_create(path); return ortp_server_pipe_create(path);
} }
static void *pipe_thread(void*p){ static void *pipe_thread(void*p){
char tmp[250]; char tmp[250];
server_sock=create_server_socket(); server_sock=create_server_socket();
...@@ -424,7 +455,7 @@ static void *pipe_thread(void*p){ ...@@ -424,7 +455,7 @@ static void *pipe_thread(void*p){
ortp_server_pipe_close_client(client_sock); ortp_server_pipe_close_client(client_sock);
client_sock=ORTP_PIPE_INVALID; client_sock=ORTP_PIPE_INVALID;
} }
}else{ }else{
if (pipe_reader_run) fprintf(stderr,"accept() failed: %s\n",strerror(errno)); if (pipe_reader_run) fprintf(stderr,"accept() failed: %s\n",strerror(errno));
} }
...@@ -446,6 +477,7 @@ static void stop_pipe_reader(void){ ...@@ -446,6 +477,7 @@ static void stop_pipe_reader(void){
ortp_server_pipe_close(server_sock); ortp_server_pipe_close(server_sock);
ortp_thread_join(pipe_reader_th,NULL); ortp_thread_join(pipe_reader_th,NULL);
} }
#endif /*_WIN32_WCE*/
#ifdef HAVE_READLINE #ifdef HAVE_READLINE
#define BOOL_HAVE_READLINE 1 #define BOOL_HAVE_READLINE 1
...@@ -462,8 +494,10 @@ char *linphonec_readline(char *prompt){ ...@@ -462,8 +494,10 @@ char *linphonec_readline(char *prompt){
prompt_reader_started=TRUE; prompt_reader_started=TRUE;
} }
if (unix_socket && !pipe_reader_started){ if (unix_socket && !pipe_reader_started){
#if !defined(_WIN32_WCE)
start_pipe_reader(); start_pipe_reader();
pipe_reader_started=TRUE; pipe_reader_started=TRUE;
#endif /*_WIN32_WCE*/
} }
fprintf(stdout,"%s",prompt); fprintf(stdout,"%s",prompt);
fflush(stdout); fflush(stdout);
...@@ -498,19 +532,23 @@ void linphonec_out(const char *fmt,...){ ...@@ -498,19 +532,23 @@ void linphonec_out(const char *fmt,...){
va_end (args); va_end (args);
printf("%s",res); printf("%s",res);
fflush(stdout); fflush(stdout);
#if !defined(_WIN32_WCE)
if (client_sock!=ORTP_PIPE_INVALID){ if (client_sock!=ORTP_PIPE_INVALID){
if (ortp_pipe_write(client_sock,(uint8_t*)res,strlen(res))==-1){ if (ortp_pipe_write(client_sock,(uint8_t*)res,strlen(res))==-1){
fprintf(stderr,"Fail to send output via pipe: %s",strerror(errno)); fprintf(stderr,"Fail to send output via pipe: %s",strerror(errno));
} }
} }
#endif /*_WIN32_WCE*/
ortp_free(res); ortp_free(res);
} }
void linphonec_command_finished(void){ void linphonec_command_finished(void){
#if !defined(_WIN32_WCE)
if (client_sock!=ORTP_PIPE_INVALID){ if (client_sock!=ORTP_PIPE_INVALID){
ortp_server_pipe_close_client(client_sock); ortp_server_pipe_close_client(client_sock);
client_sock=ORTP_PIPE_INVALID; client_sock=ORTP_PIPE_INVALID;
} }
#endif /*_WIN32_WCE*/
} }
void linphonec_set_autoanswer(bool_t enabled){ void linphonec_set_autoanswer(bool_t enabled){
...@@ -530,9 +568,35 @@ bool_t linphonec_get_autoanswer(){ ...@@ -530,9 +568,35 @@ bool_t linphonec_get_autoanswer(){
* - char *histfile_name * - char *histfile_name
* - FILE *mylogfile * - 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 int
main (int argc, char *argv[]) main (int argc, char *argv[]) {
{ #endif
if (! linphonec_init(argc, argv) ) exit(EXIT_FAILURE); if (! linphonec_init(argc, argv) ) exit(EXIT_FAILURE);
...@@ -556,9 +620,13 @@ linphonec_init(int argc, char **argv) ...@@ -556,9 +620,13 @@ linphonec_init(int argc, char **argv)
* Set initial values for global variables * Set initial values for global variables
*/ */
mylogfile = NULL; mylogfile = NULL;
snprintf(configfile_name, PATH_MAX, "%s/.linphonerc",
getenv("HOME"));
snprintf(configfile_name, PATH_MAX, "%s/.linphonerc",
#if !defined(_WIN32_WCE)
getenv("HOME"));
#else
".");
#endif /*_WIN32_WCE*/
/* Handle configuration filename changes */ /* Handle configuration filename changes */
switch (handle_configfile_migration()) switch (handle_configfile_migration())
...@@ -623,12 +691,13 @@ linphonec_init(int argc, char **argv) ...@@ -623,12 +691,13 @@ linphonec_init(int argc, char **argv)
*/ */
linphonec_initialize_readline(); linphonec_initialize_readline();
#endif #endif
#if !defined(_WIN32_WCE)
/* /*
* Initialize signal handlers * Initialize signal handlers
*/ */
signal(SIGTERM, linphonec_finish); signal(SIGTERM, linphonec_finish);
signal(SIGINT, linphonec_finish); signal(SIGINT, linphonec_finish);
#endif /*_WIN32_WCE*/
return 1; return 1;
} }
...@@ -645,16 +714,17 @@ void ...@@ -645,16 +714,17 @@ void
linphonec_finish(int exit_status) linphonec_finish(int exit_status)
{ {
printf("Terminating...\n"); printf("Terminating...\n");
/* Terminate any pending call */ /* Terminate any pending call */
linphonec_parse_command_line(&linphonec, "terminate"); linphonec_parse_command_line(&linphonec, "terminate");
linphonec_command_finished(); linphonec_command_finished();
#ifdef HAVE_READLINE #ifdef HAVE_READLINE
linphonec_finish_readline(); linphonec_finish_readline();
#endif #endif
#if !defined(_WIN32_WCE)
if (pipe_reader_run) if (pipe_reader_run)
stop_pipe_reader(); stop_pipe_reader();
#endif /*_WIN32_WCE*/
linphone_core_uninit (&linphonec); linphone_core_uninit (&linphonec);
...@@ -672,7 +742,7 @@ linphonec_finish(int exit_status) ...@@ -672,7 +742,7 @@ linphonec_finish(int exit_status)
* pending_auth != NULL. * pending_auth != NULL.
* *
* It prompts user for a password. * It prompts user for a password.
* Hitting ^D (EOF) would make this function * Hitting ^D (EOF) would make this function
* return 0 (Cancel). * return 0 (Cancel).
* Any other input would try to set linphone core * Any other input would try to set linphone core
* auth_password for the pending_auth, add the auth_info * auth_password for the pending_auth, add the auth_info
...@@ -715,7 +785,7 @@ linphonec_prompt_for_auth_final(LinphoneCore *lc) ...@@ -715,7 +785,7 @@ linphonec_prompt_for_auth_final(LinphoneCore *lc)
*/ */
if ( ! input ) if ( ! input )
{ {
printf("Cancel requested, but not implemented.\n"); printf("Cancel requested, but not implemented.\n");
continue; continue;
} }
...@@ -834,7 +904,7 @@ linphonec_initialize_readline() ...@@ -834,7 +904,7 @@ linphonec_initialize_readline()
rl_readline_name = "linphonec"; rl_readline_name = "linphonec";
/* Call idle_call() every second */ /* Call idle_call() every second */
rl_set_keyboard_input_timeout(LPC_READLINE_TIMEOUT); rl_set_keyboard_input_timeout(LPC_READLINE_TIMEOUT);
rl_event_hook=linphonec_idle_call; rl_event_hook=linphonec_idle_call;
/* Set history file and read it */ /* Set history file and read it */
...@@ -849,7 +919,7 @@ linphonec_initialize_readline() ...@@ -849,7 +919,7 @@ linphonec_initialize_readline()
rl_attempted_completion_function = linephonec_readline_completion; rl_attempted_completion_function = linephonec_readline_completion;
/* printf("Readline initialized.\n"); */ /* printf("Readline initialized.\n"); */
setlinebuf(stdout); setlinebuf(stdout);
return 0; return 0;
} }
...@@ -976,7 +1046,7 @@ linphonec_parse_cmdline(int argc, char **argv) ...@@ -976,7 +1046,7 @@ linphonec_parse_cmdline(int argc, char **argv)
else if (strncmp ("-c", argv[arg_num], 2) == 0) else if (strncmp ("-c", argv[arg_num], 2) == 0)
{ {
if ( ++arg_num >= argc ) print_usage(EXIT_FAILURE); if ( ++arg_num >= argc ) print_usage(EXIT_FAILURE);
#if !defined(_WIN32_WCE)
if (access(argv[arg_num],F_OK)!=0 ) if (access(argv[arg_num],F_OK)!=0 )
{ {
fprintf (stderr, fprintf (stderr,
...@@ -984,6 +1054,7 @@ linphonec_parse_cmdline(int argc, char **argv) ...@@ -984,6 +1054,7 @@ linphonec_parse_cmdline(int argc, char **argv)
argv[arg_num]); argv[arg_num]);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#endif /*_WIN32_WCE*/
snprintf(configfile_name, PATH_MAX, "%s", argv[arg_num]); snprintf(configfile_name, PATH_MAX, "%s", argv[arg_num]);
} }
else if (strncmp ("-s", argv[arg_num], 2) == 0) else if (strncmp ("-s", argv[arg_num], 2) == 0)
...@@ -1016,7 +1087,9 @@ linphonec_parse_cmdline(int argc, char **argv) ...@@ -1016,7 +1087,9 @@ linphonec_parse_cmdline(int argc, char **argv)
("--version", argv[arg_num], ("--version", argv[arg_num],
strlen ("--version")) == 0)) strlen ("--version")) == 0))
{ {
#if !defined(_WIN32_WCE)
printf ("version: " LINPHONE_VERSION "\n"); printf ("version: " LINPHONE_VERSION "\n");