mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / storage / ndb / src / common / debugger / signaldata / FsReadWriteReq.cpp
blob682e0675b0b1cecfd9c41ba2ce07811ae6aebe32
1 /* Copyright (c) 2003-2006 MySQL AB
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
18 #include <signaldata/FsReadWriteReq.hpp>
20 bool
21 printFSREADWRITEREQ(FILE * output, const Uint32 * theData,
22 Uint32 len, Uint16 receiverBlockNo){
24 bool ret = true;
26 const FsReadWriteReq * const sig = (FsReadWriteReq *) theData;
28 fprintf(output, " UserPointer: %d\n", sig->userPointer);
29 fprintf(output, " FilePointer: %d\n", sig->filePointer);
30 fprintf(output, " UserReference: H\'%.8x", sig->userReference);
32 fprintf(output, " Operation flag: H\'%.8x (", sig->operationFlag);
33 if (sig->getSyncFlag(sig->operationFlag))
34 fprintf(output, "Sync,");
35 else
36 fprintf(output, "No sync,");
38 fprintf(output, " Format=");
39 switch(sig->getFormatFlag(sig->operationFlag)){
40 case FsReadWriteReq::fsFormatListOfPairs:
41 fprintf(output, "List of pairs)\n");
42 break;
43 case FsReadWriteReq::fsFormatArrayOfPages:
44 fprintf(output, "Array of pages)\n");
45 break;
46 case FsReadWriteReq::fsFormatListOfMemPages:
47 fprintf(output, "List of mem pages)\n");
48 break;
49 case FsReadWriteReq::fsFormatGlobalPage:
50 fprintf(output, "List of global pages)\n");
51 case FsReadWriteReq::fsFormatSharedPage:
52 fprintf(output, "List of shared pages)\n");
53 break;
54 default:
55 fprintf(output, "fsFormatMax not handled\n");
56 ret = false;
57 break;
60 fprintf(output, " varIndex: %d\n",
61 sig->varIndex);
62 fprintf(output, " numberOfPages: %d\n",
63 sig->numberOfPages);
64 fprintf(output, " pageData: ");
66 unsigned int i;
67 switch(sig->getFormatFlag(sig->operationFlag)){
68 case FsReadWriteReq::fsFormatListOfPairs:
69 for (i= 0; i < sig->numberOfPages*2; i += 2){
70 fprintf(output, " H\'%.8x, H\'%.8x\n", sig->data.pageData[i],
71 sig->data.pageData[i + 1]);
73 break;
74 case FsReadWriteReq::fsFormatArrayOfPages:
75 fprintf(output, " H\'%.8x, H\'%.8x\n", sig->data.pageData[0],
76 sig->data.pageData[1]);
77 break;
78 case FsReadWriteReq::fsFormatListOfMemPages:
79 for (i= 0; i < (sig->numberOfPages + 1); i++){
80 fprintf(output, " H\'%.8x, ", sig->data.pageData[i]);
82 break;
83 case FsReadWriteReq::fsFormatGlobalPage:
84 for (i= 0; i < sig->numberOfPages; i++){
85 fprintf(output, " H\'%.8x, ", sig->data.pageData[i]);
87 break;
88 default:
89 fprintf(output, "Impossible event\n");
92 fprintf(output, "\n");
93 return ret;