/*#$% ====================================================== DXCC定義ファイルを読み込む ------------------------------------------------------ fm : ファイル名のポインタ ------------------------------------------------------ ------------------------------------------------------ ====================================================== */ void CCountry::Load(LPCSTR fm) { FILE *fp; LPCSTR p; char hbf[512]; Free(); if( (fp = fopen(fm, "rt"))!=NULL ){ while( !feof(fp) ){ if( fgets(hbf, 512, fp)!=NULL ){ if( hbf[0] == '$' ) break; ClipLF(hbf); _delchr(hbf, TAB); if( hbf[0] != '!' ){ p = StrDlmCpy(wbf, hbf, ';', 512); clipsp(wbf); ctl[cmax].Name = StrDupe(wbf); if( p != NULL ){ p = StrDlmCpy(wbf, p, ';', 512); clipsp(wbf); ctl[cmax].Code = StrDupe(wbf); } if( p != NULL ){ p = StrDlmCpy(wbf, p, ';', 512); clipsp(wbf); ctl[cmax].QTH = StrDupe(wbf); } if( p != NULL ){ p = StrDlmCpy(wbf, p, ';', 512); clipsp(wbf); ctl[cmax].Cont = StrDupe(wbf); } if( p != NULL ){ StrDlmCpy(wbf, p, ';', 512); clipsp(wbf); ctl[cmax].TD = StrDupe(wbf); } cmax++; if( cmax >= CTMAX ) break; } } } fclose(fp); } else { WarningMB((sys.m_WinFontCharset != SHIFTJIS_CHARSET ) ? "'ARRL.DX' was not found.\r\n\r\nYou cannot use a DXCC function.\r\nThis is not a problem if you do not need it":"'ARRL.DX'が見つかりません.\r\n\r\nDXエンティティの自動判定機能は使用できません."); } }
//--------------------------------------------------------------------------- void __fastcall CLIBL::Add(LPCSTR pName, HINSTANCE hLib) { if( m_Count >= m_AMax ) Alloc(); LIBD *cp = &m_pBase[m_Count]; cp->pName = StrDupe(pName); cp->hLib = hLib; m_Count++; }
//--------------------------------------------------------------------------- void __fastcall CFILEL::Add(LPCSTR pn, USHORT crc) { if( Count >= AMax ) Alloc(); CFD *cp = &pBase[Count]; cp->pName = StrDupe(pn); cp->crc = crc; Count++; }
int StrUnquoteTokenAppend(const char **s, const STR_QUOTES * const quotes , char ** const dst) { const char *p; /* temp pointer into s */ size_t l; int ch; FLAG fullQuote; int endQuote; const char *q; DBG_ENTER("StrUnquoteToken", Suppl_dynstr) assert(quotes); assert(s); assert(dst); assert(!quotes->str_unpairyQuotes || strlen(quotes->str_unpairyQuotes) % 2 == 0); DBG_ARGUMENTS( ("str=\"%s\"", s) ) *dst = 0; if((p = *s) == 0 || (ch = *p) == 0) { DBG_RETURN_I(0) } if((l = Strspn(p, quotes->str_delimiters)) != 0) { /* Unquoted delimiter --> The token is a sequence of delimiters */ /** Warning: Possible incorrect assignment **/ DBG_RETURN_BI( (*dst = StrDupe(p, *s += l)) == 0) } fullQuote = endQuote = 0; do { if(endQuote) { /* within quoted string */ if(endQuote == ch) { /* end of quote reached */ endQuote = 0; continue; } if(!fullQuote && StrChr(quotes->str_singleQuotes, ch)) { /* A not-full quote does not quote single quotes --> regardless what the next character is (except NUL) it is appended to the string */ if((ch = *++p) == NUL) /* single quote @ EOS --> ign */ break; } } else if(StrChr(quotes->str_singleQuotes, ch)) { if((ch = *++p) == NUL) /* single quote @ EOS --> ign */ break; } else if(StrChr(quotes->str_pairyQuotes, ch)) { endQuote = ch; fullQuote = StrChr(quotes->str_fullQuotes, ch) != 0; continue; } else if((q = StrChr(quotes->str_unpairyQuotes, ch)) != 0 && (q - quotes->str_unpairyQuotes) % 2 == 0) { endQuote = q[1]; fullQuote = StrChr(quotes->str_fullQuotes, ch) != 0; continue; } else if(StrChr(quotes->str_delimiters, ch)) { /* Unquoted delimiter --> Stop here */ break; } if(!StrAppChr_(dst, ch)) { /* allocation error */ StrFree_(dst); DBG_RETURN_I(1) } } while((ch = *++p) != NUL); *s = p; DBG_RETURN_I(0) }