📄 thread.c
字号:
#include "./../inc/screen.h"void *prttime( void *ptr ){ while( 1 ) { plot( 51, 2, getsystime() ); sleep(1); } }/**在指定位置显示时间的函数**/void PtrTime(){ int thr_id1; pthread_t p_thread1; thr_id1 = pthread_create(&p_thread1,NULL,prttime,(void *)NULL); pthread_detach( p_thread1 ); }/**将指定的字符串写进文本**/void PrtToFile( char *str ){ FILE *fp; fp==NULL; fp=fopen( "/usr/zhywkf/test/cff/ini/TmpFile.txt", "a" ); fprintf( fp, "%s\n", str ); fclose( fp );} void *prtroll( void *ptr ){ int i,len,j; i=1; len=0, j=2; len=strlen( ptr ); while( 1 ) { rubber( 1, 80, 4, 4 ); if( j == (80 - len) ) j=2; plot( j, 4, ptr ); sleep( 1 ); j = j+2; } }/**滚动条函数**/void PrtRoll( char *str ){ int thr_id1; pthread_t p_thread1; thr_id1 = pthread_create(&p_thread1,NULL,prtroll,(void *)str); pthread_detach( p_thread1 );}/**随机数生成**/ void *bringrand( void *ptr ){ while( 1 ) randnum();} /**随机数生成函数**/ void BringRand(){ int thr_id1; pthread_t p_thread1; thr_id1 = pthread_create(&p_thread1,NULL,bringrand,(void *)NULL); pthread_detach( p_thread1 );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -