/** 
 *  Yudit Unicode Editor Source File
 *
 *  GNU Copyright (C) 1997-2006  Gaspar Sinai <gaspar@yudit.org>  
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License, version 2,
 *  dated June 1991. See file COPYYING for details.
 *
 *  This program 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 program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
#ifndef STypes_h
#define STypes_h

#define SD_YUDIT_VERSION "2.9.6"

// Get the SS_WORD16_t and u_int_32
#include <sys/types.h>
#include "stoolkit/SBinVector.h"
#include "stoolkit/SStringVector.h"

#ifdef HAVE_UTYPES
 typedef u_int8_t SS_WORD8;
 typedef u_int16_t SS_WORD16;
 typedef u_int32_t SS_WORD32;

#ifdef HAVE_LONG_LONG
  typedef u_int64_t SS_WORD64;
#else /* HAVE_LONG_LONG */
  typedef u_int32_t SS_WORD64;
#endif /* HAVE_LONG_LONG */

#else /* HAVE_UTYPES */
 typedef unsigned char SS_WORD8;
 typedef unsigned short SS_WORD16;
 typedef unsigned int SS_WORD32;

#ifdef HAVE_LONG_LONG
  typedef unsigned long long  SS_WORD64;
#else /* HAVE_LONG_LONG */
  typedef unsigned long  SS_WORD64;
#endif /* HAVE_LONG_LONG */

#endif /* HAVE_UTYPES */

typedef SS_WORD16 SS_UCS2;
typedef SS_WORD32 SS_UCS4;

typedef SBinVector<SS_UCS2> SV_UCS2;
typedef SBinVector<SS_UCS4> SV_UCS4;

/* processors calcualte with intergers fast */
typedef unsigned int SS_UINT;
typedef int SS_INT;

typedef SBinVector<SS_UINT> SV_UINT;
typedef SBinVector<SS_INT> SV_INT;

/*
 * SStringVector column0 = SStringTable[0];
 */
typedef SVector<SStringVector> SStringTable;

typedef int SAlignment;

typedef SS_WORD16 SS_GlyphIndex;
typedef SBinVector<SS_GlyphIndex> SV_GlyphIndex;

typedef  SBinVector<int> SSyntaxRow;
typedef  SBinVector<SSyntaxRow*> SSyntaxData;
typedef  SBinVector<SV_UCS4*> SUnicodeData;

#define SD_Left ((SAlignment)-1)
#define SD_Right ((SAlignment)1)
#define SD_Center ((SAlignment)0)

/* char can be only positive on some platforms */
#define SD_NOSHAPE ((char)0x7f)

/* This many lines are pre-expanded around cursor, for efficiencey */
#define SD_PRE_EXPAND 50
#define DEBUG_PARSER 0

#define SD_MATCH_EOD 0x7ffffff
// to provide timer based solution
#define SD_MATCH_AGAIN 0x7fffffe


#endif /* STypes_h */
