00001 /* 00002 * This file is part of liberdm. 00003 * 00004 * liberdm 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 * liberdm 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, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00023 #ifndef ERDM_INTERNAL_H 00024 #define ERDM_INTERNAL_H 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif /* __cplusplus */ 00029 00030 #include "erdm.h" 00031 00032 #define DMPORT 50555 00033 00034 #define DM_MAXCHARONLINE 1024 00035 #define DM_CMD_NAME 128 00036 #define DM_ARGLENGTH 256 00037 #define DM_N_ARG 6 00038 00039 // Define a struct for each PML command 00040 // Assemble all PML commands in one union. 00041 typedef struct 00042 { 00043 eDmCommandCode cmd; 00044 eDmCmdPriority priority; 00045 int par0; 00046 int par1; 00047 int par2; 00048 } sDmCommandGeneric; 00049 00050 typedef struct 00051 { 00052 eDmCommandCode cmd; 00053 eDmCmdPriority priority; 00054 eDmQuality qual; 00055 } sDmCommandDisplay; 00056 00057 typedef struct 00058 { 00059 eDmCommandCode cmd; 00060 eDmCmdPriority priority; 00061 eDmQuality qual; 00062 int xUp; 00063 int yUp; 00064 int xDown; 00065 int yDown; 00066 } sDmCommandDisplayPartial; 00067 00068 typedef struct 00069 { 00070 eDmCommandCode cmd; 00071 eDmCmdPriority priority; 00072 char *szFilename; 00073 int nFilenam; 00074 } sDmCommandDump; 00075 00076 typedef union 00077 { 00078 sDmCommandGeneric dmCmdGeneric; 00079 sDmCommandDisplay dmCmdDisplay; 00080 sDmCommandDisplayPartial dmCmdDisplayPartial; 00081 sDmCommandDump dmCmdDump; 00082 } uDmCommand; 00083 00084 typedef struct 00085 { 00086 char name[DM_CMD_NAME]; // Command Name 00087 int cc; // Command Code 00088 char arg[DM_N_ARG][DM_ARGLENGTH]; 00089 int nArg; 00090 } erDmCmd_t; 00091 00092 void erDmGetArgs(char *pChar, erDmCmd_t * pCmd, int nReqArgs); 00093 00094 00095 #ifdef __cplusplus 00096 } 00097 #endif /* __cplusplus */ 00098 00099 #endif