MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FsReadWriteReq.cpp
1 /*
2  Copyright (C) 2003-2006 MySQL AB
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 
20 
21 #include <signaldata/FsReadWriteReq.hpp>
22 
23 bool
24 printFSREADWRITEREQ(FILE * output, const Uint32 * theData,
25  Uint32 len, Uint16 receiverBlockNo){
26 
27  bool ret = true;
28 
29  const FsReadWriteReq * const sig = (FsReadWriteReq *) theData;
30 
31  fprintf(output, " UserPointer: %d\n", sig->userPointer);
32  fprintf(output, " FilePointer: %d\n", sig->filePointer);
33  fprintf(output, " UserReference: H\'%.8x", sig->userReference);
34 
35  fprintf(output, " Operation flag: H\'%.8x (", sig->operationFlag);
36  if (sig->getSyncFlag(sig->operationFlag))
37  fprintf(output, "Sync,");
38  else
39  fprintf(output, "No sync,");
40 
41  fprintf(output, " Format=");
42  switch(sig->getFormatFlag(sig->operationFlag)){
43  case FsReadWriteReq::fsFormatListOfPairs:
44  fprintf(output, "List of pairs)\n");
45  break;
46  case FsReadWriteReq::fsFormatArrayOfPages:
47  fprintf(output, "Array of pages)\n");
48  break;
49  case FsReadWriteReq::fsFormatListOfMemPages:
50  fprintf(output, "List of mem pages)\n");
51  break;
52  case FsReadWriteReq::fsFormatGlobalPage:
53  fprintf(output, "List of global pages)\n");
54  case FsReadWriteReq::fsFormatSharedPage:
55  fprintf(output, "List of shared pages)\n");
56  break;
57  default:
58  fprintf(output, "fsFormatMax not handled\n");
59  ret = false;
60  break;
61  }
62 
63  fprintf(output, " varIndex: %d\n",
64  sig->varIndex);
65  fprintf(output, " numberOfPages: %d\n",
66  sig->numberOfPages);
67  fprintf(output, " pageData: ");
68 
69  unsigned int i;
70  switch(sig->getFormatFlag(sig->operationFlag)){
71  case FsReadWriteReq::fsFormatListOfPairs:
72  for (i= 0; i < sig->numberOfPages*2; i += 2){
73  fprintf(output, " H\'%.8x, H\'%.8x\n", sig->data.pageData[i],
74  sig->data.pageData[i + 1]);
75  }
76  break;
77  case FsReadWriteReq::fsFormatArrayOfPages:
78  fprintf(output, " H\'%.8x, H\'%.8x\n", sig->data.pageData[0],
79  sig->data.pageData[1]);
80  break;
81  case FsReadWriteReq::fsFormatListOfMemPages:
82  for (i= 0; i < (sig->numberOfPages + 1); i++){
83  fprintf(output, " H\'%.8x, ", sig->data.pageData[i]);
84  }
85  break;
86  case FsReadWriteReq::fsFormatGlobalPage:
87  for (i= 0; i < sig->numberOfPages; i++){
88  fprintf(output, " H\'%.8x, ", sig->data.pageData[i]);
89  }
90  break;
91  default:
92  fprintf(output, "Impossible event\n");
93  }
94 
95  fprintf(output, "\n");
96  return ret;
97 }