#ifndef H_ED_TOK_20021225141359
#define H_ED_TOK_20021225141359

#ifdef __cplusplus
extern "C"
{
#endif

/* ---------------------------------------------------------------------
   (c) ED 2001-2008
   Project      : CLIB
   Function     : string tokenizer
   Module       : TOK
   File         : TOK.H
   Created      : 11-03-2001
   Modified     : 29-05-2008
   --------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
   Log

   1.5 - 29-05-2008 *TOK* becomes *tok*. Ascending compatibility is preserved
   1.4 - 01-02-2005 String handling debugging.
   1.3 - 27-01-2005 String handling added.
   .                Refactoring.
   .                - TOK_init() becomes TOK_create()
   .                - TOK_end() becomes TOK_delete()
   1.2 - 01-06-2004 .errno becomes .err
   1.1 - 25-12-2002 sTOK_INFO and TOK_get() added
   1.0 - 11-03-2001 Working version
   0.0 - 11-03-2001 Created

   --------------------------------------------------------------------- */
#include <stddef.h>

/* macros ============================================================== */

#define TOK_OLD 1

/* constants =========================================================== */

typedef enum
{
   TOK_OK,
#define ITEM(a,b) TOK_ERR_##a,
#include "ed/inc/tok_err.itm"
#undef ITEM
   TOK_ERR_NB
}
tok_err_e;

#if TOK_OLD
#define eTOK_ERR tok_err_e
#endif


/* types =============================================================== */

typedef int tok_list_f (char const *s, size_t rank, void *puser);

#if TOK_OLD
typedef tok_list_f fTOK_LIST;
#endif


/* structures ========================================================== */

typedef struct tok tok_s;
#if TOK_OLD
typedef struct tok sTOK;
#endif

typedef struct
{
   int argc;
   char const **argv;
}
tok_info_s;
#if TOK_OLD
typedef tok_info_s sTOK_INFO;
#endif

/* internal public data ================================================ */
/* internal public functions =========================================== */
/* entry points ======================================================== */

/* ---------------------------------------------------------------------
   TOK_sver()
   ---------------------------------------------------------------------
   Returns the "Version" string
   ---------------------------------------------------------------------
   I:
   O: ASCIIZ string pointer
   --------------------------------------------------------------------- */
char const *tok_sver (void);
#if TOK_OLD
#define TOK_sver() tok_sver()
#endif

/* ---------------------------------------------------------------------
   tok_sid()
   ---------------------------------------------------------------------
   Returns the "Identification" string
   ---------------------------------------------------------------------
   I:
   O: ASCIIZ string pointer
   --------------------------------------------------------------------- */
char const *tok_sid (void);
#if TOK_OLD
#define TOK_sid() tok_sid()
#endif

/* ---------------------------------------------------------------------
   tok_serr()
   ---------------------------------------------------------------------
   Returns an error string
   ---------------------------------------------------------------------
   I: Context
   O:
   --------------------------------------------------------------------- */
char const *tok_serr (tok_err_e err);
#if TOK_OLD
#define TOK_serr(a) tok_serr (a)
#endif

/* ---------------------------------------------------------------------
   tok_create()
   ---------------------------------------------------------------------
   Creates and initializes the C-object
   ---------------------------------------------------------------------
   I: string to be analysed
   I: separator string
   I: list of string delimitors (in a string) or NULL
   O: Context
   --------------------------------------------------------------------- */
tok_s *tok_create (char const *s, char const *sep, char const *str_delim);
#if TOK_OLD
#define TOK_create(a, b, c) tok_create (a, b, c)
#endif

/* ---------------------------------------------------------------------
   tok_delete()
   ---------------------------------------------------------------------
   Suppresses the C-object
   ---------------------------------------------------------------------
   I: Context
   O:
   --------------------------------------------------------------------- */
void tok_delete (tok_s * self);
#if TOK_OLD
#define TOK_delete(a) tok_delete (a)
#endif

/* ---------------------------------------------------------------------
   tok_list()
   ---------------------------------------------------------------------

   ---------------------------------------------------------------------
   I: Context
   O:
   --------------------------------------------------------------------- */
tok_err_e tok_list (tok_s * self, tok_list_f * pf, void *puser);
#if TOK_OLD
#define TOK_list(a, b, c) tok_list (a, b, c)
#endif

/* ---------------------------------------------------------------------
   tok_get()
   ---------------------------------------------------------------------

   ---------------------------------------------------------------------
   I: Context
   O:
   --------------------------------------------------------------------- */
tok_err_e tok_get (tok_s * self, tok_info_s *p_info);
#if TOK_OLD
#define TOK_get(a, b) tok_get (a, b)
#endif

/* ---------------------------------------------------------------------
   tok_errno()
   ---------------------------------------------------------------------

   ---------------------------------------------------------------------
   I: Context
   O:
   --------------------------------------------------------------------- */
tok_err_e tok_errno (tok_s * self);
#if TOK_OLD
#define TOK_errno(a) tok_errno (a)
#endif

/* public data ========================================================= */

/* File generated by 'NEW.EXE' Ver 1.28 (c) ED 1998-2001 */

#ifdef __cplusplus
}
#endif

#endif /* H_ED_TOK_20021225141359 */
/* GUARD (c) ED 2000-2002 Dec 15 2002 Ver. 1.4 */
