/* libsizzle/stringfun.h - string function declarations
 
  Copyright (C) 1999, 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.  */

#ifndef __SIZZLE_STRINGFUN_H__
#define __SIZZLE_STRINGFUN_H__

#if HAVE_CONFIG_H
# include <config.h>
#endif 

#if __SIZZLE_IMPORT__
# define SIZZLE_API __declspec (dllimport)
#elif __SIZZLE_EXPORT__ 
# define SIZZLE_API __declspec (dllexport)
#else
# define SIZZLE_API
#endif

#include "node.h"

/* Helper function for handling optional start and end arguments in
 string priitives.  @var{s_func_name} is a string containing the name
 of the calling procedure (for error messages), @var{arg_index} is the
 number of the (optional) start index (also for error messages),
 @var{string} is the string for which the start end end indices have
 to be verified.  @var{start} and @var{end} are the Scheme values for
 the indices, both of them may be #<undefined>, in which they default
 to 0 and the length of the string minus one. @var{cstart} and
 @var{cend} point to locations where the indices will be stored.
 @var{result} holds an exception object on exit if the result of the
 function is @code{RESULT_EXCEPTION}.  */
SIZZLE_API result_t zzz_parse_string_indices (char * s_func_name, 
					      int arg_index,
					      zzz_scm_t string,
					      zzz_scm_t start, zzz_scm_t end,
					      int * cstart, int * cend,
					      zzz_scm_t * result);

/* Initialize the string function module.  This registers all standard
   string procedures.  */
SIZZLE_API result_t zzz_init_stringfun (void);

#endif /* not __SIZZLE_STRINGFUN_H__ */
