Lines Matching refs:buf

42 static char * getline(istream& i, char* buf, int size){  in getline()  argument
47 memset(buf,0,size); in getline()
49 i.getline(buf,size,'\n'); in getline()
51 while (buf[len]) { in getline()
52 if ( /*(buf[len]>=0) &&*/ buf[len]< ' ' ) buf[len] = ' '; in getline()
58 while ( buf[len] ) { in getline()
59 if ( (buf[len] == ' ') && (buf[len+1] == ' ')) { in getline()
60 memmove(buf+len, buf+len+1, strlen(buf+len)); in getline()
64 if (buf[0] == ' ') memmove(buf, buf+1, size-1); in getline()
67 if ((buf[0]==0)||(buf[0]==';')) continue; in getline()
70 while (buf[len]) in getline()
72 if ((buf[len] == '/') && (buf[len + 1] == '/')) buf[len] = 0; in getline()
75 if (len && (buf[len - 1] == ' ')) { in getline()
77 buf[len] = 0; in getline()
81 if (buf[0] == 0) continue; in getline()
85 return (buf); in getline()
90 static int getline(string&str, char* buf, size_t sz) { in getline() argument
102 strncpy(buf,str.c_str(), len); in getline()
103 buf[len]=0; in getline()
216 int normalizeSplitter(string& buf) { in normalizeSplitter() argument
217 if ( buf.length() <= 2 ) return 0; in normalizeSplitter()
218 if ( buf[0] == '[' && buf[buf.length()-1] == ']' ) { in normalizeSplitter()
219 while ( buf[1] == ' ' ) in normalizeSplitter()
222 buf.erase(1, 1); in normalizeSplitter()
224 buf.remove(1,1); in normalizeSplitter()
226 while ( buf[buf.length()-2] == ' ' ) in normalizeSplitter()
229 buf.erase(buf.length()-2,1); in normalizeSplitter()
231 buf.remove(buf.length()-2,1); in normalizeSplitter()
260 int TMapLoader::LoadGlobal(string& buf) { in LoadGlobal() argument
263 while ( buf.length() ) { in LoadGlobal()
265 if (!getline(buf,wbuf,sizeof(wbuf))) break; in LoadGlobal()
292 char* TMapLoader::ParseKeyDef(const char* buf, WORD& vk_code, DWORD& control) { in ParseKeyDef() argument
294 strcpy(wbuf,buf); in ParseKeyDef()
319 int TMapLoader::LoadKeyMap(string buf) { in LoadKeyMap() argument
349 while ( buf.length() ) { in LoadKeyMap()
351 if (!getline(buf,wbuf,sizeof(wbuf))) break; in LoadKeyMap()
385 int TMapLoader::LoadCharMap(string buf) { in LoadCharMap() argument
392 while ( buf.length() ) { in LoadCharMap()
394 if (!getline(buf,wbuf,sizeof(wbuf))) break; in LoadCharMap()
467 char buf[256]; in Load() local
480 getline(inpfile, buf, 255); in Load()
481 bufLen = strlen(buf); in Load()
484 if ( buf[0] == '[' && buf[bufLen-1] == ']' ) { in Load()
486 string temps(buf); in Load()
498 if ( !getLongComment(inpfile, buf, sizeof(buf)) ) { in Load()
554 getline(inpfile, buf, sizeof(buf)); in Load()
555 bufLen = strlen(buf); in Load()
557 if ( buf[0] == '[' && buf[bufLen-1] == ']' ) { in Load()
558 string t(buf); in Load()
568 getLongComment(inpfile, buf, sizeof(buf)) ) continue; in Load()
573 temps += buf; in Load()
588 printm(0, FALSE, MSG_KEYUNEXPLINE, buf); in Load()
624 buf[0] = 0; in Load()
625 getline(config,buf,sizeof(buf)); in Load()
626 bufLen = strlen(buf); in Load()
627 if ( !bufLen || (buf[0] == '[' && buf[bufLen-1] == ']') ) continue; in Load()
628 if ( strnicmp(buf,"keymap",6) == 0 ) { in Load()
629 string orig(buf); in Load()
630 printit("\t"); printit(buf); printit("\n"); in Load()
631 char * mapdef = strtok(buf,":"); in Load()
684 else if ( strnicmp(buf,"charmap",7) == 0 ) { in Load()
685 printit("\t"); printit(buf); printit("\n"); in Load()
686 char * mapdef = buf + 8;// 'charmap ' in Load()
749 char buf[20]; in Display() local
750 itoa(i,buf,10); in Display()
757 strcat(buf," "); in Display()
758 printit(buf); in Display()