xref: /haiku/headers/private/shared/AutoDeleterPosix.h (revision 553f3f2309e87d95345220463fa865d5fd8cf28d)
1*553f3f23SX512 /*
2*553f3f23SX512  * Copyright 2020, Haiku, Inc.
3*553f3f23SX512  * Distributed under the terms of the MIT License.
4*553f3f23SX512  */
5*553f3f23SX512 #ifndef _AUTO_DELETER_POSIX_H
6*553f3f23SX512 #define _AUTO_DELETER_POSIX_H
7*553f3f23SX512 
8*553f3f23SX512 
9*553f3f23SX512 #include <AutoDeleter.h>
10*553f3f23SX512 #include <stdio.h>
11*553f3f23SX512 #include <dirent.h>
12*553f3f23SX512 #include <fs_attr.h>
13*553f3f23SX512 
14*553f3f23SX512 
15*553f3f23SX512 namespace BPrivate {
16*553f3f23SX512 
17*553f3f23SX512 
18*553f3f23SX512 typedef CObjectDeleter<FILE, int, fclose> FileCloser;
19*553f3f23SX512 typedef CObjectDeleter<DIR, int, closedir> DirCloser;
20*553f3f23SX512 typedef CObjectDeleter<DIR, int, fs_close_attr_dir> AttrDirCloser;
21*553f3f23SX512 
22*553f3f23SX512 
23*553f3f23SX512 }
24*553f3f23SX512 
25*553f3f23SX512 
26*553f3f23SX512 using ::BPrivate::FileCloser;
27*553f3f23SX512 using ::BPrivate::DirCloser;
28*553f3f23SX512 using ::BPrivate::AttrDirCloser;
29*553f3f23SX512 
30*553f3f23SX512 
31*553f3f23SX512 #endif	// _AUTO_DELETER_POSIX_H
32