本文整理汇总了C++中printstring函数的典型用法代码示例。如果您正苦于以下问题:C++ printstring函数的具体用法?C++ printstring怎么用?C++ printstring使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printstring函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ls
void ls(char * filePath)
{
unsigned int destinationDirBlockNumber;
int y;
directoryBlock destinationDirectory;
destinationDirBlockNumber = findFileBlockInPath(filePath);
if (destinationDirBlockNumber == -1)
{
printstring("Directory does not exists");
return;
}
readsector(destinationDirBlockNumber, &destinationDirectory);
y = 0;
while (y < DIRECTORYENTRYCOUNT)
{
if (destinationDirectory.entries[y].fileBlockStart != 0)
{
char *tempName = (char*)mallocFS(mystrlen(destinationDirectory.entries[y].fileName));
tempName = getData(destinationDirectory.entries[y].fileName);
if (destinationDirectory.entries[y].fileType == IS_DIRECTORY)
{
printstring("Directory: %s\n", tempName);
}
else if (destinationDirectory.entries[y].fileType == IS_FILE)
{
printstring("File: %s\n", tempName);
}
}
y++;
}
}
开发者ID:anamarce,项目名称:proyectoFinalSISO,代码行数:33,代码来源:lib.c
示例2: watchdog_interrupt
watchdog_interrupt(void)
{
#ifdef CONTIKI_TARGET_SKY
#if PRINT_STACK_ON_REBOOT
uint8_t dummy;
static uint8_t *ptr;
static int i;
ptr = &dummy;
printstring("Watchdog reset");
printstring("\nStack at $");
hexprint(((int)ptr) >> 8);
hexprint(((int)ptr) & 0xff);
printstring(":\n");
for(i = 0; i < 64; ++i) {
hexprint(ptr[i]);
printchar(' ');
if((i & 0x0f) == 0x0f) {
printchar('\n');
}
}
printchar('\n');
#endif /* PRINT_STACK_ON_REBOOT */
#endif /* CONTIKI_TARGET_SKY */
watchdog_reboot();
}
开发者ID:project-master-device,项目名称:project-master-device,代码行数:28,代码来源:watchdog.c
示例3: quit_program
void quit_program(int rc)
{
set_process_permissions(0, 0, xstrtoo(VBOX_ROOT_UMASK, 0));
modem_hangup(&vboxmodem);
log_line(LOG_D, "Closing modem device (%d)...\n", vboxmodem.fd);
if (vboxmodem_close(&vboxmodem) != 0)
{
log_line(LOG_E, "%s (%s)\n", vboxmodem_error(), strerror(errno));
}
if (isdnttyname)
{
printstring(temppathname, "%s/LCK..%s", LOCKDIR, isdnttyname);
lock_remove(temppathname);
printstring(temppathname, "%s/vboxgetty-%s.pid", PIDDIR, isdnttyname);
pid_remove(temppathname);
}
scr_remove_interpreter();
rc_free(rc_getty_c);
breaklist_clear();
log_close();
exit(rc);
}
开发者ID:marschap,项目名称:isdn4k-utils,代码行数:31,代码来源:vboxgetty.c
示例4: RenderGUI
void RenderGUI()
{ int i;
CheckMessageExpirations();
for (i=0; i<num_msgs; i++)
{
GotoXY(1,1+(i*10));
printstring(0,messages[i].text);
}
if (!cpu_watch) return;
frames++;
i=sx-76;
GotoXY(i,sy-39);
sprintf(strbuf,"etc:%d",profile[0]);
printstring(0,strbuf);
GotoXY(i,sy-29);
sprintf(strbuf,"Render:%d",profile[1]);
printstring(0,strbuf);
GotoXY(i,sy-19);
sprintf(strbuf,"PFlip:%d",profile[2]);
printstring(0,strbuf);
GotoXY(i,sy-9);
sprintf(strbuf,"FPS:%d",fps);
printstring(0,strbuf);
}
开发者ID:joncampbell123,项目名称:16,代码行数:27,代码来源:MESSAGE.C
示例5: printhelp
static void printhelp(void)
{
glEnable(GL_BLEND);
glColor4f(0.5,0.5,0.5,0.5);
glRecti(40,40,600,440);
glDisable(GL_BLEND);
glColor3f(1.0,0.0,0.0);
glRasterPos2i(300,420);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"Help");
glRasterPos2i(60,390);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"h - Toggle Help");
glRasterPos2i(60,360);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"t - Toggle Textures");
glRasterPos2i(60,330);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"f - Toggle Fog");
glRasterPos2i(60,300);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"b - Toggle Back face culling");
glRasterPos2i(60,270);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"Arrow Keys - Rotate");
glRasterPos2i(60,240);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"a - Increase velocity");
glRasterPos2i(60,210);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"z - Decrease velocity");
glRasterPos2i(60,180);
if(joyavailable)
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"j - Toggle jostick control (Joystick control available)");
else
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"(No Joystick control available)");
}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:32,代码来源:teapot.c
示例6: docreate
/*allow the user to create a text file*/
void docreate(char* line)
{
char file[12800];
int index=0;
char* name=getargument(line);
char c=0;
printstring("Enter your text. End the file by typing CTRL-C.\r\n\n\0");
/*terminates when user presses CTRL-C - 3) */
while(c!=0x3)
{
/*get a character and store it*/
c=getchar();
file[index++]=c;
/*echo it back if it isn't CTRL-C*/
if (c!=0x3)
putchar(c);
/*if the user presses ENTER, follow the CR with a LF*/
if (c==0xd)
{
file[index++]=0xa;
putchar(0xa);
}
}
/*terminate the file with a 0*/
file[index-1]=0x0;
/*write it to the disk. Round up the sector*/
writefile(name,file,div(index,512)+1);
printstring("\r\n\0");
}
开发者ID:alujajakerry,项目名称:SISO2,代码行数:33,代码来源:shell.c
示例7: main
//---------------------------------------------------------------------------------------
void main(void)
{
if(BD == 0) // Baudratengenerator noch nicht aktiv
init_seriell(); // serielle Kommunikation ermöglichen
init_timer0(); // Timer 0 initialisieren
init_ad();
init_p33();
EAL=1; // Interrupts generell freigegeben
while(1) // Endlos
{
maske=0x01;
sec=0; // Sec reset
printstring("Portpin: "); // Portpin Eingabeaufforderung
pin=getchar(); // Einlesen
putchar(pin);
putchar('\n');
printstring("Vorwahl: "); // Eingabeaufforderung
ADDATL=1;
while(BSY==1);
vorwahl=ad10bit/100;
printuintdez(vorwahl);
putchar('s');
pin-=0x30; // ASCII Konvertierung
maske=maske<<pin; // Pin in maske schieben
P5=P5&~maske; // LED an
TR0=1; // Timer0 starten
while(vorwahl!=sec); // Warten bis die Zeit erreicht wurde
P5=P5|maske; // LED aus
TR0=0; // Timer 0 stoppen
}
}
开发者ID:Thaodan,项目名称:rs,代码行数:33,代码来源:Timer_05_vasilenko.c
示例8: docopy
/*copy a file*/
void docopy()
{
char sname[7];
char dname[7];
char line[80];
char file[12800];
char dirsector[512];
int index,i;
/*prompt for the first file name*/
printstring("Name of the source file? \0");
readstring(line);
for (i=0; i<6; i++)
{
sname[i]=line[i];
if (line[i]==0xd)
break;
}
sname[i]=0x0;
/*make sure it exists - find the directory entry*/
readsector(2,dirsector);
index=findname(sname,dirsector);
if (index==-1)
{
printstring("File not found\r\n\0");
return;
}
/*read the source file*/
readfile(sname,file);
/*prompt for the destination file name*/
printstring("Name of the destination file? \0");
readstring(line);
for (i=0; i<6; i++)
{
dname[i]=line[i];
if (line[i]==0xd)
break;
}
dname[i]=0x0;
/*figure out how long the source file is*/
i=0;
index=index+6;
while(dirsector[index]!=0x0)
{
index++;
i++;
}
/*write the file*/
writefile(dname,file,i);
}
开发者ID:alujajakerry,项目名称:SISO2,代码行数:56,代码来源:shell.c
示例9: ImprimirLista
void ImprimirLista(char sectorNumber, int depth, char* mapsector)
{
char dirsector[512];
char name[7];
int i,j,index,files,x;
char symbol [2];
symbol[0] = 195;
symbol[1] = 0;
readsector(BASEOFFSET + sectorNumber,dirsector);
index=0;
files=0;
for (i=0; i<16; i++)
{
if (dirsector[index]!=0)
{
for (j=0; j<6; j++)
name[j]=dirsector[index+j];
name[6]=0;
for(x =0;x<depth;x++)
printstring("\t");
printstring(symbol);
printstring(name);
sectorNumber = dirsector[i*0x20+6];
if(mapsector[sectorNumber] == 0x44)
{
j=0;
while(dirsector[index+j+6]!=0)
j++;
printstring(" \0");
printstring( "D\0");
printstring("\r\n\0");
ImprimirLista(sectorNumber,depth+1,mapsector);
files++;
}
else if(mapsector[sectorNumber] == 0x46)
{
j=0;
while(dirsector[index+j+6]!=0)
j++;
printstring(".txt");
printstring(" \0");
printstring("F\0");
printstring("\r\n\0");
files++;
}
}
index=index+0x20;
}
j=0;
for (i=0; i<256; i++)
{
if (mapsector[i]==0x0)
j++;
}
}
开发者ID:alujajakerry,项目名称:SISO2,代码行数:55,代码来源:lib.c
示例10: TextField
void TextField(int x, int y, int width, char *str, int blink)
{
FilledBox(x, y, width, 9, 0);
HLine(x, y, width+1, darkw);
VLine(x, y, 9, darkw);
HLine(x+1, y+8, width-1, brightw);
VLine(x+width, y+1, 8, brightw);
GotoXY(x+2, y+2);
printstring(str);
if (blink) printstring("_");
}
开发者ID:mcgrue,项目名称:maped2w,代码行数:11,代码来源:guicomp.cpp
示例11: writenodeandport
static void writenodeandport(FILE * f, node_t * node, char *port)
{
char *name;
if (IS_CLUST_NODE(node))
name = canon (agraphof(node), strchr(agnameof(node), ':') + 1);
else
name = agcanonStr (agnameof(node));
printstring(f, " ", name); /* slimey i know */
if (port && *port)
printstring(f, ":", agcanonStr(port));
}
开发者ID:emdenrg,项目名称:graphviz,代码行数:11,代码来源:output.c
示例12: mkdir
int mkdir(char * filePath, char * fileName)
{
unsigned int destinationDirBlockNumber,newDirBlockNumber;
directoryBlock destinationDirectory,newDirectory;
int z, y, isfile;
if (strCmp(filePath, "/") == 1)
destinationDirBlockNumber = ROOTBLOCK;
else
destinationDirBlockNumber = findFileBlockInPath(filePath);
if (destinationDirBlockNumber == -1)
{
printstring("Directory does not exists");
return -1;
}
filePath = getData(filePath);
fileName = getData(fileName);
readsector(destinationDirBlockNumber, &destinationDirectory);
isfile = IsNewFile(destinationDirectory, fileName);
if (isfile == -1)
{
printstring("Directory already exist\n");
return -1;
}
newDirBlockNumber = AllocateBlock();
y = 0;
while(y < DIRECTORYENTRYCOUNT)
{
newDirectory.entries[y].fileType = IS_FILE;
newDirectory.entries[y].fileBlockStart = 0;
newDirectory.entries[y].fileBlockSize = 0;
y++;
}
writesector(newDirBlockNumber, &newDirectory);
z = 0;
while (z < DIRECTORYENTRYCOUNT)
{
if (destinationDirectory.entries[z].fileBlockStart == 0)
{
strcpy(fileName, destinationDirectory.entries[z].fileName);
destinationDirectory.entries[z].fileType = IS_DIRECTORY;
destinationDirectory.entries[z].fileBlockStart = newDirBlockNumber;
destinationDirectory.entries[z].fileBlockSize = 1;
break;
}
z++;
}
writesector(destinationDirBlockNumber, &destinationDirectory);
printstring("Directory ");
printstring(fileName);
printstring(" Created!\n");
return newDirBlockNumber;
}
开发者ID:anamarce,项目名称:proyectoFinalSISO,代码行数:53,代码来源:lib.c
示例13: if
//---------------------------------------------------------------------------------------
unsigned char *readdata(void)
{
unsigned char c, maske, z, s, row;
for(z=0; z<8; z++)
{
row=0;
for(s=0; s<5; s++)
{
c=getchar();
if(c=='0' || c==' ')
c='0';
else if(c==0x1B)
return(NULL); // unvollendet
else if(c==ENTER) // daten[k] fetig
{
while(s<5)
{
maske=0x10>>s;
row=row&~maske; // 0 eintragen
putchar('_');
s++;
}
break;
}
else if(c==0x08) // Backspace
{
if(s>0)
{
s--;
putchar(c); // Backspace ausgeben
}
s--;
continue;
}
if(c == '0')
putchar('.');
else
putchar('#');
maske=0x10>>s;
if(c=='0')
row=row&~maske; // 0 eintragen
else
row=row|maske; // 1 eintragen
}
daten[z]=row;
printstring(" daten[");
putchar(z+'0');
printstring("] = ");
printhex(daten[z]);
putchar('\n');
}
开发者ID:Thaodan,项目名称:rs,代码行数:53,代码来源:LCD_06.C
示例14: mkf
void mkf(char * path, char* fileName, char acess[], char *data)
{
int y,isfile;
directoryBlock destinationDirectory;
fileBlock file;
unsigned int newDirBlockNumber, destinationDirBlockNumber;
if (strCmp(getData(path), "/") != 1)
{
destinationDirBlockNumber = findFileBlockInPath(getData(path));
}
else
{
destinationDirBlockNumber = ROOTBLOCK;
}
if (destinationDirBlockNumber == -1)
{
printstring("Path cannot be found, creating file failed");
return;
}
readsector(destinationDirBlockNumber, (char*)&destinationDirectory);
isfile = IsNewFile(destinationDirectory, getData(fileName));
if (isfile == -1)
{
printstring("File already exist\n");
return;
}
file.size = 0;
file.type = IS_FILE;
file.data[0] = '\0';
strcpy(getData(fileName), file.fileName);
strcpy(getData(acess), file.acessRights);
strcpy(getData(data), file.data);
newDirBlockNumber = AllocateBlock();
wf(&file, getData(data), newDirBlockNumber);
y = 0;
while( y < DIRECTORYENTRYCOUNT)
{
if (destinationDirectory.entries[y].fileBlockStart == 0)
{
strcpy(destinationDirectory.entries[y].fileName, file.fileName);
destinationDirectory.entries[y].fileType = IS_FILE;
destinationDirectory.entries[y].fileBlockStart = newDirBlockNumber;
destinationDirectory.entries[y].fileBlockSize = file.size;
break;
}
y++;
}
writesector(destinationDirBlockNumber, (char*)&destinationDirectory);
return;
}
开发者ID:anamarce,项目名称:proyectoFinalSISO,代码行数:51,代码来源:lib.c
示例15: voice_handle_touchtone
static void voice_handle_touchtone(char Tone)
{
char Temp[2];
log(L_DEBUG, "Found touchtone \"%c\"...\n", Tone);
if (Tone == '*')
{
printstring(touchtones, "*");
return;
}
if (*touchtones != '*')
{
if ((Tone != '#') && (Tone != '*'))
{
printstring(touchtones, "*%c#", Tone);
}
else
{
if (Tone == '#') printstring(touchtones, "*#");
}
return;
}
if (index(touchtones, '#'))
{
if ((Tone != '#') && (Tone != '*'))
{
printstring(touchtones, "*%c#", Tone);
}
else
{
if (Tone == '#') printstring(touchtones, "*#");
}
return;
}
if (strlen(touchtones) < TOUCHTONE_BUFFER_LEN)
{
Temp[0] = Tone;
Temp[1] = 0;
strcat(touchtones, Temp);
}
}
开发者ID:marschap,项目名称:isdn4k-utils,代码行数:49,代码来源:voice.c
示例16: TestGeneric
string TestGeneric(vector<T>& list)
{
sum = 0;
for (int i = 0; i < OuterIterations; i++)
sum += (int64)GenericSum(listI);
return printstring("%I64d", sum);
}
开发者ID:megame,项目名称:CppVsCSharp,代码行数:7,代码来源:Benchmarks.cpp
示例17: doCreateFile
void doCreateFile(char* line)
{
char file[12800];
int index=0;
char* name=getargument(line);
char c=0;
printstring("Ingrese el texto del archivo, para finalizar escriba Ctrl + C.\r\n\n\0");
while(c!=0x3)
{
c=getchar();
file[index++]=c;
if (c!=0x3)
putchar(c);
//putchar(c);
if (c==0xd)
{
file[index++]=0xa;
putchar(0xa);
}
}
file[index-1]=0x0;
guardarArchivo(name,file, index);
}
开发者ID:alujajakerry,项目名称:SISO2,代码行数:30,代码来源:shell.c
示例18: TestNonGeneric
string TestNonGeneric(vector<int>& listI)
{
int64 sum = 0;
for (int i = 0; i < OuterIterations; i++)
sum += NonGenericSum(listI);
return printstring("%I64d", sum);
}
开发者ID:megame,项目名称:CppVsCSharp,代码行数:7,代码来源:Benchmarks.cpp
示例19: main
int main(int argc, char** argv) {
if (argc != 2) {
fprintf(stderr, "Usage: %s \"<banner string>\"\n", argv[0]);
exit(1);
}
setupsignals();
setupcurses();
setupscreen();
for (;;) {
int x, y;
if (g_requireinit) {
endwin();
setupcurses();
setupscreen();
g_requireinit = 0;
}
x = rand() % (COLS - pstrwidth(argv[1]));
y = rand() % (LINES - nlines);
clear();
printstring(argv[1], x, y, 3, 1);
refresh();
sleep(1);
}
}
开发者ID:jclulow,项目名称:miscutils,代码行数:29,代码来源:awesomebanner.c
示例20: printnumber
/*prints an integer*/
void printnumber(int number)
{
char num[12];
char pnum[12];
int d=1;
int i=0;
int j;
/*convert the number to a string digit by digit*/
while(i<10)
{
num[i]=mod(mydiv(number,d),10)+0x30;
i++;
d=d*10;
if (mydiv(number,d)==0)
break;
}
/*reverse it to read most significant to least significant*/
j=0;
for (d=i-1; d>=0; d--)
pnum[j++]=num[d];
pnum[j]=0;
printstring(pnum);
}
开发者ID:anamarce,项目名称:proyectoFinalSISO,代码行数:26,代码来源:lib.c
注:本文中的printstring函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论