]> git.sesse.net Git - vlc/blob - src/interface/main.c
. vir� les aliases � xvlc �, � ggivlc � etc. qui faisaient un peu
[vlc] / src / interface / main.c
1 /*****************************************************************************
2  * main.c: main vlc source
3  * Includes the main() function for vlc. Parses command line, start interface
4  * and spawn threads.
5  *****************************************************************************
6  * Copyright (C) 1998, 1999, 2000 VideoLAN
7  *
8  * Authors:
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  * 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 /*****************************************************************************
26  * Preamble
27  *****************************************************************************/
28 #include "defs.h"
29
30 #include <signal.h>                               /* SIGHUP, SIGINT, SIGKILL */
31 #include <getopt.h>                                              /* getopt() */
32 #include <stdio.h>                                              /* sprintf() */
33
34 #include <errno.h>                                                 /* ENOMEM */
35 #include <stdlib.h>                                  /* getenv(), strtol(),  */
36 #include <string.h>                                            /* strerror() */
37
38 #include "config.h"
39 #include "common.h"
40 #include "threads.h"
41 #include "mtime.h"
42 #include "tests.h"                                              /* TestMMX() */
43 #include "plugins.h"
44 #include "playlist.h"
45 #include "input_vlan.h"
46 #include "input_ps.h"
47
48 #include "intf_msg.h"
49 #include "interface.h"
50
51 #include "audio_output.h"
52
53 #ifdef SYS_BEOS
54 #include "beos_specific.h"
55 #endif
56
57 #include "main.h"
58
59 /*****************************************************************************
60  * Command line options constants. If something is changed here, be sure that
61  * GetConfiguration and Usage are also changed.
62  *****************************************************************************/
63
64 /* Long options return values - note that values corresponding to short options
65  * chars, and in general any regular char, should be avoided */
66 #define OPT_NOAUDIO             150
67 #define OPT_AOUT                151
68 #define OPT_STEREO              152
69 #define OPT_MONO                153
70
71 #define OPT_NOVIDEO             160
72 #define OPT_VOUT                161
73 #define OPT_DISPLAY             162
74 #define OPT_WIDTH               163
75 #define OPT_HEIGHT              164
76 #define OPT_COLOR               165
77 #define OPT_YUV                 166
78
79 #define OPT_NOVLANS             170
80 #define OPT_SERVER              171
81 #define OPT_PORT                172
82
83 #define OPT_SYNCHRO             180
84
85 /* Usage fashion */
86 #define USAGE                     0
87 #define SHORT_HELP                1
88 #define LONG_HELP                 2
89
90 /* Long options */
91 static const struct option longopts[] =
92 {
93     /*  name,               has_arg,    flag,   val */
94
95     /* General/common options */
96     {   "help",             0,          0,      'h' },
97     {   "longhelp",         0,          0,      'H' },
98     {   "version",          0,          0,      'v' },
99
100     /* Audio options */
101     {   "noaudio",          0,          0,      OPT_NOAUDIO },
102     {   "aout",             1,          0,      OPT_AOUT },
103     {   "stereo",           0,          0,      OPT_STEREO },
104     {   "mono",             0,          0,      OPT_MONO },
105
106     /* Video options */
107     {   "novideo",          0,          0,      OPT_NOVIDEO },
108     {   "vout",             1,          0,      OPT_VOUT },
109     {   "display",          1,          0,      OPT_DISPLAY },
110     {   "width",            1,          0,      OPT_WIDTH },
111     {   "height",           1,          0,      OPT_HEIGHT },
112     {   "grayscale",        0,          0,      'g' },
113     {   "color",            0,          0,      OPT_COLOR },
114     {   "yuv",              1,          0,      OPT_YUV },
115
116     /* DVD options */
117     {   "dvdaudio",         1,          0,      'a' },
118     {   "dvdchannel",       1,          0,      'c' },
119     {   "dvdsubtitle",      1,          0,      's' },
120     
121     /* Input options */
122     {   "novlans",          0,          0,      OPT_NOVLANS },
123     {   "server",           1,          0,      OPT_SERVER },
124     {   "port",             1,          0,      OPT_PORT },
125
126     /* Synchro options */
127     {   "synchro",          1,          0,      OPT_SYNCHRO },
128
129     {   0,                  0,          0,      0 }
130 };
131
132 /* Short options */
133 static const char *psz_shortopts = "hHvga:s:c:";
134
135 /*****************************************************************************
136  * Global variable program_data - this is the one and only, see main.h
137  *****************************************************************************/
138 main_t *p_main;
139
140 /*****************************************************************************
141  * Local prototypes
142  *****************************************************************************/
143 static void SetDefaultConfiguration ( void );
144 static int  GetConfiguration        ( int i_argc, char *ppsz_argv[],
145                                       char *ppsz_env[] );
146 static void Usage                   ( int i_fashion );
147 static void Version                 ( void );
148
149 static void InitSignalHandler       ( void );
150 static void SignalHandler           ( int i_signal );
151 #ifdef HAVE_MMX
152 static int  TestMMX                 ( void );
153 #endif
154
155 /*****************************************************************************
156  * main: parse command line, start interface and spawn threads
157  *****************************************************************************
158  * Steps during program execution are:
159  *      -configuration parsing and messages interface initialization
160  *      -opening of audio output device and some global modules
161  *      -execution of interface, which exit on error or on user request
162  *      -closing of audio output device and some global modules
163  * On error, the spawned threads are canceled, and the open devices closed.
164  *****************************************************************************/
165 int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
166 {
167     main_t  main_data;                      /* root of all data - see main.h */
168
169     p_main = &main_data;                       /* set up the global variable */
170
171     /*
172      * System specific initialization code
173      */
174 #ifdef SYS_BEOS
175     beos_Create();
176 #endif
177
178     /*
179      * Test if our code is likely to run on this CPU 
180      */
181 #ifdef HAVE_MMX
182     if( !TestMMX() )
183     {
184         fprintf( stderr, "Sorry, this program needs an MMX processor. "
185                          "Please run the non-MMX version.\n" );
186         return( 1 );
187     }
188 #endif
189
190     /*
191      * Initialize messages interface
192      */
193     p_main->p_msg = intf_MsgCreate();
194     if( !p_main->p_msg )                         /* start messages interface */
195     {
196         fprintf( stderr, "error: can't initialize messages interface (%s)\n",
197                 strerror(errno) );
198         return( errno );
199     }
200
201     /*
202      * Read configuration
203      */
204     if( GetConfiguration( i_argc, ppsz_argv, ppsz_env ) )  /* parse cmd line */
205     {
206         intf_MsgDestroy();
207         return( errno );
208     }
209
210     /*
211      * Initialize playlist and get commandline files
212      */
213     p_main->p_playlist = playlist_Create( );
214     if( !p_main->p_playlist )
215     {
216         intf_Msg( "Playlist initialization failed\n" );
217         intf_MsgDestroy();
218         return( errno );
219     }
220     playlist_Init( p_main->p_playlist, optind );
221
222     /*
223      * Initialize plugin bank
224      */
225     p_main->p_bank = bank_Create( );
226     if( !p_main->p_bank )
227     {
228         intf_Msg( "Plugin bank initialization failed\n" );
229         playlist_Destroy( p_main->p_playlist );
230         intf_MsgDestroy();
231         return( errno );
232     }
233     bank_Init( p_main->p_bank );
234
235     /*
236      * Initialize shared resources and libraries
237      */
238     if( p_main->b_vlans && input_VlanCreate() )
239     {
240         /* On error during vlans initialization, switch off vlans */
241         intf_Msg( "Virtual LANs initialization failed : "
242                   "vlans management is deactivated\n" );
243         p_main->b_vlans = 0;
244     }
245
246     /*
247      * Open audio device and start aout thread
248      */
249     if( p_main->b_audio )
250     {
251         p_main->p_aout = aout_CreateThread( NULL );
252         if( p_main->p_aout == NULL )
253         {
254             /* On error during audio initialization, switch off audio */
255             intf_Msg( "Audio initialization failed : audio is deactivated\n" );
256             p_main->b_audio = 0;
257         }
258     }
259
260     /*
261      * Run interface
262      */
263     p_main->p_intf = intf_Create();
264     if( p_main->p_intf != NULL )
265     {
266         InitSignalHandler();             /* prepare signals for interception */
267
268         /*
269          * This is the main loop
270          */
271         intf_Run( p_main->p_intf );
272
273         intf_Destroy( p_main->p_intf );
274     }
275
276     /*
277      * Close audio device
278      */
279     if( p_main->b_audio )
280     {
281         aout_DestroyThread( p_main->p_aout, NULL );
282     }
283
284     /*
285      * Free shared resources and libraries
286      */
287     if( p_main->b_vlans )
288     {
289         input_VlanDestroy();
290     }
291
292     /*
293      * Free plugin bank
294      */
295     bank_Destroy( p_main->p_bank );
296
297     /*
298      * Free playlist
299      */
300     playlist_Destroy( p_main->p_playlist );
301
302 #ifdef SYS_BEOS
303     /*
304      * System specific cleaning code
305      */
306     beos_Destroy();
307 #endif
308
309     /*
310      * Terminate messages interface and program
311      */
312     intf_Msg( "Program terminated.\n" );
313     intf_MsgDestroy();
314
315     return( 0 );
316 }
317
318 /*****************************************************************************
319  * main_GetIntVariable: get the int value of an environment variable
320  *****************************************************************************
321  * This function is used to read some default parameters in modules.
322  *****************************************************************************/
323 int main_GetIntVariable( char *psz_name, int i_default )
324 {
325     char *      psz_env;                                /* environment value */
326     char *      psz_end;                             /* end of parsing index */
327     long int    i_value;                                            /* value */
328
329     psz_env = getenv( psz_name );
330     if( psz_env )
331     {
332         i_value = strtol( psz_env, &psz_end, 0 );
333         if( (*psz_env != '\0') && (*psz_end == '\0') )
334         {
335             return( i_value );
336         }
337     }
338     return( i_default );
339 }
340
341 /*****************************************************************************
342  * main_GetPszVariable: get the string value of an environment variable
343  *****************************************************************************
344  * This function is used to read some default parameters in modules.
345  *****************************************************************************/
346 char * main_GetPszVariable( char *psz_name, char *psz_default )
347 {
348     char *psz_env;
349
350     psz_env = getenv( psz_name );
351     if( psz_env )
352     {
353         return( psz_env );
354     }
355     return( psz_default );
356 }
357
358 /*****************************************************************************
359  * main_PutPszVariable: set the string value of an environment variable
360  *****************************************************************************
361  * This function is used to set some default parameters in modules. The use of
362  * this function will cause some memory leak: since some systems use the pointer
363  * passed to putenv to store the environment string, it can't be freed.
364  *****************************************************************************/
365 void main_PutPszVariable( char *psz_name, char *psz_value )
366 {
367     char *psz_env;
368
369     psz_env = malloc( strlen(psz_name) + strlen(psz_value) + 2 );
370     if( psz_env == NULL )
371     {
372         intf_ErrMsg( "error: %s\n", strerror(ENOMEM) );
373     }
374     else
375     {
376         sprintf( psz_env, "%s=%s", psz_name, psz_value );
377         if( putenv( psz_env ) )
378         {
379             intf_ErrMsg( "error: %s\n", strerror(errno) );
380         }
381     }
382 }
383
384 /*****************************************************************************
385  * main_PutIntVariable: set the integer value of an environment variable
386  *****************************************************************************
387  * This function is used to set some default parameters in modules. The use of
388  * this function will cause some memory leak: since some systems use the pointer
389  * passed to putenv to store the environment string, it can't be freed.
390  *****************************************************************************/
391 void main_PutIntVariable( char *psz_name, int i_value )
392 {
393     char psz_value[ 256 ];                               /* buffer for value */
394
395     sprintf( psz_value, "%d", i_value );
396     main_PutPszVariable( psz_name, psz_value );
397 }
398
399 /* following functions are local */
400
401 /*****************************************************************************
402  * SetDefaultConfiguration: set default options
403  *****************************************************************************
404  * This function is called by GetConfiguration before command line is parsed.
405  * It sets all the default values required later by the program. At this stage,
406  * most structure are not yet allocated, so initialization must be done using
407  * environment.
408  *****************************************************************************/
409 static void SetDefaultConfiguration( void )
410 {
411     /*
412      * All features are activated by default
413      */
414     p_main->b_audio  = 1;
415     p_main->b_video  = 1;
416     p_main->b_vlans  = 1;
417 }
418
419 /*****************************************************************************
420  * GetConfiguration: parse command line
421  *****************************************************************************
422  * Parse command line and configuration file for configuration. If the inline
423  * help is requested, the function Usage() is called and the function returns
424  * -1 (causing main() to exit). The messages interface is initialized at this
425  * stage, but most structures are not allocated, so only environment should
426  * be used.
427  *****************************************************************************/
428 static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
429 {
430     int c, i_opt;
431     char * p_pointer;
432
433     /* Set default configuration and copy arguments */
434     p_main->i_argc    = i_argc;
435     p_main->ppsz_argv = ppsz_argv;
436     p_main->ppsz_env  = ppsz_env;
437     SetDefaultConfiguration();
438
439     intf_MsgImm( COPYRIGHT_MESSAGE "\n" );
440
441     /* Get the executable name (similar to the basename command) */
442     p_main->psz_arg0 = p_pointer = ppsz_argv[ 0 ];
443     while( *p_pointer )
444     {
445         if( *p_pointer == '/' )
446         {
447             p_main->psz_arg0 = ++p_pointer;
448         }
449         else
450         {
451             ++p_pointer;
452         }
453     }
454
455     /* Parse command line options */
456     opterr = 0;
457     while( ( c = getopt_long( i_argc, ppsz_argv, psz_shortopts, longopts, 0 ) ) != EOF )
458     {
459         switch( c )
460         {
461         /* General/common options */
462         case 'h':                                              /* -h, --help */
463             Usage( SHORT_HELP );
464             return( -1 );
465             break;
466         case 'H':                                          /* -H, --longhelp */
467             Usage( LONG_HELP );
468             return( -1 );
469             break;
470         case 'v':                                           /* -v, --version */
471             Version();
472             return( -1 );
473             break;
474
475         /* Audio options */
476         case OPT_NOAUDIO:                                       /* --noaudio */
477             p_main->b_audio = 0;
478             break;
479         case OPT_AOUT:                                             /* --aout */
480             main_PutPszVariable( AOUT_METHOD_VAR, optarg );
481             break;
482         case OPT_STEREO:                                         /* --stereo */
483             main_PutIntVariable( AOUT_STEREO_VAR, 1 );
484             break;
485         case OPT_MONO:                                             /* --mono */
486             main_PutIntVariable( AOUT_STEREO_VAR, 0 );
487             break;
488
489         /* Video options */
490         case OPT_NOVIDEO:                                       /* --novideo */
491             p_main->b_video = 0;
492             break;
493         case OPT_VOUT:                                             /* --vout */
494             main_PutPszVariable( VOUT_METHOD_VAR, optarg );
495             break;
496         case OPT_DISPLAY:                                       /* --display */
497             main_PutPszVariable( VOUT_DISPLAY_VAR, optarg );
498             break;
499         case OPT_WIDTH:                                           /* --width */
500             main_PutPszVariable( VOUT_WIDTH_VAR, optarg );
501             break;
502         case OPT_HEIGHT:                                         /* --height */
503             main_PutPszVariable( VOUT_HEIGHT_VAR, optarg );
504             break;
505
506         case 'g':                                         /* -g, --grayscale */
507             main_PutIntVariable( VOUT_GRAYSCALE_VAR, 1 );
508             break;
509         case OPT_COLOR:                                           /* --color */
510             main_PutIntVariable( VOUT_GRAYSCALE_VAR, 0 );
511             break;
512         case OPT_YUV:                                               /* --yuv */
513             main_PutPszVariable( YUV_METHOD_VAR, optarg );
514             break;
515
516         /* DVD options */
517         case 'a':
518             if ( ! strcmp(optarg, "mpeg") )
519                 main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_MPEG );
520             else if ( ! strcmp(optarg, "lpcm") )
521                 main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_LPCM );
522             else if ( ! strcmp(optarg, "off") )
523                 main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_NOAUDIO );
524             else
525                 main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_AC3 );
526             break;
527         case 'c':
528             main_PutIntVariable( INPUT_DVD_CHANNEL_VAR, atoi(optarg) );
529             break;
530         case 's':
531             main_PutIntVariable( INPUT_DVD_SUBTITLE_VAR, atoi(optarg) );
532             break;
533
534         /* Input options */
535         case OPT_NOVLANS:                                       /* --novlans */
536             p_main->b_vlans = 0;
537             break;
538         case OPT_SERVER:                                         /* --server */
539             main_PutPszVariable( INPUT_SERVER_VAR, optarg );
540             break;
541         case OPT_PORT:                                             /* --port */
542             main_PutPszVariable( INPUT_PORT_VAR, optarg );
543             break;
544
545         /* Synchro options */
546         case OPT_SYNCHRO:
547             main_PutPszVariable( VPAR_SYNCHRO_VAR, optarg );
548             break;
549
550         /* Internal error: unknown option */
551         case '?':
552         default:
553             intf_ErrMsg( "intf error: unknown option `%s'\n", ppsz_argv[optind - 1] );
554             Usage( USAGE );
555             return( EINVAL );
556             break;
557         }
558     }
559
560     /* Parse command line parameters - no check is made for these options */
561     for( i_opt = optind; i_opt < i_argc; i_opt++ )
562     {
563         putenv( ppsz_argv[ i_opt ] );
564     }
565     return( 0 );
566 }
567
568 /*****************************************************************************
569  * Usage: print program usage
570  *****************************************************************************
571  * Print a short inline help. Message interface is initialized at this stage.
572  *****************************************************************************/
573 static void Usage( int i_fashion )
574 {
575     /* Usage */
576     intf_Msg( "Usage: %s [options] [parameters] [file]...\n",
577               p_main->psz_arg0 );
578
579     if( i_fashion == USAGE )
580     {
581         intf_Msg( "Try `%s --help' for more information.\n",
582                   p_main->psz_arg0 );
583         return;
584     }
585
586     /* Options */
587     intf_Msg( "\n"
588               "Options:\n"
589               "      --noaudio                  \tdisable audio\n"
590               "      --aout <plugin>            \taudio output method\n"
591               "      --stereo, --mono           \tstereo/mono audio\n"
592               "\n"
593               "      --novideo                  \tdisable video\n"
594               "      --vout <plugin>            \tvideo output method\n"
595               "      --display <display>        \tdisplay string\n"
596               "      --width <w>, --height <h>  \tdisplay dimensions\n"
597               "  -g, --grayscale                \tgrayscale output\n"
598               "      --color                    \tcolor output\n"
599               "\n"
600               "  -a, --dvdaudio <type>          \tchoose DVD audio type\n"
601               "  -c, --dvdchannel <channel>     \tchoose DVD audio channel\n"
602               "  -s, --dvdsubtitle <channel>    \tchoose DVD subtitle channel\n"
603               "\n"
604               "      --novlans                  \tdisable vlans\n"
605               "      --server <host>            \tvideo server address\n"
606               "      --port <port>              \tvideo server port\n"
607               "\n"
608               "      --synchro <type>           \tforce synchro algorithm\n"
609               "\n"
610               "  -h, --help                     \tprint help and exit\n"
611               "  -H, --longhelp                 \tprint long help and exit\n"
612               "  -v, --version                  \toutput version information and exit\n" );
613
614     if( i_fashion == SHORT_HELP )
615         return;
616
617     /* Interface parameters */
618     intf_Msg( "\n"
619               "Interface parameters:\n"
620               "  " INTF_INIT_SCRIPT_VAR "=<filename>               \tinitialization script\n"
621               "  " INTF_CHANNELS_VAR "=<filename>            \tchannels list\n" );
622
623     /* Audio parameters */
624     intf_Msg( "\n"
625               "Audio parameters:\n"
626               "  " AOUT_METHOD_VAR "=<method name>        \taudio method\n"
627               "  " AOUT_DSP_VAR "=<filename>              \tdsp device path\n"
628               "  " AOUT_STEREO_VAR "={1|0}                \tstereo or mono output\n"
629               "  " AOUT_RATE_VAR "=<rate>             \toutput rate\n" );
630
631     /* Video parameters */
632     intf_Msg( "\n"
633               "Video parameters:\n"
634               "  " VOUT_METHOD_VAR "=<method name>        \tdisplay method\n"
635               "  " VOUT_DISPLAY_VAR "=<display name>      \tdisplay used\n"
636               "  " VOUT_WIDTH_VAR "=<width>               \tdisplay width\n"
637               "  " VOUT_HEIGHT_VAR "=<height>             \tdislay height\n"
638               "  " VOUT_FB_DEV_VAR "=<filename>           \tframebuffer device path\n"
639               "  " VOUT_GRAYSCALE_VAR "={1|0}             \tgrayscale or color output\n" );
640
641     /* DVD parameters */
642     intf_Msg( "\n"
643               "DVD parameters:\n"
644               "  " INPUT_DVD_AUDIO_VAR "={ac3|lpcm|mpeg|off} \taudio type\n"
645               "  " INPUT_DVD_CHANNEL_VAR "=[0-15]            \taudio channel\n"
646               "  " INPUT_DVD_SUBTITLE_VAR "=[0-31]           \tsubtitle channel\n" );
647
648     /* Input parameters */
649     intf_Msg( "\n"
650               "Input parameters:\n"
651               "  " INPUT_SERVER_VAR "=<hostname>          \tvideo server\n"
652               "  " INPUT_PORT_VAR "=<port>            \tvideo server port\n"
653               "  " INPUT_IFACE_VAR "=<interface>          \tnetwork interface\n"
654               "  " INPUT_VLAN_SERVER_VAR "=<hostname>     \tvlan server\n"
655               "  " INPUT_VLAN_PORT_VAR "=<port>           \tvlan server port\n" );
656
657     /* Synchro parameters */
658     intf_Msg( "\n"
659               "Synchro parameters:\n"
660               "  " VPAR_SYNCHRO_VAR "={I|IP|IP+|IPB}      \tsynchro algorithm\n");
661 }
662
663 /*****************************************************************************
664  * Version: print complete program version
665  *****************************************************************************
666  * Print complete program version and build number.
667  *****************************************************************************/
668 static void Version( void )
669 {
670     intf_Msg( VERSION_MESSAGE
671               "This program comes with NO WARRANTY, to the extent permitted by law.\n"
672               "You may redistribute it under the terms of the GNU General Public License;\n"
673               "see the file named COPYING for details.\n"
674               "Written by the VideoLAN team at Ecole Centrale, Paris.\n" );
675
676 }
677
678 /*****************************************************************************
679  * InitSignalHandler: system signal handler initialization
680  *****************************************************************************
681  * Set the signal handlers. SIGTERM is not intercepted, because we need at
682  * at least a method to kill the program when all other methods failed, and
683  * when we don't want to use SIGKILL.
684  *****************************************************************************/
685 static void InitSignalHandler( void )
686 {
687     /* Termination signals */
688     signal( SIGHUP,  SignalHandler );
689     signal( SIGINT,  SignalHandler );
690     signal( SIGQUIT, SignalHandler );
691 }
692
693 /*****************************************************************************
694  * SignalHandler: system signal handler
695  *****************************************************************************
696  * This function is called when a signal is received by the program. It tries to
697  * end the program in a clean way.
698  *****************************************************************************/
699 static void SignalHandler( int i_signal )
700 {
701     /* Once a signal has been trapped, the termination sequence will be armed and
702      * following signals will be ignored to avoid sending messages to an interface
703      * having been destroyed */
704     signal( SIGHUP,  SIG_IGN );
705     signal( SIGINT,  SIG_IGN );
706     signal( SIGQUIT, SIG_IGN );
707
708     /* Acknowledge the signal received */
709     intf_ErrMsgImm("intf: signal %d received\n", i_signal );
710
711     /* Try to terminate everything - this is done by requesting the end of the
712      * interface thread */
713     p_main->p_intf->b_die = 1;
714 }
715