//コンストラクタ(読み込み) XFrame::XFrame(XModel *model) { index = model->Frame.size(); //フレーム番号を格納 model->Frame.push_back(this); //フレームをベクターに追加 //行列の初期化 MatrixIdentity(TransformMatrix); MatrixIdentity(OffsetMatrix); //フレーム名の取得 GetToken(); name = new char[strlen(Token)+1]; strcpy(name, Token); //フレームからうまく抜けるため、現在のノード記憶 int node = Node; //次のトークンが"{"であると確認する GetToken("{"); //変換行列と子フレーム読み込み while (*Pointer!='\0') { GetToken(); //ノードが終わったらループを抜ける if ( node == Node ) break; //フレームの場合、子フレームを作成 if ( CheckToken("Frame") ) { child.push_back(new XFrame(model)); } // 変換行列を読み込む else if ( CheckToken("FrameTransformMatrix") ) { GetToken("{"); for(int g=0; g<4; g++) for(int r=0; r<4; r++) TransformMatrix[g][r]=GetFloatToken(); GetToken("}"); } // 子フレームと変換行列以外の時 else { //要素を識別して読み込み if( !model->Load_element() ) model->loaded |= 1; //エラー検出 } } }
bool CScript::GetScript(Ui::CEdit* edit) { int len; delete[] m_script; m_script = nullptr; len = edit->GetTextLength(); m_script = new char[len+1]; edit->GetText(m_script, len+1); edit->GetCursor(m_cursor2, m_cursor1); m_len = strlen(m_script); if ( !CheckToken() ) { edit->SetCursor(m_cursor2, m_cursor1); edit->ShowSelect(); edit->SetFocus(true); return false; } if ( !Compile() ) { edit->SetCursor(m_cursor2, m_cursor1); edit->ShowSelect(); edit->SetFocus(true); return false; } return true; }
int CNetTokenManager::ProcessMessage(const NETADDR *pAddr, const CNetPacketConstruct *pPacket, bool Notify) { if(pPacket->m_Token != NET_TOKEN_NONE && !CheckToken(pAddr, pPacket->m_Token, pPacket->m_ResponseToken, Notify)) return 0; // wrong token, silent ignore bool Verified = pPacket->m_Token != NET_TOKEN_NONE; bool TokenMessage = (pPacket->m_Flags & NET_PACKETFLAG_CONTROL) && pPacket->m_aChunkData[0] == NET_CTRLMSG_TOKEN; if(pPacket->m_Flags&NET_PACKETFLAG_CONNLESS) return (Verified) ? 1 : 0; // connless packets without token are not allowed if(!TokenMessage) { if(Verified) return 1; // verified packet else // the only allowed not connless packet // without token is NET_CTRLMSG_TOKEN return 0; } if(Verified && TokenMessage) return 1; // everything is fine, token exchange complete // client requesting token CNetBase::SendControlMsgWithToken(m_Socket, (NETADDR *)pAddr, pPacket->m_ResponseToken, 0, NET_CTRLMSG_TOKEN, GenerateToken(pAddr)); return 0; // no need to process NET_CTRLMSG_TOKEN further }
void ApnsService::send(PushNotification* notice) { if (stopped_) { gNoticePool.Put(notice); return; } // 检测token if (!CheckToken(notice->Token())) { notice->Clear(); gNoticePool.Put(notice); return; } //寻找一个有效的连接,发送 ApnsConnection* conn = GetVaildConn(); if (conn != NULL) { conn->SendNotification(notice); } else { gNoticePool.Put(notice); LOGFMTE("%s :no valid apnsconn error", apns_params_.Name.c_str()); } }
bool FScanner::CheckBoolToken() { if (CheckToken(TK_True)) { Number = 1; Float = 1; return true; } if (CheckToken(TK_False)) { Number = 0; Float = 0; return true; } return false; }
void SeparatorKeyword::OnMessageEnd( MessageEndEvent &event ) { for (int i = 0; i < 256; i++) { if (!m_hasCmpSuccessed[i] || !m_hasCmpFailed[i]) continue; CheckToken(i); } Reset(); }
void Gate::OnRecvLoginReq(IKernel * kernel, const s64 id, const OBuffer& buf) { const char * token = nullptr; if (!buf.Read(token)) return; OASSERT(_players.find(id) != _players.end(), "where is agent???"); Player& player = _players[id]; if (player.state == ST_NONE) { TokenData data; if (strlen(token) > MAX_TOKEN_SIZE || !CheckToken(token, data, true)) { olib::Buffer<128> buf; buf << _errorInvalidToken; SendToClient(kernel, player.agentId, _loginAckId, buf.Out()); return; } s64 lastActorId = 0; s64 bantime = 0; bool writeOk = true; bool readOk = _cacheDB->Read("account", data.accountID, [&data, &lastActorId, &bantime, &writeOk, this](IKernel * kernel, ICacheDBReadResult * result) { if (result->Count() > 0) { lastActorId = result->GetDataInt64(0, 1); bantime = result->GetDataInt64(0, 2); } else { ICacheDBContext * writer = _cacheDB->PrepareWrite("account", data.accountID); writer->WriteInt64("id", data.accountID); writer->WriteInt64("platform", data.platform); writer->WriteInt64("lastActor", 0); writer->WriteInt64("bantime", 0); writeOk = writer->Update(); } }, "lastActor", "bantime"); if (readOk && writeOk) { player.accountId = data.accountID; player.lastActorId = lastActorId; player.state = ST_AUTHENING; IArgs<3, 128> args; args << player.agentId << player.accountId << 0; args.Fix(); _harbor->Send(user_node_type::ACCOUNT, 1, framework_proto::BIND_ACCOUNT_REQ, args.Out()); } else { olib::Buffer<128> buf; buf << _errorReadAccountFailed; SendToClient(kernel, player.agentId, _loginAckId, buf.Out()); } } }
NS_IMETHODIMP nsDOMTokenList::Add(const nsAString& aToken) { nsresult rv = CheckToken(aToken); NS_ENSURE_SUCCESS(rv, rv); const nsAttrValue* attr = GetParsedAttr(); if (attr && attr->Contains(aToken)) { return NS_OK; } AddInternal(attr, aToken); return NS_OK; }
NS_IMETHODIMP nsDOMTokenList::Contains(const nsAString& aToken, bool* aResult) { nsresult rv = CheckToken(aToken); NS_ENSURE_SUCCESS(rv, rv); const nsAttrValue* attr = GetParsedAttr(); if (!attr) { *aResult = false; return NS_OK; } *aResult = attr->Contains(aToken); return NS_OK; }
// Parse the tacref database file void DoParse() { char Prsdone; Prsdone = 0; while ( !Prsdone ) { trdata = GetALine( trdata,backn ); toktype = CheckToken( trdata ); if ( toktype != -1 ) { (tokfunc[toktype])(); } trdata = nextdata; if ( trdata >= endingdata ) { Prsdone = 1; } } }
CString XMLRestriction::CheckNMTOKEN(CString p_value) { CString result = CheckToken(p_value); if(result.IsEmpty()) { for(int ind = 0;ind < p_value.GetLength(); ++ind) { unsigned char ch = p_value.GetAt(ind); if(!isalnum(ch) && ch != ':' && ch != '-' && ch != '.' && ch != '_' && ch < 128) { result = "NMTOKEN with illegal characters: " + p_value; } } } return result; }
NS_IMETHODIMP nsDOMTokenList::Toggle(const nsAString& aToken, bool* aResult) { nsresult rv = CheckToken(aToken); NS_ENSURE_SUCCESS(rv, rv); const nsAttrValue* attr = GetParsedAttr(); if (attr && attr->Contains(aToken)) { RemoveInternal(attr, aToken); *aResult = false; } else { AddInternal(attr, aToken); *aResult = true; } return NS_OK; }
virtual EModRet OnLoginAttempt(CSmartPtr<CAuthBase> Auth) { CString const sPassword = Auth->GetPassword(); CUser *pUser = CZNC::Get().FindUser(Auth->GetUsername()); if (pUser && CheckToken(pUser, sPassword.Left(DEFAULT_TOKEN_ID_LEN))) { DEBUG("yubikey: Lookup for " << sPassword.Left(DEFAULT_TOKEN_ID_LEN)); // The following call is blocking. //int result = ykclient_verify_otp(sPassword.c_str(), CLIENT_ID, NULL); int result = ykclient_verify_otp_v2(NULL, sPassword.c_str(), CLIENT_ID, NULL, 0, NULL, NULL); DEBUG("yubikey: " << ykclient_strerror(result)); if (result == YKCLIENT_OK) { Auth->AcceptLogin(*pUser); } else { Auth->RefuseLogin(ykclient_strerror(result)); } return HALT; } return CONTINUE; }
int main(int argc, char *argv[]) { XSetWindowAttributes attr; Colormap cmap; Pixmap bitmap; Cursor cursor; XColor bg = { 0 }; XColor fg = { 0 }; char data[8] = { 0x01 }; char *display; const char *ext; int mask, major, minor, verbose = 0; int opt; while ((opt = getopt(argc, argv, "v")) != -1) { switch(opt) { case 'v': verbose = 1; break; default: fprintf(stderr, "%d (%c) is unknown to me\n", opt, opt); break; } } if ((argc - optind) != 1) { fprintf(stderr, "usage: %s <mac wolf3d resource fork>\n", argv[0]); exit(EXIT_FAILURE); } if (InitResources(argv[optind])) { fprintf(stderr, "could not load %s\n", argv[optind]); exit(EXIT_FAILURE); } display = getenv("DISPLAY"); dpy = XOpenDisplay(getenv(display)); if (dpy == NULL) { fprintf(stderr, "Unable to open display %s\n", XDisplayName(display)); exit(EXIT_FAILURE); } screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); if (glXQueryExtension(dpy, NULL, NULL) == False) { fprintf(stderr, "Display %s does not support the GLX Extension\n", XDisplayName(display)); exit(EXIT_FAILURE); } if (glXQueryVersion(dpy, &major, &minor) == False) { fprintf(stderr, "glXQueryVersion returned False?\n"); exit(EXIT_FAILURE); } else if (verbose) { printf("GLX Version %d.%d\n", major, minor); printf("GLX Client:\n"); printf("GLX_VENDOR: %s\n", glXGetClientString(dpy, GLX_VENDOR)); printf("GLX_VERSION: %s\n", glXGetClientString(dpy, GLX_VERSION)); printf("GLX_EXTENSIONS: %s\n", glXGetClientString(dpy, GLX_EXTENSIONS)); printf("GLX Server:\n"); printf("GLX_VENDOR: %s\n", glXQueryServerString(dpy, screen, GLX_VENDOR)); printf("GLX_VERSION: %s\n", glXQueryServerString(dpy, screen, GLX_VERSION)); printf("GLX_EXTENSIONS: %s\n", glXQueryServerString(dpy, screen, GLX_EXTENSIONS)); printf("Both:\n"); printf("GLX_EXTENSIONS: %s\n", glXQueryExtensionsString(dpy, screen)); } vi = glXChooseVisual(dpy, screen, attrib); if (vi == NULL) { fprintf(stderr, "No usable GL visual found on %s:%d\n", XDisplayName(display), screen); exit(EXIT_FAILURE); } ctx = glXCreateContext(dpy, vi, NULL, True); if (ctx == NULL) { fprintf(stderr, "GLX context creation failed\n"); exit(EXIT_FAILURE); } cmap = XCreateColormap(dpy, root, vi->visual, AllocNone); attr.colormap = cmap; attr.event_mask = KeyPressMask | KeyReleaseMask | ExposureMask | StructureNotifyMask; mask = CWColormap | CWEventMask; win = XCreateWindow(dpy, root, 0, 0, 640, 480, 0, CopyFromParent, InputOutput, vi->visual, mask, &attr); if (win == None) { fprintf(stderr, "Unable to create window\n"); exit(EXIT_FAILURE); } XSetWMProperties(dpy, win, NULL, NULL, argv, argc, None, None, None); XStoreName(dpy, win, "Wolfenstein 3D"); XSetIconName(dpy, win, "Wolfenstein 3D"); wmDeleteWindow = XInternAtom(dpy, "WM_DELETE_WINDOW", False); XSetWMProtocols(dpy, win, &wmDeleteWindow, 1); bitmap = XCreateBitmapFromData(dpy, win, data, 8, 8); cursor = XCreatePixmapCursor(dpy, bitmap, bitmap, &fg, &bg, 0, 0); XDefineCursor(dpy, win, cursor); glXMakeCurrent(dpy, win, ctx); if (verbose) { printf("GL Library:\n"); printf("GL_VENDOR: %s\n", glGetString(GL_VENDOR)); printf("GL_RENDERER: %s\n", glGetString(GL_RENDERER)); printf("GL_VERSION: %s\n", glGetString(GL_VERSION)); printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS)); } XMapWindow(dpy, win); XFlush(dpy); ext = (const char *)glGetString(GL_EXTENSIONS); #ifdef GL_EXT_shared_texture_palette UseSharedTexturePalette = 0; if (CheckToken(ext, "GL_EXT_shared_texture_palette")) { pglColorTableEXT = glXGetProcAddressARB((unsigned const char *)"glColorTableEXT"); if (pglColorTableEXT) { UseSharedTexturePalette = 0; printf("GL_EXT_shared_texture_palette found...\n"); } } #endif glShadeModel(GL_FLAT); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); InitData(); SlowDown = 1; GameViewSize = 3; NewGameWindow(GameViewSize); ClearTheScreen(BLACK); BlastScreen(); /* NoEnemies = 1; */ return WolfMain(argc, argv); }
int main(int numargs, char** args) { ion::Queue<std::string, sMaxTokens> tokens; for(int i = 1; i < numargs; i++) { tokens.Push(std::string(args[i])); } if(CheckToken(tokens, "Missing resource type")) { std::locale locale; std::string resourceType = tokens.Pop(); std::transform(resourceType.begin(), resourceType.end(), resourceType.begin(), ::tolower); if(!std::strcmp(resourceType.c_str(), "texture")) { if(CheckToken(tokens, "Missing texture name")) { const std::string& name = tokens.Pop(); if(CheckToken(tokens, "Missing texture filename")) { const std::string& textureFile = tokens.Pop(); ion::build::BuildTexture(name, textureFile); } } } else if(!std::strcmp(resourceType.c_str(), "vshader")) { if(CheckToken(tokens, "Missing vertex shader name")) { const std::string& name = tokens.Pop(); if(CheckToken(tokens, "Missing vertex shader binary")) { const std::string& shaderBinaryFile = tokens.Pop(); if(CheckToken(tokens, "Missing vertex shader entry point")) { const std::string& entrypoint = tokens.Pop(); ion::build::BuildShader(name, shaderBinaryFile, entrypoint, ion::render::Shader::eVertex); } } } } else if (!std::strcmp(resourceType.c_str(), "pshader")) { if (CheckToken(tokens, "Missing vertex shader name")) { const std::string& name = tokens.Pop(); if (CheckToken(tokens, "Missing vertex shader binary")) { const std::string& shaderBinaryFile = tokens.Pop(); if (CheckToken(tokens, "Missing vertex shader entry point")) { const std::string& entrypoint = tokens.Pop(); ion::build::BuildShader(name, shaderBinaryFile, entrypoint, ion::render::Shader::eFragment); } } } } } ion::debug::Log("Done."); return 0; }
// remove vertex shader specific code from pixel shader and vice versa static void RefineShader(char *buffer, bool isFragShader) { guard(RefineShader); char *dst = buffer; int ifLevel = 0; int braceLevel = 0; const char *dropFunc = isFragShader ? "VertexShaderMain" : "PixelShaderMain"; while (*buffer) { if (*buffer == '#') { // preprocessor if (!strncmp(buffer+1, "if", 2)) ifLevel++; else if (!strncmp(buffer+1, "endif", 5)) ifLevel--; goto copy_line; } // if (ifLevel) goto copy_line; // keep code inside preprocessor blocks ?? // skip "attribute" declarations in fragment shader if (isFragShader && CheckToken(buffer, "attribute")) goto skip_c_line; if (!ifLevel) { if (CheckToken(buffer, dropFunc)) goto skip_c_block; char *nextTok = SkipToken(buffer); if (nextTok && CheckToken(nextTok, dropFunc)) goto skip_c_block; } goto copy_line; copy_line: // copy until end of line while (*buffer) { char c = *buffer++; *dst++ = c; if (c == '\n' || c == 0) break; if (c == '{') braceLevel++; if (c == '}') braceLevel--; } continue; /* skip_line: // skip until end of line buffer = strchr(buffer, '\n'); if (!buffer) break; buffer++; *dst++ = '\n'; continue; */ skip_c_line: // skip until C line delimiter (;) while (true) { char c = *buffer++; if (c == ';') goto next; else if (c == '\n') // keep line count { *dst++ = '\n'; continue; } else if (c == 0) { buffer--; // keep pointer to NULL char break; } } continue; skip_c_block: // skip {...} construction while (true) { char c = *buffer++; if (c == '}') { if (--braceLevel == 0) break; } else if (c == '{') braceLevel++; else if (c == '\n') // keep line count { *dst++ = '\n'; continue; } else if (c == 0) { buffer--; // keep pointer to NULL char break; } } continue; next: continue; } *dst = 0; unguard; }
/*! \brief \fn Parser::Primary \param get \return const double */ const double Parser::Primary (const bool get) // primary (base) tokens { if (get) GetToken (); // one-token lookahead switch (type_) { case NUMBER: { double v = value_; GetToken (true); // get next one (one-token lookahead) return v; } case NAME: { std::string word = word_; GetToken (true); if (type_ == LHPAREN) { // might be single-argument function (eg. abs (x) ) std::map<std::string, OneArgFunction>::const_iterator si; si = OneArgumentFunctions.find (word); if (si != OneArgumentFunctions.end ()) { double v = Expression (true); // get argument CheckToken (RHPAREN); GetToken (true); // get next one (one-token lookahead) return si->second (v); // evaluate function } // might be double-argument function (eg. roll (6, 2) ) std::map<std::string, TwoArgFunction>::const_iterator di; di = TwoArgumentFunctions.find (word); if (di != TwoArgumentFunctions.end ()) { double v1 = Expression (true); // get argument 1 (not commalist) CheckToken (COMMA); double v2 = Expression (true); // get argument 2 (not commalist) CheckToken (RHPAREN); GetToken (true); // get next one (one-token lookahead) return di->second (v1, v2); // evaluate function } // might be double-argument function (eg. roll (6, 2) ) std::map<std::string, ThreeArgFunction>::const_iterator ti; ti = ThreeArgumentFunctions.find (word); if (ti != ThreeArgumentFunctions.end ()) { double v1 = Expression (true); // get argument 1 (not commalist) CheckToken (COMMA); double v2 = Expression (true); // get argument 2 (not commalist) CheckToken (COMMA); double v3 = Expression (true); // get argument 3 (not commalist) CheckToken (RHPAREN); GetToken (true); // get next one (one-token lookahead) return ti->second (v1, v2, v3); // evaluate function } //throw std::runtime_error ("Function '" + word + "' not implemented."); } // not a function? must be a symbol in the symbol table double & v = symbols_ [word]; // get REFERENCE to symbol table entry // change table entry with expression? (eg. a = 22, or a = 22) switch (type_) { // maybe check for NaN or Inf here (see: isinf, isnan functions) case ASSIGN: v = Expression (true); break; case ASSIGN_ADD: v += Expression (true); break; case ASSIGN_SUB: v -= Expression (true); break; case ASSIGN_MUL: v *= Expression (true); break; case ASSIGN_DIV: { double d = Expression (true); if (d == 0.0) { //throw std::runtime_error ("Divide by zero"); } v /= d; break; // change table entry with expression } // end of ASSIGN_DIV default: break; // do nothing for others } // end of switch on type_ return v; // and return new value } case MINUS: // unary minus return - Primary (true); case NOT: // unary not return (Primary (true) == 0.0) ? 1.0 : 0.0;; case LHPAREN: { double v = CommaList (true); // inside parens, you could have commas CheckToken (RHPAREN); GetToken (true); // eat the ) return v; } default: break; //throw std::runtime_error ("Unexpected token: " + word_); } // end of switch on type } // end of Parser::Primary
sint32 ThroneDB::ParseAThrone(Token *throneToken, ThroneInfo *throneInfo) { char str[_MAX_PATH]; StringId str_id; sint32 snd_id; if(throneToken->GetType() == TOKEN_EOF) return(FALSE); if (throneToken->GetType() != TOKEN_STRING) { c3errors_ErrorDialog (throneToken->ErrStr(), "Throne id expected"); g_abort_parse = TRUE; return FALSE; } throneToken->GetString(str); if(!g_theStringDB->GetStringID(str, str_id)) { c3errors_ErrorDialog (throneToken->ErrStr(), "Could not find %s in string database", str); g_abort_parse = TRUE; return FALSE; } throneInfo->m_name = str_id; if(throneToken->Next() != TOKEN_OPEN_BRACE) { c3errors_ErrorDialog (throneToken->ErrStr(), "Missing open brace"); g_abort_parse = TRUE; return FALSE; } strcpy(throneInfo->m_zoomedImageFilename, ""); throneInfo->m_text = -1; throneInfo->m_upgradeSoundID = -1; throneInfo->m_isCeiling = false; throneInfo->m_canZoom = false; while(throneToken->Next() != TOKEN_CLOSE_BRACE) { switch(throneToken->GetType()) { case TOKEN_THRONE_UPGRADE_SOUND: if(!CheckToken(throneToken, TOKEN_STRING, "Upgrade sound ID missing")) return(FALSE); throneToken->GetString(str); snd_id = g_theSoundDB->FindTypeIndex(str); if(snd_id == -1) { c3errors_ErrorDialog (throneToken->ErrStr(), "Could not find %s in sound database", str); g_abort_parse = TRUE; return FALSE; } throneInfo->m_upgradeSoundID = snd_id; break; case TOKEN_THRONE_UPGRADE_TEXT: if(!CheckToken(throneToken, TOKEN_STRING, "Upgrade sound ID missing")) return(FALSE); throneToken->GetString(str); if(!g_theStringDB->GetStringID(str, str_id)) { c3errors_ErrorDialog (throneToken->ErrStr(), "Could not find %s in string database", str); g_abort_parse = TRUE; return FALSE; } throneInfo->m_text = str_id; break; case TOKEN_THRONE_IMAGE_ZOOMED: if(!CheckToken(throneToken, TOKEN_QUOTED_STRING, "Zoomed image filename expected")) return(FALSE); throneToken->GetString( str ); strcpy( throneInfo->m_zoomedImageFilename, str ); break; case TOKEN_THRONE_IS_CEILING: throneInfo->m_isCeiling = true; break; case TOKEN_THRONE_CAN_ZOOM: throneInfo->m_canZoom = true; break; default: c3errors_ErrorDialog(throneToken->ErrStr(), "Unexpected token before close brace."); g_abort_parse = TRUE; return(FALSE); } } throneToken->Next(); return TRUE; }
CString XMLRestriction::CheckDatatype(XmlDataType p_type,CString p_value) { CString result; // Empty value, nothing to check if(p_value.IsEmpty()) { return result; } try { // Checking only base datatypes // String and CDATA are never checked! switch(p_type & XDT_MaskTypes) { case XDT_AnyURI: result = CheckAnyURI (p_value); break; case XDT_Base64Binary: result = CheckBase64 (p_value); break; case XDT_Boolean: result = CheckBoolean (p_value); break; case XDT_Date: result = CheckDate (p_value); break; case XDT_Integer: result = CheckInteger (p_value); break; case XDT_Decimal: result = CheckDouble (p_value,false); break; case XDT_Double: result = CheckDouble (p_value,true); break; case XDT_DateTime: result = CheckDateTime (p_value,false); break; case XDT_DateTimeStamp: result = CheckDateTime (p_value,true); break; case XDT_Float: result = CheckDouble (p_value,true); break; case XDT_Duration: result = CheckDuration (p_value); break; case XDT_DayTimeDuration: result = CheckDaySecond(p_value); break; case XDT_YearMonthDuration: result = CheckYearMonth(p_value); break; case XDT_GregDay: result = CheckGregDay (p_value); break; case XDT_GregMonth: result = CheckGregMonth(p_value); break; case XDT_GregYear: result = CheckGregYear (p_value); break; case XDT_GregMonthDay: result = CheckGregMD (p_value); break; case XDT_GregYearMonth: result = CheckGregYM (p_value); break; case XDT_HexBinary: result = CheckHexBin (p_value); break; case XDT_Long: result = CheckLong (p_value); break; case XDT_Int: result = CheckLong (p_value); break; case XDT_Short: result = CheckShort (p_value); break; case XDT_NonNegativeInteger:result = CheckNNegInt (p_value); break; case XDT_PositiveInteger: result = CheckPosInt (p_value); break; case XDT_UnsignedLong: result = CheckUnsLong (p_value); break; case XDT_UnsignedInt: result = CheckUnsLong (p_value); break; case XDT_UnsignedShort: result = CheckUnsShort (p_value); break; case XDT_UnsignedByte: result = CheckUnsByte (p_value); break; case XDT_NonPositiveInteger:result = CheckNonPosInt(p_value); break; case XDT_NegativeInteger: result = CheckNegInt (p_value); break; case XDT_Time: result = CheckTime (p_value); break; case XDT_Token: result = CheckToken (p_value); break; case XDT_NMTOKEN: result = CheckNMTOKEN (p_value); break; case XDT_Name: result = CheckName (p_value); break; case XDT_ENTITY: result = CheckName (p_value); break; case XDT_ID: result = CheckName (p_value); break; case XDT_IDREF: result = CheckName (p_value); break; case XDT_QName: result = CheckQName (p_value); break; case XDT_NMTOKENS: result = CheckNMTOKENS (p_value); break; case XDT_ENTITIES: result = CheckNames (p_value); break; case XDT_IDREFS: result = CheckNames (p_value); break; default: break; } } catch(StdException& er) { ReThrowSafeException(er); // Primary datatype conversion went wrong result = er.GetErrorMessage(); } return result; }
static bool CheckAPI (EGLDisplay dpy, const char *api) { const char *apis = eglQueryString (dpy, EGL_CLIENT_APIS); return CheckToken(apis, api); }
static bool CheckClientExt(const char *name) { const char *exts = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); return CheckToken(exts, name); }
//------------------------------------------------------------------------------ void EnsureToken(READFILE Stream,TokenType Type,char * Value) { if (!CheckToken(Stream,Type,Value)) { TokenError(Stream); } }