00001 // Copyright 2005 Felix von Leitner <felix-libowfat@fefe.de> 00002 // 2006 Benedikt Böhm <hollow@gentoo.org> 00003 // 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the 00016 // Free Software Foundation, Inc., 00017 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 00019 /*! 00020 * @defgroup open Create or open files 00021 * 00022 * The open family of functions provide wrappers around open(2) with different 00023 * flags. 00024 * 00025 * @{ 00026 */ 00027 00028 #ifndef _LUCID_OPEN_H 00029 #define _LUCID_OPEN_H 00030 00031 /*! 00032 * @brief open file in append mode 00033 * 00034 * @param filename file to open 00035 * 00036 * @return filedescriptor on success, -1 otherwise with errno set 00037 * 00038 * @see open(2) 00039 */ 00040 int open_append(const char *filename); 00041 00042 /*! 00043 * @brief open file exclusively 00044 * 00045 * @param filename file to open 00046 * 00047 * @return filedescriptor on success, -1 otherwise with errno set 00048 * 00049 * @see open(2) 00050 */ 00051 int open_excl(const char *filename); 00052 00053 /*! 00054 * @brief open file for reading 00055 * 00056 * @param filename file to open 00057 * 00058 * @return filedescriptor on success, -1 otherwise with errno set 00059 * 00060 * @see open(2) 00061 */ 00062 int open_read(const char *filename); 00063 00064 /*! 00065 * @brief open file for reading and writing 00066 * 00067 * @param filename file to open 00068 * 00069 * @return filedescriptor on success, -1 otherwise with errno set 00070 * 00071 * @see open(2) 00072 */ 00073 int open_rw(const char *filename); 00074 00075 /*! 00076 * @brief open and truncate file for reading and writing 00077 * 00078 * @param filename file to open 00079 * 00080 * @return filedescriptor on success, -1 otherwise with errno set 00081 * 00082 * @see open(2) 00083 */ 00084 int open_trunc(const char *filename); 00085 00086 /*! 00087 * @brief open file for writing 00088 * 00089 * @param filename file to open 00090 * 00091 * @return filedescriptor on success, -1 otherwise with errno set 00092 * 00093 * @see open(2) 00094 */ 00095 int open_write(const char *filename); 00096 00097 #endif 00098 00099 /*! @} open */