]> sjero.net Git - linphone/blob - console/linphonec.h
Aac-eld add missing header according to RFC3640 3.3.6
[linphone] / console / linphonec.h
1 /****************************************************************************
2  *
3  *  $Id: linphonec.h,v 1.3 2006/01/20 14:12:34 strk Exp $
4  *
5  *  Copyright (C) 2005  Sandro Santilli <strk@keybit.net>
6  *
7  ****************************************************************************
8  *
9  *  This program is free software; you can redistribute it and/or modify
10  *  it under the terms of the GNU General Public License as published by
11  *  the Free Software Foundation; either version 2 of the License, or
12  *  (at your option) any later version.
13  *
14  *  This program is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *  GNU Library General Public License for more details.
18  *
19  *  You should have received a copy of the GNU General Public License
20  *  along with this program; if not, write to the Free Software
21  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  *
23  ****************************************************************************/
24
25 #ifndef LINPHONEC_H
26 #define LINPHONEC_H 1
27
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31
32 #ifdef HAVE_READLINE
33 #ifdef HAVE_READLINE_H
34 #include <readline.h>
35 #else
36 #ifdef HAVE_READLINE_READLINE_H
37 #include <readline/readline.h>
38 #endif
39 #endif
40 #ifdef HAVE_HISTORY_H
41 #include <history.h>
42 #else
43 #ifdef HAVE_READLINE_HISTORY_H
44 #include <readline/history.h>
45 #endif
46 #endif
47 #endif
48
49 #undef PARAMS
50 /**************************************************************************
51  *
52  * Compile-time defines
53  *
54  **************************************************************************/
55
56 #define HISTSIZE 500            /* how many lines of input history */
57 #define PROMPT_MAX_LEN 256      /* max len of prompt string */
58 #define LINE_MAX_LEN 256        /* really needed ? */
59
60 /*
61  * Define this to have your primary contact
62  * as the prompt string
63  */
64 /* #define IDENTITY_AS_PROMPT 1 */
65
66 /*
67  * Time between calls to linphonec_idle_call during main
68  * input read loop in microseconds.
69  */
70 #define LPC_READLINE_TIMEOUT 10000
71
72 /*
73  * Filename of linphonec history
74  */
75 #define LPC_HIST_FILE "~/.linphonec_history"
76
77 /*
78  * Maximum number of pending authentications
79  */
80 #define MAX_PENDING_AUTH 8
81
82 /**************************************************************************
83  *
84  *  Types
85  *
86  **************************************************************************/
87
88 /*
89  * A structure which contains information on the commands this program
90  * can understand.
91  */
92 typedef int (*lpc_cmd_handler)(LinphoneCore *, char *);
93 typedef struct {
94         char *name;             /* User printable name of the function. */
95         lpc_cmd_handler func;   /* Function to call to do the job. */
96         char *help;             /* Short help for this function.  */
97         char *doc;              /* Long description.  */
98 } LPC_COMMAND;
99
100 typedef struct {
101         int x,y,w,h;
102         unsigned long wid;
103         bool_t show;
104         bool_t refresh;
105 } VideoParams;
106
107
108 extern VideoParams lpc_video_params;
109 extern VideoParams lpc_preview_params;
110
111 /***************************************************************************
112  *
113  *  Forward declarations
114  *
115  ***************************************************************************/
116
117 extern int linphonec_parse_command_line(LinphoneCore *lc, char *cl);
118 extern char *linphonec_command_generator(const char *text, int state);
119 void linphonec_main_loop_exit();
120 extern void linphonec_finish(int exit_status);
121 extern char *linphonec_readline(char *prompt);
122 void linphonec_set_autoanswer(bool_t enabled);
123 bool_t linphonec_get_autoanswer();
124 void linphonec_command_finished(void);
125 void linphonec_set_caller(const char *caller);
126 LinphoneCall *linphonec_get_call(long id);
127 void linphonec_call_identify(LinphoneCall* call);
128
129 extern bool_t linphonec_camera_enabled;
130
131 #endif /* def LINPHONEC_H */
132
133 /****************************************************************************
134  *
135  * $Log: linphonec.h,v $
136  * Revision 1.3  2006/01/20 14:12:34  strk
137  * Added linphonec_init() and linphonec_finish() functions.
138  * Handled SIGINT and SIGTERM to invoke linphonec_finish().
139  * Handling of auto-termination (-t) moved to linphonec_finish().
140  * Reworked main (input read) loop to not rely on 'terminate'
141  * and 'run' variable (dropped). configfile_name allocated on stack
142  * using PATH_MAX limit. Changed print_usage signature to allow
143  * for an exit_status specification.
144  *
145  * Revision 1.2  2006/01/14 13:29:32  strk
146  * Reworked commands interface to use a table structure,
147  * used by command line parser and help function.
148  * Implemented first level of completion (commands).
149  * Added notification of invalid "answer" and "terminate"
150  * commands (no incoming call, no active call).
151  * Forbidden "call" intialization when a call is already active.
152  * Cleaned up all commands, adding more feedback and error checks.
153  *
154  * Revision 1.1  2006/01/13 13:00:29  strk
155  * Added linphonec.h. Code layout change (added comments, forward decl,
156  * globals on top, copyright notices and Logs). Handled out-of-memory
157  * condition on history management. Removed assumption on sizeof(char).
158  * Fixed bug in authentication prompt (introduced by readline).
159  * Added support for multiple authentication requests (up to MAX_PENDING_AUTH).
160  *
161  *
162  ****************************************************************************/