int main(int argc, char** argv) { FILE *file; char data[150000]; int fd, i; fd = llopen(0); int filesize; unsigned char firstData[10000]; estabelecimento(fd, firstData); filesize = transfDados(fd, firstData, data, filesize); terminacao(fd); /*printf("filename: \n"); for(i=0; i<strlen(filename); i++){ printf("%c",filename[i]); } printf("Dados:\n "); for(i=0;i<filesize;i++){ printf("%x ",data[i]); }*/ file=open(filename+1, O_WRONLY | O_CREAT, S_IWRITE | S_IREAD); write(file,data,filesize); close(file); llclose(fd); return 0; }
int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowSize (DIMX, DIMY); glutInitWindowPosition (INITIALPOS_X, INITIALPOS_Y); main_window = glutCreateWindow (argv[0]); glutDisplayFunc(display); GLUI_Master.set_glutReshapeFunc(reshape); GLUI_Master.set_glutKeyboardFunc (keyboard); GLUI_Master.set_glutMouseFunc(processMouse); glutMotionFunc(processMouseMoved); glutPassiveMotionFunc(processPassiveMouseMoved); GLUI_Master.set_glutSpecialFunc( NULL ); glutTimerFunc(delta_t, myUpdateTransforms, 0); /*** Create the bottom subwindow ***/ glui2 = GLUI_Master.create_glui_subwindow( main_window, GLUI_SUBWINDOW_BOTTOM ); glui2->set_main_gfx_window( main_window ); view_rot = glui2->add_rotation( "Rotacao", view_rotate ); view_rot->set_spin( 1.0 ); glui2->add_column( false ); trans_z = glui2->add_translation( "Zoom", GLUI_TRANSLATION_Z, &obj_pos[2] ); trans_z->set_speed( .10 ); glui2->add_column( false ); GLUI_Button *light_switch = glui2->add_button("Luz",0,(GLUI_Update_CB) turn_light); /* We register the idle callback with GLUI, not with GLUT */ GLUI_Master.set_glutIdleFunc( myGlutIdle ); inicializacao(); glutMainLoop(); terminacao(); return 0; }