file_io::file_io(const char file_name[]) { File_name = (char*) file_name; has_ran = false; has_ran_write = false; std::fstream f_handle(file_name, std::ios::in); if (f_handle.is_open()) {} else {f_handle.close(); f_handle.open(file_name, std::ios::out);} }
int pipeline_msg_req_handle(struct pipeline *p) { uint32_t msgq_id; for (msgq_id = 0; msgq_id < p->n_msgq; msgq_id++) { for ( ; ; ) { struct pipeline_msg_req *req; pipeline_msg_req_handler f_handle; req = pipeline_msg_recv(p, msgq_id); if (req == NULL) break; f_handle = (req->type < PIPELINE_MSG_REQS) ? p->handlers[req->type] : pipeline_msg_req_invalid_handler; if (f_handle == NULL) f_handle = pipeline_msg_req_invalid_handler; pipeline_msg_send(p, msgq_id, f_handle(p, (void *) req)); } } return 0; }
t_length file_size_get(FILE *f) { FFILE f_handle(f); if(!(f_handle)) { return(FALSE); } else { return(f_handle.size_get()); } }