#include <cstdlib>
#include <string>

#include "libstardict.h"



int main()
{
  Dictionary dict(NULL);
#if 1  
  dict.load("/home/evgeniy/test/sk-dictionary/stardict-en-sk-2005.01.11/dictd_en-sk.ifo");
#else
  dict.load("/usr/share/stardict/dic/dictd_www.dict.org_wn.ifo");
#endif
#if 0
  glong index;
  dict.Lookup("accros", &index);
  printf("%s\n", dict.GetWord(index));
#else
  printf("wordcount=%ld\n", dict.length());
  std::string prev_str=dict.GetWord(0);
  printf("%s\n", dict.GetWord(0));
  for(glong i=1; i<dict.length(); ++i){
	printf("%s\n", dict.GetWord(i));
	if(stardict_strcmp(prev_str.c_str(), dict.GetWord(i))>0)
	  fprintf(stderr, "Error: prev_str=%s, cur_str=%s\n", prev_str.c_str(), dict.GetWord(i));
	prev_str=dict.GetWord(i);
  }
#endif  
  return EXIT_SUCCESS;
}
