static char* query_password() { char buf[64]; int fdset[2]; int n; if (pipe(fdset) < 0) return ""; switch (fork()) { case -1: // error return ""; case 0: // child close(fdset[0]); ipcfd = fdset[1]; InkViewMain(pwd_query_handler); close(ipcfd); exit(0); default: close(fdset[1]); n = read(fdset[0], buf, sizeof(buf) - 1); if (n < 0) n = 0; buf[n] = 0; close(fdset[0]); usleep(500000); return strdup(buf); } }
int main (int argc, char * argv[]) { #ifdef ARCH_PB directory = argv[0]; size_t find; find = directory.find_last_of("/\\"); directory = directory.substr(0,find); chdir(directory.c_str()); int fd1 = open("log1.txt",O_CREAT|0666); dup2(fd1, 1); int fd2 = open("log2.txt",O_CREAT|0666); dup2(fd2, 2); #endif Logger logger; logger.WriteLog("Hello, pocketbook"); #ifdef ARCH_PB close(fd1); close(fd2); #endif InkViewMain(mainHandler); return 0; }
int main(int argc, char **argv) { balda_t* balda = balda_init(); balda_controller_init(balda); InkViewMain(balda_controller_handler); balda_controller_free(); balda_free(balda); return 0; }
int main(int argc, char **argv) { OpenScreen(); // SetOrientation int sw = ScreenWidth(); int sh = ScreenHeight(); fprintf(stderr, "[%ix%i]\n", sw, sh); if (sw >= 1200 || sh >= 1200) { cpar = ¶ms[1]; } else { cpar = ¶ms[0]; } cal_title_font = OpenFont(DEFAULTFONTB, cpar->tfontsize, 1); cal_month_font = OpenFont(DEFAULTFONTB, cpar->mfontsize, 1); cal_day_font = OpenFont(DEFAULTFONTB, cpar->dfontsize - (IsRTL() ? 2 : 0), 1); cal_date_font = OpenFont(DEFAULTFONT, cpar->dfontsize, 1); cal_date2_font = OpenFont(DEFAULTFONTB, cpar->dfontsize, 1); CurTime=time(NULL); CurDate=localtime(&CurTime); if (year>CurDate->tm_year+1900) step=-step; FirstDay=MilleniumFirstDay; while (year!=CurDate->tm_year+1900) { if (year%4==0) LongYear=1; else LongYear=0; if (LongYear && year%100==0 && year%400!=0) LongYear=0; FirstDay=(FirstDay+365*(1-LongYear)+366*LongYear)%7; year+=step; } InkViewMain(calendar_handler); return 0; }
int main(int argc, char **argv) { InkViewMain(main_handler); return 0; }
int main(){ InkViewMain(mainh); return 0; }