annotate liboctave/glob-match.cc @ 10158:4c0cdbe0acca

remove Emacs local-variable settings from liboctave source files
author John W. Eaton <jwe@octave.org>
date Wed, 20 Jan 2010 19:04:35 -0500
parents deba43069023
children fd0a3ac60b0e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
1 /*
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
2
10138
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
3 Copyright (C) 1996, 1997, 2000, 2005, 2006, 2007, 2009, 2010 John W. Eaton
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
4
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
6
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5775
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5775
diff changeset
10 option) any later version.
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
11
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
15 for more details.
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
16
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5775
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5775
diff changeset
19 <http://www.gnu.org/licenses/>.
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
20
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
21 */
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
22
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
24 #include <config.h>
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
25 #endif
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
26
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
27 #include <fnmatch.h>
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
28
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2924
diff changeset
29 #include "glob-match.h"
10148
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
30 #include "oct-glob.h"
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
31
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
32 bool
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
33 glob_match::match (const std::string& str) const
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
34 {
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
35 return octave_fnmatch (pat, str, fnmatch_flags);
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
36 }
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
37
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
38 string_vector
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
39 glob_match::glob (void) const
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
40 {
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
41 return octave_glob (pat);
deba43069023 don't install oct-glob.h
John W. Eaton <jwe@octave.org>
parents: 10138
diff changeset
42 }
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
43
10138
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
44 int
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
45 glob_match::opts_to_fnmatch_flags (unsigned int xopts) const
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
46 {
10138
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
47 int retval = 0;
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
48
10138
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
49 if (xopts & pathname)
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
50 retval |= FNM_PATHNAME;
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
51
10138
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
52 if (xopts & noescape)
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
53 retval |= FNM_NOESCAPE;
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
54
10138
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
55 if (xopts & period)
805a83ecd3da avoid conflict between glob.h definition of glob and glob_match::glob function
John W. Eaton <jwe@octave.org>
parents: 9994
diff changeset
56 retval |= FNM_PERIOD;
2924
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
57
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
58 return retval;
50edcdd3ec22 [project @ 1997-05-03 20:21:03 by jwe]
jwe
parents:
diff changeset
59 }