xref: /dflybsd-src/contrib/grep/lib/save-cwd.h (revision 91b9ed38d3db6a8a8ac5b66da1d43e6e331e259a)
1cf28ed85SJohn Marino /* Save and restore current working directory.
2cf28ed85SJohn Marino 
3*09d4459fSDaniel Fojt    Copyright (C) 1995, 1997-1998, 2003, 2009-2020 Free Software Foundation,
4cf28ed85SJohn Marino    Inc.
5cf28ed85SJohn Marino 
6cf28ed85SJohn Marino    This program is free software: you can redistribute it and/or modify
7cf28ed85SJohn Marino    it under the terms of the GNU General Public License as published by
8cf28ed85SJohn Marino    the Free Software Foundation; either version 3 of the License, or
9cf28ed85SJohn Marino    (at your option) any later version.
10cf28ed85SJohn Marino 
11cf28ed85SJohn Marino    This program is distributed in the hope that it will be useful,
12cf28ed85SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
13cf28ed85SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14cf28ed85SJohn Marino    GNU General Public License for more details.
15cf28ed85SJohn Marino 
16cf28ed85SJohn Marino    You should have received a copy of the GNU General Public License
17*09d4459fSDaniel Fojt    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
18cf28ed85SJohn Marino 
19cf28ed85SJohn Marino /* Written by Jim Meyering.  */
20cf28ed85SJohn Marino 
21cf28ed85SJohn Marino #ifndef SAVE_CWD_H
22cf28ed85SJohn Marino # define SAVE_CWD_H 1
23cf28ed85SJohn Marino 
24cf28ed85SJohn Marino struct saved_cwd
25cf28ed85SJohn Marino   {
26cf28ed85SJohn Marino     int desc;
27cf28ed85SJohn Marino     char *name;
28cf28ed85SJohn Marino   };
29cf28ed85SJohn Marino 
30cf28ed85SJohn Marino int save_cwd (struct saved_cwd *cwd);
31cf28ed85SJohn Marino int restore_cwd (const struct saved_cwd *cwd);
32cf28ed85SJohn Marino void free_cwd (struct saved_cwd *cwd);
33cf28ed85SJohn Marino 
34cf28ed85SJohn Marino #endif /* SAVE_CWD_H */
35