00001 /* Part of the culibs project, <http://www.eideticdew.org/culibs/>. 00002 * Copyright (C) 2008 Petter Urkedal <urkedal@nbi.dk> 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 3 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, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef CUOS_SINK_H 00019 #define CUOS_SINK_H 00020 00021 #include <cu/fwd.h> 00022 00023 CU_BEGIN_DECLARATIONS 00024 /*!\defgroup cuos_dsink_h cuos/dsink.h: Binding Data Sinks to Resources 00025 *@{\ingroup cuos_mod */ 00026 00027 /*!Returns a \ref cu_dsink_h "cu_dsink_t" tied to the file descriptor \a fd. 00028 * Closing the sink preserves \a fd. */ 00029 cu_dsink_t cuos_dsink_fdopen(int fd); 00030 00031 /*!Returns a \ref cu_dsink_h "cu_dsink_t" tied to the file descriptor \a fd. 00032 * Closing the sink effects a \c close(fd). */ 00033 cu_dsink_t cuos_dsink_fdopen_close(int fd); 00034 00035 /*!Creates a regular file at \a ref path to be filled with any data written to 00036 * the sink. */ 00037 cu_dsink_t cuos_dsink_fopen(char const *path); 00038 00039 /*!@}*/ 00040 CU_END_DECLARATIONS 00041 00042 #endif