| 1 |
/************************************************************************ |
| 2 |
------------------- |
| 3 |
begin : Fri Dec 8 2000 |
| 4 |
copyright : (C) 2000 by Waldemar Baraldi |
| 5 |
email : [email protected] |
| 6 |
***************************************************************************/ |
| 7 |
|
| 8 |
/*************************************************************************** |
| 9 |
* * |
| 10 |
* This program is free software; you can redistribute it and/or modify * |
| 11 |
* it under the terms of the GNU General Public License as published by * |
| 12 |
* the Free Software Foundation; either version 2 of the License, or * |
| 13 |
* (at your option) any later version. * |
| 14 |
* * |
| 15 |
***************************************************************************/ |
| 16 |
|
| 17 |
%{ |
| 18 |
#include "level.h" |
| 19 |
#include "pipe.h" |
| 20 |
#include "elbowupleft.h" |
| 21 |
#include "elbowupright.h" |
| 22 |
#include "elbowdownleft.h" |
| 23 |
#include "elbowdownright.h" |
| 24 |
#include "vertical.h" |
| 25 |
#include "horizontal.h" |
| 26 |
#include "verticalbowl.h" |
| 27 |
#include "horizontalbowl.h" |
| 28 |
#include "cross.h" |
| 29 |
#include "entry.h" |
| 30 |
#include "exit.h" |
| 31 |
|
| 32 |
#define NUMBER 1 |
| 33 |
#define LEVEL 2 |
| 34 |
#define SPEED 3 |
| 35 |
#define GRAPH_DIR 4 |
| 36 |
#define PIPENIGHTDREAMS 5 |
| 37 |
#define ENTRY 6 |
| 38 |
#define EXIT 7 |
| 39 |
#define ROW 8 |
| 40 |
#define COLUMN 9 |
| 41 |
#define SIDE 10 |
| 42 |
#define O_BLOCK 11 |
| 43 |
#define C_BLOCK 12 |
| 44 |
#define DOUBLE_COUTE 13 |
| 45 |
#define EQUAL 15 |
| 46 |
#define SEMICOLON 16 |
| 47 |
#define EOFILE 17 |
| 48 |
#define NORTH 18 |
| 49 |
#define SOUTH 19 |
| 50 |
#define WEST 20 |
| 51 |
#define EAST 21 |
| 52 |
#define STRING 22 |
| 53 |
#define START_DELAY 23 |
| 54 |
#define RESTRICT_COEF 24 |
| 55 |
#define FIXED_COEF 25 |
| 56 |
#define PIPE 26 |
| 57 |
#define REQUIRED 150 |
| 58 |
|
| 59 |
#define TYPE 27 |
| 60 |
// Possible values for TYPE |
| 61 |
#define ELBOW_NW 28 |
| 62 |
#define ELBOW_NE 29 |
| 63 |
#define ELBOW_SW 30 |
| 64 |
#define ELBOW_SE 31 |
| 65 |
#define BOWL_H 32 |
| 66 |
#define BOWL_V 33 |
| 67 |
#define HORIZONTAL 34 |
| 68 |
#define VERTICAL 35 |
| 69 |
#define CROSS 36 |
| 70 |
|
| 71 |
#define RESTRICTED_OUTPUT 37 |
| 72 |
|
| 73 |
#define BONUS 38 |
| 74 |
// Possible values for BONUS |
| 75 |
#define NORMAL 40 |
| 76 |
#define SUPER 41 |
| 77 |
#define ULTRA 42 |
| 78 |
#define HYPER 43 |
| 79 |
#define EXTRA_LIFE 44 |
| 80 |
#define EXTRA_TIME 45 |
| 81 |
|
| 82 |
#define FIXED 46 |
| 83 |
|
| 84 |
#define TRUE 47 |
| 85 |
#define FALSE 48 |
| 86 |
|
| 87 |
#define BACKGROUND 49 |
| 88 |
//Posibles valores para background |
| 89 |
#define WALLPAPER 50 |
| 90 |
#define MOSAIC 51 |
| 91 |
|
| 92 |
|
| 93 |
#define INVALID 100 |
| 94 |
|
| 95 |
int nline; |
| 96 |
%} |
| 97 |
|
| 98 |
%option noyywrap |
| 99 |
%option nounput |
| 100 |
|
| 101 |
DIGIT [0-9] |
| 102 |
SEP [ \t]+ |
| 103 |
|
| 104 |
%% |
| 105 |
|
| 106 |
#.+\n nline++; |
| 107 |
\n nline++; |
| 108 |
{DIGIT}+ return NUMBER; |
| 109 |
level return LEVEL; |
| 110 |
speed return SPEED; |
| 111 |
entry return ENTRY; |
| 112 |
exit return EXIT; |
| 113 |
row return ROW; |
| 114 |
column return COLUMN; |
| 115 |
side return SIDE; |
| 116 |
graph_dir return GRAPH_DIR; |
| 117 |
pipenightdreams return PIPENIGHTDREAMS; |
| 118 |
start_delay return START_DELAY; |
| 119 |
restrict_coef return RESTRICT_COEF; |
| 120 |
fixed_coef return FIXED_COEF; |
| 121 |
= return EQUAL; |
| 122 |
\{ return O_BLOCK; |
| 123 |
\} return C_BLOCK; |
| 124 |
\" return DOUBLE_COUTE; |
| 125 |
; return SEMICOLON; |
| 126 |
<<EOF>> return EOF; |
| 127 |
north return NORTH; |
| 128 |
south return SOUTH; |
| 129 |
west return WEST; |
| 130 |
east return EAST; |
| 131 |
pipe return PIPE; |
| 132 |
type return TYPE; |
| 133 |
elbow_nw return ELBOW_NW; |
| 134 |
elbow_ne return ELBOW_NE; |
| 135 |
elbow_sw return ELBOW_SW; |
| 136 |
elbow_se return ELBOW_SE; |
| 137 |
bowl_h return BOWL_H; |
| 138 |
bowl_v return BOWL_V; |
| 139 |
horizontal return HORIZONTAL; |
| 140 |
vertical return VERTICAL; |
| 141 |
cross return CROSS; |
| 142 |
restricted_output return RESTRICTED_OUTPUT; |
| 143 |
bonus return BONUS; |
| 144 |
normal return NORMAL; |
| 145 |
super return SUPER; |
| 146 |
ultra return ULTRA; |
| 147 |
hyper return HYPER; |
| 148 |
life return EXTRA_LIFE; |
| 149 |
time return EXTRA_TIME; |
| 150 |
fixed return FIXED; |
| 151 |
background return BACKGROUND; |
| 152 |
wallpaper return WALLPAPER; |
| 153 |
mosaic return MOSAIC; |
| 154 |
required return REQUIRED; |
| 155 |
yes return TRUE; |
| 156 |
true return TRUE; |
| 157 |
no return FALSE; |
| 158 |
false return FALSE; |
| 159 |
\".+\" return STRING; |
| 160 |
{SEP} |
| 161 |
. return INVALID; |
| 162 |
%% |
| 163 |
|
| 164 |
Level::Level(){ |
| 165 |
level_number=0; |
| 166 |
error=false; |
| 167 |
entry_ready=false; |
| 168 |
npipes=0; |
| 169 |
start_delay=-1; |
| 170 |
restrict_coef=-1; |
| 171 |
fixed_coef=-1; |
| 172 |
speed=1; |
| 173 |
required=0; |
| 174 |
graph_dirs=NULL; |
| 175 |
background=MosaicBackground; |
| 176 |
} |
| 177 |
|
| 178 |
Level::~Level(){ |
| 179 |
if (graph_dirs){ |
| 180 |
graph_dirs->empty(true); |
| 181 |
delete graph_dirs; |
| 182 |
} |
| 183 |
} |
| 184 |
|
| 185 |
void Level::printError(Str * s){ |
| 186 |
error=true; |
| 187 |
printf("Level error:%i:%s\n", nline, s->get()); |
| 188 |
delete s; |
| 189 |
} |
| 190 |
|
| 191 |
CardinalPoint Level::sideAssignment(){ |
| 192 |
int aux_token; |
| 193 |
|
| 194 |
if (yylex()==EQUAL){ |
| 195 |
aux_token=yylex(); |
| 196 |
token=yylex(); |
| 197 |
switch (aux_token){ |
| 198 |
case NORTH: return North; |
| 199 |
case SOUTH: return South; |
| 200 |
case WEST: return West; |
| 201 |
case EAST: return East; |
| 202 |
default: printError(new Str("Invalid side")); |
| 203 |
} |
| 204 |
}else |
| 205 |
printError(new Str("'=' expected")); |
| 206 |
return Void; |
| 207 |
} |
| 208 |
|
| 209 |
int Level::numberAssignment(){ |
| 210 |
int aux; |
| 211 |
|
| 212 |
if (yylex()==EQUAL) |
| 213 |
if (yylex()==NUMBER){ |
| 214 |
aux=atoi(yytext); |
| 215 |
token=yylex(); |
| 216 |
return aux; |
| 217 |
}else printError(new Str("number expected")); |
| 218 |
else printError(new Str("'=' expected")); |
| 219 |
return 0; |
| 220 |
} |
| 221 |
|
| 222 |
Str * Level::stringAssignment(){ |
| 223 |
Str * s; |
| 224 |
|
| 225 |
if (yylex()==EQUAL) |
| 226 |
if (yylex()==STRING){ |
| 227 |
s=new Str(yytext); |
| 228 |
token=yylex(); |
| 229 |
return s; |
| 230 |
}else printError(new Str("string expected")); |
| 231 |
else printError(new Str("'=' expected")); |
| 232 |
return NULL; |
| 233 |
} |
| 234 |
|
| 235 |
Level::PipeType Level::pipeTypeAssignment(){ |
| 236 |
int aux_token; |
| 237 |
if (yylex()==EQUAL){ |
| 238 |
aux_token=yylex(); |
| 239 |
token=yylex(); |
| 240 |
switch (aux_token){ |
| 241 |
case ELBOW_NW : return ElbowNW; |
| 242 |
case ELBOW_NE : return ElbowNE; |
| 243 |
case ELBOW_SW : return ElbowSW; |
| 244 |
case ELBOW_SE : return ElbowSE; |
| 245 |
case BOWL_H : return BowlH; |
| 246 |
case BOWL_V : return BowlV; |
| 247 |
case VERTICAL : return Vert; |
| 248 |
case HORIZONTAL: return Horiz; |
| 249 |
case CROSS : return CrossPipe; |
| 250 |
default:{ |
| 251 |
printError(new Str("pipe type not valid")); |
| 252 |
} |
| 253 |
} |
| 254 |
}else printError(new Str("'=' expected")); |
| 255 |
return ElbowNW; |
| 256 |
} |
| 257 |
|
| 258 |
Bonus Level::bonusAssignment(){ |
| 259 |
int aux_token; |
| 260 |
if (yylex()==EQUAL){ |
| 261 |
aux_token=yylex(); |
| 262 |
token=yylex(); |
| 263 |
switch (aux_token){ |
| 264 |
case NORMAL : return NormalBonus; |
| 265 |
case SUPER : return SuperBonus; |
| 266 |
case ULTRA : return UltraBonus; |
| 267 |
case HYPER : return HyperBonus; |
| 268 |
case EXTRA_LIFE: return LifeBonus; |
| 269 |
case EXTRA_TIME: return TimeBonus; |
| 270 |
default:{ |
| 271 |
printError(new Str("bonus type not valid")); |
| 272 |
break; |
| 273 |
} |
| 274 |
} |
| 275 |
}else printError(new Str("'=' expected")); |
| 276 |
return NormalBonus; |
| 277 |
} |
| 278 |
|
| 279 |
bool Level::boolAssignment(){ |
| 280 |
bool aux; |
| 281 |
if (yylex()==EQUAL){ |
| 282 |
switch (yylex()){ |
| 283 |
case TRUE : {aux=true;break;} |
| 284 |
case FALSE : {aux=false;break;} |
| 285 |
default:{ |
| 286 |
printError(new Str("not boolean type")); |
| 287 |
break; |
| 288 |
} |
| 289 |
} |
| 290 |
token=yylex(); |
| 291 |
return aux; |
| 292 |
}else printError(new Str("'=' expected")); |
| 293 |
return false; |
| 294 |
} |
| 295 |
|
| 296 |
BackgroundType Level::backgroundAssignment(){ |
| 297 |
int aux_token; |
| 298 |
if (yylex()==EQUAL){ |
| 299 |
aux_token=yylex(); |
| 300 |
token=yylex(); |
| 301 |
switch (aux_token){ |
| 302 |
case WALLPAPER : return WallpaperBackground; |
| 303 |
case MOSAIC : return MosaicBackground; |
| 304 |
default:break; |
| 305 |
} |
| 306 |
}else printError(new Str("'=' expected")); |
| 307 |
return MosaicBackground; |
| 308 |
} |
| 309 |
|
| 310 |
|
| 311 |
Entry * Level::getEntry(int& row, int& column){ |
| 312 |
Entry * entry= new Entry(pipetable[0].restricted_output1); |
| 313 |
row=pipetable[0].row; |
| 314 |
column=pipetable[0].column; |
| 315 |
return entry; |
| 316 |
} |
| 317 |
|
| 318 |
Exit * Level::getExit(int& row, int& column){ |
| 319 |
Exit * exit= new Exit(pipetable[1].restricted_output1); |
| 320 |
row=pipetable[1].row; |
| 321 |
column=pipetable[1].column; |
| 322 |
return exit; |
| 323 |
} |
| 324 |
|
| 325 |
int Level::getFixedCoef(){ |
| 326 |
return fixed_coef; |
| 327 |
} |
| 328 |
|
| 329 |
int Level::getRestrictionCoef(){ |
| 330 |
return restrict_coef; |
| 331 |
} |
| 332 |
|
| 333 |
int Level::getStartDelay(){ |
| 334 |
return start_delay; |
| 335 |
} |
| 336 |
|
| 337 |
int Level::getSpeed(){ |
| 338 |
return speed; |
| 339 |
} |
| 340 |
|
| 341 |
int Level::getRequired(){ |
| 342 |
return required; |
| 343 |
} |
| 344 |
|
| 345 |
BackgroundType Level::getBackgroundType(){ |
| 346 |
return background; |
| 347 |
} |
| 348 |
|
| 349 |
List * Level::getGraphDirs(){ |
| 350 |
List * list=new List(); |
| 351 |
Index * ind=graph_dirs->getFirst(); |
| 352 |
while (!graph_dirs->isEnd(ind)){ |
| 353 |
list->insert(list->getEnd(), new Str((Str*)(graph_dirs->getObject(ind)))); |
| 354 |
ind=graph_dirs->getNext(ind); |
| 355 |
} |
| 356 |
return list; |
| 357 |
} |
| 358 |
|
| 359 |
int Level::getPipeIndex(){ |
| 360 |
return 2; |
| 361 |
} |
| 362 |
|
| 363 |
Pipe * Level::getPipe(int& i, int& row, int& column){ |
| 364 |
Pipe * pipe; |
| 365 |
|
| 366 |
if (i < npipes && i > 1){ |
| 367 |
switch (pipetable[i].type){ |
| 368 |
case ElbowNW:{ |
| 369 |
pipe=new ElbowUpLeft(); |
| 370 |
break; |
| 371 |
} |
| 372 |
case ElbowNE:{ |
| 373 |
pipe=new ElbowUpRight(); |
| 374 |
break; |
| 375 |
} |
| 376 |
case ElbowSW:{ |
| 377 |
pipe=new ElbowDownLeft(); |
| 378 |
break; |
| 379 |
} |
| 380 |
case ElbowSE:{ |
| 381 |
pipe=new ElbowDownRight(); |
| 382 |
break; |
| 383 |
} |
| 384 |
case Vert:{ |
| 385 |
pipe=new Vertical(); |
| 386 |
break; |
| 387 |
} |
| 388 |
case Horiz:{ |
| 389 |
pipe=new Horizontal(); |
| 390 |
break; |
| 391 |
} |
| 392 |
case BowlH:{ |
| 393 |
pipe=new HorizontalBowl(); |
| 394 |
break; |
| 395 |
} |
| 396 |
case BowlV:{ |
| 397 |
pipe=new VerticalBowl(); |
| 398 |
break; |
| 399 |
} |
| 400 |
case CrossPipe:{ |
| 401 |
pipe=new Cross(); |
| 402 |
break; |
| 403 |
} |
| 404 |
} |
| 405 |
pipe->setBonus(pipetable[i].bonus); |
| 406 |
if (pipetable[i].restricted_output1 != Void) |
| 407 |
pipe->restrictAsOutput(pipetable[i].restricted_output1); |
| 408 |
if (pipetable[i].restricted_output2 != Void) |
| 409 |
pipe->restrictAsOutput(pipetable[i].restricted_output2); |
| 410 |
pipe->setFixed(pipetable[i].fixed); |
| 411 |
row=pipetable[i].row; |
| 412 |
column=pipetable[i].column; |
| 413 |
i++; |
| 414 |
return pipe; |
| 415 |
} |
| 416 |
return NULL; |
| 417 |
} |
| 418 |
|
| 419 |
void Level::ee(){ |
| 420 |
int row=0, column=0; |
| 421 |
CardinalPoint con=North; |
| 422 |
int aux_token=token; |
| 423 |
|
| 424 |
if (token==ENTRY || token==EXIT){ |
| 425 |
if (yylex()==O_BLOCK){ |
| 426 |
token=yylex(); |
| 427 |
while (token!=C_BLOCK && !error){ |
| 428 |
switch (token){ |
| 429 |
case ROW:{ |
| 430 |
row=numberAssignment(); |
| 431 |
break; |
| 432 |
} |
| 433 |
case COLUMN:{ |
| 434 |
column=numberAssignment(); |
| 435 |
break; |
| 436 |
} |
| 437 |
case SIDE:{ |
| 438 |
con=sideAssignment(); |
| 439 |
break; |
| 440 |
} |
| 441 |
default:{ |
| 442 |
if (aux_token==ENTRY) |
| 443 |
printError(new Str("invalid word in entry structure")); |
| 444 |
else |
| 445 |
printError(new Str("invalid word in exit structure")); |
| 446 |
} |
| 447 |
} |
| 448 |
} |
| 449 |
if (!error) { |
| 450 |
token=yylex(); |
| 451 |
if (aux_token==ENTRY){ |
| 452 |
pipetable[0].row=row; |
| 453 |
pipetable[0].column=column; |
| 454 |
pipetable[0].restricted_output1=con; |
| 455 |
entry_ready=true; |
| 456 |
}else{ |
| 457 |
pipetable[1].row=row; |
| 458 |
pipetable[1].column=column; |
| 459 |
pipetable[1].restricted_output1=con; |
| 460 |
exit_ready=true; |
| 461 |
} |
| 462 |
} |
| 463 |
}else printError(new Str("'{' expected")); |
| 464 |
}else printError(new Str("'entry' or 'exit' expected")); |
| 465 |
} |
| 466 |
|
| 467 |
void Level::pipe(){ |
| 468 |
|
| 469 |
pipetable[npipes].row=0; |
| 470 |
pipetable[npipes].column=0; |
| 471 |
pipetable[npipes].type=ElbowNW; |
| 472 |
pipetable[npipes].restricted_output1=Void; |
| 473 |
pipetable[npipes].restricted_output2=Void; |
| 474 |
pipetable[npipes].bonus=NormalBonus; |
| 475 |
pipetable[npipes].fixed=false; |
| 476 |
|
| 477 |
if (token==PIPE){ |
| 478 |
if (yylex()==O_BLOCK){ |
| 479 |
token=yylex(); |
| 480 |
while (token!=C_BLOCK && !error){ |
| 481 |
switch (token){ |
| 482 |
case ROW:{ |
| 483 |
pipetable[npipes].row=numberAssignment(); |
| 484 |
break; |
| 485 |
} |
| 486 |
case COLUMN:{ |
| 487 |
pipetable[npipes].column=numberAssignment(); |
| 488 |
break; |
| 489 |
} |
| 490 |
case TYPE:{ |
| 491 |
pipetable[npipes].type=pipeTypeAssignment(); |
| 492 |
break; |
| 493 |
} |
| 494 |
case RESTRICTED_OUTPUT:{ |
| 495 |
if (pipetable[npipes].restricted_output1!=Void){ |
| 496 |
if (pipetable[npipes].restricted_output2!=Void) |
| 497 |
pipetable[npipes].restricted_output1=pipetable[npipes].restricted_output2; |
| 498 |
pipetable[npipes].restricted_output2=sideAssignment(); |
| 499 |
}else pipetable[npipes].restricted_output1=sideAssignment(); |
| 500 |
break; |
| 501 |
} |
| 502 |
case BONUS:{ |
| 503 |
pipetable[npipes].bonus=bonusAssignment(); |
| 504 |
break; |
| 505 |
} |
| 506 |
case FIXED:{ |
| 507 |
pipetable[npipes].fixed=boolAssignment(); |
| 508 |
break; |
| 509 |
} |
| 510 |
default:printError(new Str("invalid word in pipe structure")); |
| 511 |
} |
| 512 |
} |
| 513 |
npipes++; |
| 514 |
token=yylex(); |
| 515 |
}else printError(new Str("'{' expected")); |
| 516 |
}else printError(new Str("'pipe' expected")); |
| 517 |
} |
| 518 |
|
| 519 |
|
| 520 |
void Level::level(){ |
| 521 |
Str * s; |
| 522 |
|
| 523 |
/** Default values for a level*/ |
| 524 |
entry_ready=false; |
| 525 |
exit_ready=false; |
| 526 |
level_number=0; |
| 527 |
error=false; |
| 528 |
npipes=2; |
| 529 |
start_delay=0; |
| 530 |
restrict_coef=0; |
| 531 |
fixed_coef=0; |
| 532 |
speed=1; |
| 533 |
if (graph_dirs) graph_dirs->empty(true); |
| 534 |
else graph_dirs=new List(); |
| 535 |
|
| 536 |
pipetable[0].row=0; |
| 537 |
pipetable[0].column=0; |
| 538 |
pipetable[0].restricted_output1=East; |
| 539 |
|
| 540 |
pipetable[1].row=0; |
| 541 |
pipetable[1].column=1; |
| 542 |
pipetable[1].restricted_output1=West; |
| 543 |
|
| 544 |
if ((token=yylex())==PIPENIGHTDREAMS){ |
| 545 |
if (yylex()==O_BLOCK){ |
| 546 |
token=yylex(); |
| 547 |
while (token!=C_BLOCK && !error){ |
| 548 |
switch (token){ |
| 549 |
case LEVEL:{ |
| 550 |
level_number=numberAssignment(); |
| 551 |
break; |
| 552 |
} |
| 553 |
case SPEED:{ |
| 554 |
speed=numberAssignment(); |
| 555 |
break; |
| 556 |
} |
| 557 |
case GRAPH_DIR:{ |
| 558 |
s=stringAssignment(); |
| 559 |
if (!error){ |
| 560 |
s->crop(1, s->lenght()-1); |
| 561 |
graph_dirs->insert(graph_dirs->getEnd(), s); |
| 562 |
} |
| 563 |
break; |
| 564 |
} |
| 565 |
case START_DELAY:{ |
| 566 |
start_delay=numberAssignment(); |
| 567 |
break; |
| 568 |
} |
| 569 |
case RESTRICT_COEF:{ |
| 570 |
restrict_coef=numberAssignment(); |
| 571 |
break; |
| 572 |
} |
| 573 |
case FIXED_COEF:{ |
| 574 |
fixed_coef=numberAssignment(); |
| 575 |
break; |
| 576 |
} |
| 577 |
case BACKGROUND:{ |
| 578 |
background=backgroundAssignment(); |
| 579 |
break; |
| 580 |
} |
| 581 |
case REQUIRED:{ |
| 582 |
required=numberAssignment(); |
| 583 |
break; |
| 584 |
} |
| 585 |
case ENTRY:case EXIT:{ |
| 586 |
ee(); |
| 587 |
break; |
| 588 |
} |
| 589 |
case PIPE:{ |
| 590 |
pipe(); |
| 591 |
break; |
| 592 |
} |
| 593 |
default:printError(new Str("invalid word in level structure")); |
| 594 |
} |
| 595 |
} |
| 596 |
if (!entry_ready && !error) printError(new Str("no entry available")); |
| 597 |
if (!exit_ready && !error) printError(new Str("no exit available")); |
| 598 |
}else printError(new Str("'{' expected")); |
| 599 |
}else printError(new Str("'pipenightdreams' not found")); |
| 600 |
} |
| 601 |
|
| 602 |
int Level::load(Str * filename){ |
| 603 |
YY_FLUSH_BUFFER; |
| 604 |
nline=1; |
| 605 |
if (!(yyin=fopen(filename->get(), "r"))){ |
| 606 |
delete filename; |
| 607 |
return 1; |
| 608 |
} |
| 609 |
delete filename; |
| 610 |
level(); |
| 611 |
fclose(yyin); |
| 612 |
if (error) return -1; |
| 613 |
return 0; |
| 614 |
} |
| 615 |
|