LimitPlanNode::~LimitPlanNode() { delete limitExpression; if (!isInline()) { delete getOutputTable(); setOutputTable(NULL); } }
static int brl_construct (BrailleDisplay *brl, char **parameters, const char *device) { { static const unsigned int baudTable[] = {9600, 19200, 0}; const char *baudParameter = parameters[PARM_BAUD]; if (!*baudParameter || !serialValidateBaud(&serialBaud, "baud", baudParameter, baudTable)) serialBaud = baudTable[0]; } if (!isSerialDeviceIdentifier(&device)) { unsupportedDeviceIdentifier(device); return 0; } if ((serialDevice = serialOpenDevice(device))) { if (serialRestartDevice(serialDevice, serialBaud)) { charactersPerSecond = serialBaud / 10; writeFunction = NULL; { static const TranslationTable outputTable = { #define MAP(byte,cell) [cell] = byte #include "brl-out.h" #undef MAP }; setOutputTable(outputTable); } { static const int initialCommands[] = { BRL_CMD_TUNES | BRL_FLG_TOGGLE_OFF, BRL_CMD_CSRTRK | BRL_FLG_TOGGLE_OFF, BRL_CMD_CSRVIS | BRL_FLG_TOGGLE_OFF, BRL_CMD_ATTRVIS | BRL_FLG_TOGGLE_OFF, EOF }; initialCommand = initialCommands; } brl->textColumns = 80; return 1; } serialCloseDevice(serialDevice); serialDevice = NULL; } return 0; }
static int brl_construct (BrailleDisplay *brl, char **parameters, const char *device) { { static TranslationTable outputTable = { #include "brl-out.h" }; setOutputTable(outputTable); makeInputTable(); { const unsigned char byte = 0XFF; if (memchr(outputTable, byte, sizeof(outputTable))) { outputTable[translateInputCell(byte)] = SUB; } } } if (!isSerialDeviceIdentifier(&device)) { unsupportedDeviceIdentifier(device); return 0; } makeDownloadFifo(); if ((serialDevice = serialOpenDevice(device))) { if (serialRestartDevice(serialDevice, 9600)) { brl->textRows = screenHeight; brl->textColumns = screenWidth; brl->buffer = &sourceImage[0][0]; memset(sourceImage, 0, sizeof(sourceImage)); deviceStatus = DEV_ONLINE; return 1; } serialCloseDevice(serialDevice); serialDevice = NULL; } return 0; }
MaterializePlanNode::~MaterializePlanNode() { delete getOutputTable(); setOutputTable(NULL); }
/* the braille display can be resized without reloading the driver */ static int brl_construct(BrailleDisplay *brl, char **parameters, const char *device) { #ifdef SendIdReq unsigned char ch = '?'; int i; #endif /* SendIdReq */ int ds = BRAILLEDISPLAYSIZE; int promVersion = 4; unsigned int ttyBaud = 57600; if (*parameters[PARM_DISPSIZE]) { int dsmin=20, dsmax=40; if (!validateInteger(&ds, parameters[PARM_DISPSIZE], &dsmin, &dsmax)) logMessage(LOG_WARNING, "%s: %s", "invalid braille display size", parameters[PARM_DISPSIZE]); } if (*parameters[PARM_PROMVER]) { int pvmin=3, pvmax=6; if (!validateInteger(&promVersion, parameters[PARM_PROMVER], &pvmin, &pvmax)) logMessage(LOG_WARNING, "%s: %s", "invalid PROM version", parameters[PARM_PROMVER]); } if (*parameters[PARM_BAUD]) { unsigned int baud; if (serialValidateBaud(&baud, "TTY baud", parameters[PARM_BAUD], NULL)) { ttyBaud = baud; } } if (!isSerialDeviceIdentifier(&device)) { unsupportedDeviceIdentifier(device); return 0; } if (!(serialDevice = serialOpenDevice(device))) return 0; serialSetParity(serialDevice, SERIAL_PARITY_ODD); if (promVersion<4) serialSetFlowControl(serialDevice, SERIAL_FLOW_INPUT_CTS); serialRestartDevice(serialDevice,ttyBaud); #ifdef SendIdReq { brl_writePacket(brl,(unsigned char *) &ch,1); i=5; while (i>0) { if (brl_readPacket(brl,(unsigned char *) &terminfo,sizeof(terminfo))!=0) { if (terminfo.code=='?') { terminfo.f2[10] = '\0'; break; } } i--; } if (i==0) { logMessage(LOG_WARNING,"Unable to identify terminal properly"); if (!brl->textColumns) brl->textColumns = BRAILLEDISPLAYSIZE; } else { logMessage(LOG_INFO,"Braille terminal description:"); logMessage(LOG_INFO," version=%c%c%c",terminfo.version[0],terminfo.version[1],terminfo.version[2]); logMessage(LOG_INFO," f1=%c",terminfo.f1); logMessage(LOG_INFO," size=%c%c",terminfo.size[0],terminfo.size[1]); logMessage(LOG_INFO," dongle=%c",terminfo.dongle); logMessage(LOG_INFO," clock=%c",terminfo.clock); logMessage(LOG_INFO," routing=%c",terminfo.routing); logMessage(LOG_INFO," flash=%c",terminfo.flash); logMessage(LOG_INFO," prog=%c",terminfo.prog); logMessage(LOG_INFO," lcd=%c",terminfo.lcd); logMessage(LOG_INFO," f2=%s",terminfo.f2); if (brl->textColumns<=0) brl->textColumns = (terminfo.size[0]-'0')*10 + (terminfo.size[1]-'0'); } } #else /* SendIdReq */ brl->textColumns = ds; #endif /* SendIdReq */ brl->textRows=1; { /* The following table defines how internal brltty format is converted to */ /* VisioBraille format. */ /* The table is declared static so that it is in data segment and not */ /* in the stack */ static const TranslationTable outputTable = { #include "brl-out.h" }; setOutputTable(outputTable); } return 1; }
UnionPlanNode::~UnionPlanNode() { delete getOutputTable(); setOutputTable(NULL); }
/* * If the output table needs to be cleared then this SeqScanNode is for an executor that created * its own output table rather then forwarding a reference to the persistent table being scanned. * It still isn't necessarily safe to delete the output table since an inline projection node/executor * may have created the table so check if there is an inline projection node. * * This is a fragile approach to determining whether or not to delete the output table. Maybe * it is safer to have the inline nodes be deleted first and set the output table of the * enclosing plannode to NULL so the delete can be safely repeated. */ SeqScanPlanNode::~SeqScanPlanNode() { if (needsOutputTableClear() && getInlinePlanNode(PLAN_NODE_TYPE_PROJECTION) == NULL) { delete getOutputTable(); setOutputTable(NULL); } }