關於部落格
  • 26394

    累積人氣

  • 0

    今日人氣

    0

    訂閱人氣

ltree

/* 編譯: gcc -o pm pm.c -D_REENTRANT -I/usr/include/nptl -L/usr/lib/nptl -lpthread 執行: ./pm& */ /* 除錯 檢查是否有週期的timer 訊號,檢查週期多久 value.it_interval=value.it_value; //週期性 value.it_interval.tv_sec=0; //只定時一次 value.it_interval.tv_usec=0; */ //接收端 /* ipc中已使用的檔案(資源)名稱,利用此號碼來識別不同的ipc,不同程式也用此號碼來達到共同使用 sem_lcdreq1 =(key_t)1234 sem_lcdack1 =(key_t)1233 msg_lcdtime1 = key_t)1111 */ #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) /* union semun is defined by including */ #else /* according to X/OPEN we have to define it ourselves */ union semun { int val; /* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */ unsigned short int *array; /* array for GETALL, SETALL */ struct seminfo *__buf; /* buffer for IPC_INFO */ }; #endif //#include < time.h> #include #include #include #include #include //#include #include #include #include //#include #include #include #include #include #include #include #include #include #include #include //#include #include #include #include #include //#include "asm/arch/lib/lcd-creator.h" //#include "asm/arch/lib/creator_s3c4510_lcd.h" //#include "creator_lib.h" //#include "creator_lib.c" //-------------------------------------------------------------- void ltreemap(void); //-------------------------------------------------------------- //-------------------------------------------------------------- //-------------------------------------------------------------- //-------------------------------------------------------------- struct pcl{ int sta0; int sta1; int sta2; } ltree[3][3]; int row,col; int main(int argc, char *argv[]) { for (row=0;row<=2;row++) { for (col=0;col<=2;col++) { ltree[row][col].sta0=1; ltree[row][col].sta1=1; ltree[row][col].sta2=1; } } ltree[0][0].sta0=2; ltree[1][0].sta1=4; ltree[2][0].sta2=6; ltreemap(); //exit(0); } void ltreemap(void) { for(row=0;row<=2;row++) { for (col=0;col<=2;col++) { printf("ltree[%d][%d]=",row,col); printf("<%d><%d><%d>t",ltree[row][col].sta0,ltree[row][col].sta1,ltree[row][col].sta2); } printf("n"); } }
相簿設定
標籤設定
相簿狀態