本文整理汇总了C++中printstring函数的典型用法代码示例。如果您正苦于以下问题:C++ printstring函数的具体用法?C++ printstring怎么用?C++ printstring使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printstring函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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++;
}
}
示例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();
}
示例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);
}
示例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);
}
示例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)");
}
示例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");
}
示例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
}
}
示例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);
}
示例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++;
}
}
示例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("_");
}
示例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));
}
示例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;
}
示例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');
}
示例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;
}
示例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);
}
}