00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <stdio.h>
00042 #include <string.h>
00043 #include "mensagem.h"
00044 #include "memvirtu.h"
00045 #include "lowparam.h"
00046 #include "lowsolid.h"
00047 #include "eulerops.h"
00048 #include "mancommd.h"
00049
00050 typedef struct eulercod EuCode;
00051
00052 struct eulercod
00053 {
00054 OpCode ecode;
00055 char *eop;
00056 int (*xeop)(EulerOp *op);
00057 void (*peop)(FILE *f, EulerOp *op);
00058 int (*reop)(FILE *f, EulerOp *op);
00059 int (*meop)(EulerOp *op);
00060 int num;
00061 };
00062
00063 extern EuCode ematrix[];
00064
00065
00066 void MSD_highPrintAllOps(void)
00067 {
00068 PEulerOp op;
00069 FILE *fp;
00070
00071 fp = fopen("undolog.txt", "w");
00072 for (op = OpHead; op != EuNIL; EulerOpNext(op))
00073 {
00074 #ifndef __VIRTUAL_MEM
00075 MSD_lowPrintEulerOp(fp, op);
00076 #else
00077 MSD_lowPrintEulerOp(fp, EULEROPS(op));
00078 #endif
00079 }
00080 fclose(fp);
00081 }
00082
00083
00084 void MSD_lowPrintEulerOp(FILE *f, EulerOp *op)
00085 {
00086 EuCode *p;
00087
00088 for (p = ematrix; *p->eop; ++p)
00089 {
00090 if (p->ecode == op->opcode)
00091 {
00092 break;
00093 }
00094 }
00095 (*p->peop)(f, op);
00096 }
00097
00098 void MSD_printStructError(FILE *f, EulerOp *op)
00099 {
00100 MSD_lowNaoUtilizado(f);
00101 MSD_lowNaoUtilizado(op);
00102
00103 fprintf(stderr, MEN_ParametrosIncorretos, NAM_PrintEulerOp);
00104 }
00105
00106
00107 void MSD_highPrintAllRedoOps(void)
00108 {
00109 PEulerOp op;
00110 FILE *fp;
00111
00112 fp = fopen("redolog.txt", "w");
00113 for (op = OpHeadRedo; op != EuNIL; EulerOpNextRedo(op))
00114 {
00115 #ifndef __VIRTUAL_MEM
00116 MSD_lowPrintEulerOp(fp, op);
00117 #else
00118 MSD_lowPrintEulerOp(fp, EULEROPSREDO(op));
00119 #endif
00120 }
00121 fclose(fp);
00122 }