Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* -*- buffer-read-only: t -*- vi: set ro: */ 00002 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 00003 /* Hook for making the close() function extensible. 00004 Copyright (C) 2009-2011 Free Software Foundation, Inc. 00005 00006 This program is free software: you can redistribute it and/or modify it 00007 under the terms of the GNU General Public License as published 00008 by the Free Software Foundation; either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00018 00019 00020 #ifndef CLOSE_HOOK_H 00021 #define CLOSE_HOOK_H 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 00028 /* Currently, this entire code is only needed for the handling of sockets 00029 on native Windows platforms. */ 00030 #if WINDOWS_SOCKETS 00031 00032 00033 /* An element of the list of close hooks. 00034 The fields of this structure are considered private. */ 00035 struct close_hook 00036 { 00037 /* Doubly linked list. */ 00038 struct close_hook *private_next; 00039 struct close_hook *private_prev; 00040 /* Function that treats the types of FD that it knows about and calls 00041 execute_close_hooks (FD, REMAINING_LIST) as a fallback. */ 00042 int (*private_fn) (int fd, const struct close_hook *remaining_list); 00043 }; 00044 00045 /* This type of function closes FD, applying special knowledge for the FD 00046 types it knows about, and calls execute_close_hooks (FD, REMAINING_LIST) 00047 for the other FD types. */ 00048 typedef int (*close_hook_fn) (int fd, const struct close_hook *remaining_list); 00049 00050 /* Execute the close hooks in REMAINING_LIST. 00051 Return 0 or -1, like close() would do. */ 00052 extern int execute_close_hooks (int fd, const struct close_hook *remaining_list); 00053 00054 /* Execute all close hooks. 00055 Return 0 or -1, like close() would do. */ 00056 extern int execute_all_close_hooks (int fd); 00057 00058 /* Add a function to the list of close hooks. 00059 The LINK variable points to a piece of memory which is guaranteed to be 00060 accessible until the corresponding call to unregister_close_hook. */ 00061 extern void register_close_hook (close_hook_fn hook, struct close_hook *link); 00062 00063 /* Removes a function from the list of close hooks. */ 00064 extern void unregister_close_hook (struct close_hook *link); 00065 00066 00067 #endif 00068 00069 00070 #ifdef __cplusplus 00071 } 00072 #endif 00073 00074 #endif /* CLOSE_HOOK_H */