graphicSession.c

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------*/
00002 /* file: graphicSession.h                                                 */
00003 /* Copyright INRIA 2006                                                   */
00004 /* Authors : Jean-Baptiste Silvy                                          */
00005 /* desc : routines to open and close graphic sessions. This is used to    */
00006 /*        prevent from opening more than one.                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 #include "graphicSession.h"
00010 
00011 /* boolean variable to know wether a session is opened */
00012 static BOOL isSessionOpened = FALSE ;
00013 
00014 /*-----------------------------------------------------------------------------------*/
00015 int openGraphicSession( void )
00016 {
00017   if ( !isSessionOpened )
00018   {
00019      isSessionOpened = TRUE ;
00020      return 0 ;
00021   }
00022   else
00023   {
00024     return 1 ;
00025   }
00026   return -1 ;
00027 }
00028 /*-----------------------------------------------------------------------------------*/
00029 int closeGraphicSession( void )
00030 {
00031   if ( isSessionOpened )
00032   {
00033     isSessionOpened = FALSE ;
00034     return 0 ;
00035   }
00036   else
00037   {
00038     return 1 ;
00039   }
00040   return -1 ;
00041 }
00042 /*-----------------------------------------------------------------------------------*/
00043 BOOL isGraphicSessionOpened( void )
00044 {
00045   return isSessionOpened ;
00046 }
00047 /*-----------------------------------------------------------------------------------*/

Generated on Sun Mar 4 15:03:51 2007 for Scilab [trunk] by  doxygen 1.5.1