2019-03-22 23:35:00 +08:00
|
|
|
// *****************************************************************************
|
|
|
|
// check_glob.c make-it-quick project
|
|
|
|
// *****************************************************************************
|
|
|
|
//
|
|
|
|
// File description:
|
|
|
|
//
|
2019-03-16 01:54:07 +08:00
|
|
|
// Check if glob exists and has basic functionality
|
2019-03-22 23:35:00 +08:00
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// *****************************************************************************
|
|
|
|
// This software is licensed under the GNU General Public License v3
|
|
|
|
// (C) 2018-2019, Christophe de Dinechin <christophe@dinechin.org>
|
|
|
|
// *****************************************************************************
|
|
|
|
// This file is part of make-it-quick
|
|
|
|
//
|
|
|
|
// make-it-quick is free software: you can r redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// make-it-quick is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with make-it-quick, in a file named COPYING.
|
|
|
|
// If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
// *****************************************************************************
|
2019-03-16 01:54:07 +08:00
|
|
|
|
2018-11-18 00:28:23 +08:00
|
|
|
#include <glob.h>
|
|
|
|
|
|
|
|
int glob_error(const char *epath, int errno)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
glob_t files;
|
|
|
|
const char *pattern = "*";
|
|
|
|
glob(pattern, GLOB_MARK, glob_error, &files);
|
|
|
|
globfree(&files);
|
2018-11-18 00:55:07 +08:00
|
|
|
return 0;
|
2018-11-18 00:28:23 +08:00
|
|
|
}
|