mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
69b1b4da27
otherwise.
70 lines
2.1 KiB
C
70 lines
2.1 KiB
C
/* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */
|
|
/*
|
|
* Copyright 1997 - 2009 by Eric House (xwords@eehouse.org). All rights
|
|
* reserved.
|
|
*
|
|
* This program 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
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#ifndef __DICTITER_H__
|
|
#define __DICTITER_H__
|
|
|
|
#ifdef XWFEATURE_WALKDICT
|
|
|
|
#include "comtypes.h"
|
|
|
|
#include "dawg.h"
|
|
#include "model.h"
|
|
#include "mempool.h"
|
|
|
|
#ifdef CPLUS
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
/* API for iterating over a dict */
|
|
typedef XP_U32 DictIndex;
|
|
typedef struct _DictWord {
|
|
XP_U32 wordCount;
|
|
DictIndex index;
|
|
XP_U16 nTiles;
|
|
XP_U32 indices[MAX_COLS];
|
|
} DictWord;
|
|
|
|
typedef struct _IndexData {
|
|
DictIndex* indices;
|
|
Tile* prefixes;
|
|
XP_U16 count; /* in-out: must indicate others are large enough */
|
|
} IndexData;
|
|
|
|
XP_U32 dict_countWords( const DictionaryCtxt* dict );
|
|
void dict_makeIndex( const DictionaryCtxt* dict, XP_U16 depth,
|
|
IndexData* data );
|
|
XP_Bool dict_firstWord( const DictionaryCtxt* dict, DictWord* word );
|
|
XP_Bool dict_lastWord( const DictionaryCtxt* dict, DictWord* word );
|
|
XP_Bool dict_getNextWord( const DictionaryCtxt* dict, DictWord* word );
|
|
XP_Bool dict_getPrevWord( const DictionaryCtxt* dict, DictWord* word );
|
|
XP_Bool dict_getNthWord( const DictionaryCtxt* dict, DictWord* word, XP_U32 nn,
|
|
XP_U16 depth, IndexData* data );
|
|
void dict_wordToString( const DictionaryCtxt* dict, const DictWord* word,
|
|
XP_UCHAR* buf, XP_U16 buflen );
|
|
|
|
|
|
#ifdef CPLUS
|
|
}
|
|
#endif
|
|
|
|
#endif /* XWFEATURE_WALKDICT */
|
|
#endif
|