don't use function-equal in nadvice
[bpt/emacs.git] / lib / save-cwd.h
CommitLineData
8654f9d7
PE
1/* Do not save and restore the current working directory.
2
ba318903 3 Copyright 2013-2014 Free Software Foundation, Inc.
8654f9d7
PE
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18/* Gnulib needs to save and restore the current working directory to
19 fully emulate functions like fstatat. But Emacs doesn't care what
20 the current working directory is; it always uses absolute file
21 names. This module replaces the Gnulib module by omitting the code
22 that Emacs does not need. */
23
24#ifndef SAVE_CWD_H
25#define SAVE_CWD_H 1
26
27_GL_INLINE_HEADER_BEGIN
28#ifndef SAVE_CWD_INLINE
29# define SAVE_CWD_INLINE _GL_INLINE
30#endif
31
32struct saved_cwd { int desc; };
33
34SAVE_CWD_INLINE int
35save_cwd (struct saved_cwd *cwd)
36{
37 cwd->desc = -1;
38 return 0;
39}
40
41SAVE_CWD_INLINE int restore_cwd (struct saved_cwd const *cwd) { return 0; }
42SAVE_CWD_INLINE void free_cwd (struct saved_cwd *cwd) { }
43
44_GL_INLINE_HEADER_END
45
46#endif