/* libsizzle/fnmatch.if - interface spec for the function fnmatch()	-*-c-*-
 
  Copyright (C) 2000 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
 
  This is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2, or (at your option)
  any later version.
  
  This software 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 this package; see the file COPYING.  If not, write to
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */

#define _GNU_SOURCE
#include <fnmatch.h>

/*:doc
  fnmatch
  (fnmatch pattern string flags) => integer
  Apply the C function @code{fnmatch} to the following parameters:
  pattern: string
  string: string
  flags: integer
  doc:*/
#define FUNC_NAME "fnmatch"
static result_t 
fnmatch_func (zzz_scm_t env, zzz_scm_t pattern, zzz_scm_t string, zzz_scm_t flags, zzz_scm_t * result)
{
  static char * s_func_name = FUNC_NAME;
  zzz_scm_t __retval;

  CHECK_TYPE (1, string_p (pattern), zzz_string_type_name);
  CHECK_TYPE (2, string_p (string), zzz_string_type_name);
  CHECK_TYPE (3, integer_p (flags), zzz_integer_type_name);
  {
    int res = fnmatch (string_val (pattern), string_val (string), integer_val (flags));
    __retval = zzz_make_integer (res);
  }
  *result = __retval;
  return RESULT_SUCCESS;
}
#undef FUNC_NAME

