[tools] / trunk / Video_Conferencing_Startup_Kit_Pkg_2 / sipp / screen.hpp Repository:
ViewVC logotype

View of /trunk/Video_Conferencing_Startup_Kit_Pkg_2/sipp/screen.hpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 89 - (download) (annotate)
Wed Sep 7 14:38:33 2011 UTC (20 months, 2 weeks ago) by jhermanski
File size: 2611 byte(s)
Add Video Demo Startup Kit
    1 /*
    2  *  This program is free software; you can redistribute it and/or modify
    3  *  it under the terms of the GNU General Public License as published by
    4  *  the Free Software Foundation; either version 2 of the License, or
    5  *  (at your option) any later version.
    6  *
    7  *  This program is distributed in the hope that it will be useful,
    8  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    9  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   10  *  GNU General Public License for more details.
   11  *
   12  *  You should have received a copy of the GNU General Public License
   13  *  along with this program; if not, write to the Free Software
   14  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   15  *
   16  *  Copyright (C) 2003 - The Authors
   17  *
   18  *  Author : Richard GAYRAUD - 04 Nov 2003
   19  *           From Hewlett Packard Company.
   20  */
   21 
   22 /****
   23  * Screen.hpp : Simple curses & logfile encapsulation
   24  */
   25 
   26 #ifndef __SCREEN_H__
   27 #define __SCREEN_H__
   28 
   29 #include <stdio.h>
   30 
   31 #ifdef __cplusplus
   32 extern "C"
   33 #endif
   34 void _screen_error(char *s, int fatal);
   35 
   36 extern char _screen_err[32768];
   37 
   38 #define OUTPUT_P3(s, p1, p2, p3, fatal) {     \
   39   sprintf(_screen_err, s, p1, p2, p3);        \
   40   _screen_error((char *)_screen_err , fatal); \
   41 }
   42 #define OUTPUT_P2(s, p1, p2, fatal) {     \
   43   sprintf(_screen_err, s, p1, p2);        \
   44   _screen_error((char *)_screen_err , fatal); \
   45 }
   46 #define OUTPUT_P1(s, p1, fatal) {     \
   47   sprintf(_screen_err, s, p1);        \
   48   _screen_error((char *)_screen_err , fatal); \
   49 }
   50 
   51 #define ERROR_P3(s, p1, p2, p3) OUTPUT_P3(s, p1, p2, p3, 1)
   52 #define ERROR_P2(s, p1, p2)     OUTPUT_P2(s, p1, p2, 1)
   53 #define ERROR_P1(s, p)          OUTPUT_P1(s, p, 1)
   54 #define ERROR(s)                ERROR_P1("%s", s)
   55 #define ERROR_NO(s) \
   56         ERROR_P3("%s, errno = %d (%s)", s, errno, strerror(errno))
   57 
   58 #define WARNING_P3(s, p1, p2, p3) OUTPUT_P3(s, p1, p2, p3, 0)
   59 #define WARNING_P2(s, p1, p2)     OUTPUT_P2(s, p1, p2, 0)
   60 #define WARNING_P1(s, p)          OUTPUT_P1(s, p, 0)
   61 #define WARNING(s)                WARNING_P1("%s", s)
   62 #define WARNING_NO(s) \
   63         WARNING_P3("%s, errno = %d (%s)", s, errno, strerror(errno))
   64 
   65 #define EXIT_TEST_OK               0
   66 #define EXIT_TEST_FAILED           1
   67 #define EXIT_TEST_RES_INTERNAL     97
   68 #define EXIT_TEST_RES_UNKNOWN      98
   69 #define EXIT_OTHER                 99
   70 #define EXIT_FATAL_ERROR           -1
   71 
   72 void screen_set_exename(char * exe_name);
   73 void screen_init(char *logfile_name, void (*exit_handler)());
   74 void screen_clear();
   75 int  screen_readkey();
   76 void screen_exit(int rc);
   77 void screen_sigusr1(int /* not used */);
   78 
   79 #endif // __SCREEN_H__
   80 

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.8