00001 /* --------------------------------------------------------------------------- 00002 Phission : 00003 Realtime Vision Processing System 00004 00005 Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu) 00006 University of Massachusetts at Lowell, 00007 Laboratory for Artificial Intelligence and Robotics 00008 00009 This file is part of Phission. 00010 00011 Phission is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU Lesser General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 Phission is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU Lesser General Public License for more details. 00020 00021 You should have received a copy of the GNU Lesser General Public License 00022 along with Phission; if not, write to the Free Software 00023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 00025 ---------------------------------------------------------------------------*/ 00026 #ifdef HAVE_CONFIG_H 00027 #include <phissionconfig.h> 00028 #endif 00029 00030 #include <phStandard.h> 00031 00032 #include <phError.h> 00033 #include <phFile.h> 00034 #include <phMemory.h> 00035 #include <phPrint.h> 00036 00037 #ifdef __cplusplus 00038 extern "C" { 00039 #endif 00040 00041 /* ------------------------------------------------------------------------ */ 00042 #if defined(_MSC_VER) 00043 #define fileno _fileno 00044 int ph_file_lock(FILE *f) { _lock_file(f); return 0; } 00045 int ph_file_unlock(FILE *f) { _unlock_file(f); return 0; } 00046 #elif !defined(__ADSPBLACKFIN__) 00047 #include <sys/file.h> 00048 int ph_file_lock(FILE *f) { return flock(fileno(f),LOCK_EX); } 00049 int ph_file_unlock(FILE *f) { return flock(fileno(f),LOCK_UN); } 00050 #else 00051 #define ph_file_lock(f) 00052 #define ph_file_unlock(f) 00053 #endif 00054 00055 00056 #ifdef __cplusplus 00057 } /* extern "C" { */ 00058 #endif 00059 00060 00061
Copyright (C) 2002 - 2007 |
Philip D.S. Thoren ( pthoren@users.sourceforge.net ) University Of Massachusetts at Lowell Robotics Lab |