00001 /* This file is part of LingoTeach, the Language Teaching program 00002 * Copyright (C) 2001-2003 The LingoTeach Team 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef LINGDEFS_H 00020 #define LINGDEFS_H 1 00021 00022 #include <libxml/xpath.h> 00023 00024 #ifndef FALSE 00025 #define FALSE (0) 00026 #endif 00027 00028 #ifndef TRUE 00029 #define TRUE (!FALSE) 00030 #endif 00031 00032 /** 00033 * \typedef lingbool 00034 * 00035 * This is a special defined boolean value - 00036 * can return TRUE and FALSE (and should only be used with those both types!) 00037 */ 00038 typedef int lingbool; 00039 00040 /** 00041 * \typedef lingchar 00042 * 00043 * This is a unsigned char to hold UTF-8 encoded characters. 00044 */ 00045 typedef unsigned char lingchar; 00046 00047 /** 00048 * \struct lingConfig 00049 * 00050 * A structure for configuration settings 00051 */ 00052 typedef struct 00053 { 00054 lingchar *appname; /**< The name of the application */ 00055 char *langfile; /**< The file with the languages */ 00056 } lingConfig; 00057 00058 /** 00059 * \struct lingLesson 00060 * 00061 * A public lesson list structure 00062 */ 00063 typedef struct _lingLesson lingLesson; 00064 struct _lingLesson 00065 { 00066 void *pdata; /**< Private data, which should not be modified! */ 00067 lingchar *type; /**< The type of the lesson */ 00068 lingLesson *next; /**< Pointer to the next lesson */ 00069 }; 00070 00071 /** 00072 * \struct lingMeaning 00073 * 00074 * The structure of a meaning 00075 */ 00076 typedef struct _lingMeaning lingMeaning; 00077 struct _lingMeaning 00078 { 00079 int id; /**< ID of the Meaning (123) */ 00080 lingchar *type; /**< Type of the meaning (object, question, etc.) */ 00081 lingchar *language; /**< Translation language (e.g "spanish") */ 00082 lingchar *translation; /**< The translation text (e.g. "food") */ 00083 lingchar *description; /**< The description of the meaning */ 00084 lingLesson *lesson; /**< The lesson the translation was taken from */ 00085 lingMeaning *next; /**< The next meaning in the list */ 00086 lingMeaning *prev; /**< The previous meaning in the list */ 00087 }; 00088 00089 /** 00090 * \enum Method 00091 * 00092 * A list of different word choosing methods. 00093 */ 00094 typedef enum 00095 { 00096 RANDOM, /**< Random choosing from 0 to max. possible id */ 00097 SEQUENCE, /**< One after each other */ 00098 REVIEW, /**< Selects words, which are not well known by the user */ 00099 LEARN /**< A learn method - for saving statistics */ 00100 } Method; 00101 00102 00103 #endif /* LINGDEFS_H */