Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

sighandler.C

Go to the documentation of this file.
00001 #include "asset.h"
00002 #include "file.h"
00003 #include "sighandler.h"
00004 
00005 SigHandler::SigHandler()
00006  : BC_Signals()
00007 {
00008 }
00009 
00010 void SigHandler::signal_handler(int signum)
00011 {
00012         printf("SigHandler::signal_handler total files=%d\n", 
00013                 files.total);
00014         for(int i = 0; i < files.total; i++)
00015         {
00016                 printf("Closing %s\n", files.values[i]->asset->path);
00017                 files.values[i]->close_file(1);
00018         }
00019 }
00020 
00021 void SigHandler::push_file(File *file)
00022 {
00023 // Check for duplicate
00024         for(int i = 0; i < files.total; i++)
00025         {
00026                 if(files.values[i] == file)
00027                 {
00028                         printf("SigHandler::push_file: file %s already on table.\n",
00029                                 file->asset->path);
00030                         return;
00031                 }
00032         }
00033 
00034 // Append file
00035         files.append(file);
00036 }
00037 
00038 void SigHandler::pull_file(File *file)
00039 {
00040         for(int i = 0; i < files.total; i++)
00041         {
00042                 if(files.values[i] == file)
00043                 {
00044                         files.remove_number(i);
00045                         return;
00046                 }
00047         }
00048         printf("SigHandler::pull_file: file %s not on table.\n",
00049                 file->asset->path);
00050 }
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 

Generated on Sun Jan 8 13:39:00 2006 for Cinelerra-svn by  doxygen 1.4.4