这篇教程C++ write_data函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中write_data函数的典型用法代码示例。如果您正苦于以下问题:C++ write_data函数的具体用法?C++ write_data怎么用?C++ write_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了write_data函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: write_buffer_truehd/* Adapted from libavformat/spdifenc.c: * It seems Dolby TrueHD frames have to be encapsulated in MAT frames before * they can be encapsulated in IEC 61937. * Here we encapsulate 24 TrueHD frames in a single MAT frame, padding them * to achieve constant rate. * The actual format of a MAT frame is unknown, but the below seems to work. * However, it seems it is not actually necessary for the 24 TrueHD frames to * be in an exact alignment with the MAT frame */static int write_buffer_truehd( filter_t *p_filter, block_t *p_in_buf ){#define TRUEHD_FRAME_OFFSET 2560 filter_sys_t *p_sys = p_filter->p_sys; if( !p_sys->p_out_buf && write_init( p_filter, p_in_buf, 61440, 61440 / 16 ) ) return SPDIF_ERROR; int i_padding = 0; if( p_sys->truehd.i_frame_count == 0 ) { static const char p_mat_start_code[20] = { 0x07, 0x9E, 0x00, 0x03, 0x84, 0x01, 0x01, 0x01, 0x80, 0x00, 0x56, 0xA5, 0x3B, 0xF4, 0x81, 0x83, 0x49, 0x80, 0x77, 0xE0 }; write_data( p_filter, p_mat_start_code, 20, true ); /* We need to include the S/PDIF header in the first MAT frame */ i_padding = TRUEHD_FRAME_OFFSET - p_in_buf->i_buffer - 20 - SPDIF_HEADER_SIZE; } else if( p_sys->truehd.i_frame_count == 11 ) { /* The middle mat code need to be at the ((2560 * 12) - 4) offset */ i_padding = TRUEHD_FRAME_OFFSET - p_in_buf->i_buffer - 4; } else if( p_sys->truehd.i_frame_count == 12 ) { static const char p_mat_middle_code[12] = { 0xC3, 0xC1, 0x42, 0x49, 0x3B, 0xFA, 0x82, 0x83, 0x49, 0x80, 0x77, 0xE0 }; write_data( p_filter, p_mat_middle_code, 12, true ); i_padding = TRUEHD_FRAME_OFFSET - p_in_buf->i_buffer - ( 12 - 4 ); } else if( p_sys->truehd.i_frame_count == 23 ) { static const char p_mat_end_code[16] = { 0xC3, 0xC2, 0xC0, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x11 }; /* The end mat code need to be at the ((2560 * 24) - 24) offset */ i_padding = TRUEHD_FRAME_OFFSET - p_in_buf->i_buffer - 24; if( i_padding < 0 || p_in_buf->i_buffer + i_padding > p_sys->p_out_buf->i_buffer - p_sys->i_out_offset ) return SPDIF_ERROR; write_buffer( p_filter, p_in_buf ); write_padding( p_filter, i_padding ); write_data( p_filter, p_mat_end_code, 16, true ); write_finalize( p_filter, IEC61937_TRUEHD, 1 /* in bytes */ ); p_sys->truehd.i_frame_count = 0; return SPDIF_SUCCESS; } else i_padding = TRUEHD_FRAME_OFFSET - p_in_buf->i_buffer; if( i_padding < 0 || p_in_buf->i_buffer + i_padding > p_sys->p_out_buf->i_buffer - p_sys->i_out_offset ) return SPDIF_ERROR; write_buffer( p_filter, p_in_buf ); write_padding( p_filter, i_padding ); p_sys->truehd.i_frame_count++; return SPDIF_MORE_DATA;}
开发者ID:IAPark,项目名称:vlc,代码行数:78,
示例2: smb2_sendfile_send_data/* struct smbd_smb2_read_state destructor. Send the SMB2_READ data. */static int smb2_sendfile_send_data(struct smbd_smb2_read_state *state){ struct lock_struct lock; uint32_t in_length = state->in_length; uint64_t in_offset = state->in_offset; files_struct *fsp = state->fsp; const DATA_BLOB *hdr = state->smb2req->queue_entry.sendfile_header; NTSTATUS *pstatus = state->smb2req->queue_entry.sendfile_status; struct smbXsrv_connection *xconn = state->smb2req->xconn; ssize_t nread; ssize_t ret; int saved_errno; nread = SMB_VFS_SENDFILE(xconn->transport.sock, fsp, hdr, in_offset, in_length); DEBUG(10,("smb2_sendfile_send_data: SMB_VFS_SENDFILE returned %d on file %s/n", (int)nread, fsp_str_dbg(fsp) )); if (nread == -1) { saved_errno = errno; /* * Returning ENOSYS means no data at all was sent. Do this as a normal read. */ if (errno == ENOSYS) { goto normal_read; } if (errno == EINTR) { /* * Special hack for broken Linux with no working sendfile. If we * return EINTR we sent the header but not the rest of the data. * Fake this up by doing read/write calls. */ set_use_sendfile(SNUM(fsp->conn), false); nread = fake_sendfile(xconn, fsp, in_offset, in_length); if (nread == -1) { saved_errno = errno; DEBUG(0,("smb2_sendfile_send_data: fake_sendfile " "failed for file %s (%s) for client %s. " "Terminating/n", fsp_str_dbg(fsp), strerror(saved_errno), smbXsrv_connection_dbg(xconn))); *pstatus = map_nt_error_from_unix_common(saved_errno); return 0; } goto out; } DEBUG(0,("smb2_sendfile_send_data: sendfile failed for file " "%s (%s) for client %s. Terminating/n", fsp_str_dbg(fsp), strerror(saved_errno), smbXsrv_connection_dbg(xconn))); *pstatus = map_nt_error_from_unix_common(saved_errno); return 0; } else if (nread == 0) { /* * Some sendfile implementations return 0 to indicate * that there was a short read, but nothing was * actually written to the socket. In this case, * fallback to the normal read path so the header gets * the correct byte count. */ DEBUG(3, ("send_file_readX: sendfile sent zero bytes " "falling back to the normal read: %s/n", fsp_str_dbg(fsp))); goto normal_read; } /* * We got a short read */ goto out;normal_read: /* Send out the header. */ ret = write_data(xconn->transport.sock, (const char *)hdr->data, hdr->length); if (ret != hdr->length) { saved_errno = errno; DEBUG(0,("smb2_sendfile_send_data: write_data failed for file " "%s (%s) for client %s. Terminating/n", fsp_str_dbg(fsp), strerror(saved_errno), smbXsrv_connection_dbg(xconn))); *pstatus = map_nt_error_from_unix_common(saved_errno); return 0; } nread = fake_sendfile(xconn, fsp, in_offset, in_length); if (nread == -1) { saved_errno = errno; DEBUG(0,("smb2_sendfile_send_data: fake_sendfile " "failed for file %s (%s) for client %s. " "Terminating/n", fsp_str_dbg(fsp), strerror(saved_errno), smbXsrv_connection_dbg(xconn)));//.........这里部分代码省略.........
开发者ID:dmitry-shavyrin,项目名称:samba4_embedded_build,代码行数:101,
示例3: write_lpexMYBOOL __WINAPI write_lpex(lprec *lp, void *userhandle, write_modeldata_func write_modeldata){ int i, j, b, nrows = lp->rows, ncols = lp->columns, nchars, maxlen = LP_MAXLINELEN; MYBOOL ok; REAL a; char *ptr; if(lp->matA->is_roworder) { report(lp, IMPORTANT, "LP_writefile: Cannot write to LP file while in row entry mode./n"); return(FALSE); } if(!mat_validate(lp->matA)) { report(lp, IMPORTANT, "LP_writefile: Could not validate the data matrix./n"); return(FALSE); } /* Write name of model */ ptr = get_lp_name(lp); if(ptr != NULL) if(*ptr) write_lpcomment(userhandle, write_modeldata, ptr, FALSE); else ptr = NULL; /* Write the objective function */ write_lpcomment(userhandle, write_modeldata, "Objective function", (MYBOOL) (ptr != NULL)); if(is_maxim(lp)) write_data(userhandle, write_modeldata, "max: "); else write_data(userhandle, write_modeldata, "min: "); write_lprow(lp, 0, userhandle, write_modeldata, maxlen); a = get_rh(lp, 0); if(a != 0) write_data(userhandle, write_modeldata, " %+.12g", a); write_data(userhandle, write_modeldata, ";/n"); /* Write constraints */ if(nrows > 0) write_lpcomment(userhandle, write_modeldata, "Constraints", TRUE); for(j = 1; j <= nrows; j++) { if(((lp->names_used) && (lp->row_name[j] != NULL)) || (write_lprow(lp, j, userhandle, NULL, maxlen) == 1)) ptr = get_row_name(lp, j); else ptr = NULL; if((ptr != NULL) && (*ptr)) write_data(userhandle, write_modeldata, "%s: ", ptr);#ifndef SingleBoundedRowInLP /* Write the ranged part of the constraint, if specified */ if ((lp->orig_upbo[j]) && (lp->orig_upbo[j] < lp->infinite)) { if(my_chsign(is_chsign(lp, j), lp->orig_rhs[j]) == -lp->infinite) write_data(userhandle, write_modeldata, "-Inf %s ", (is_chsign(lp, j)) ? ">=" : "<="); else if(my_chsign(is_chsign(lp, j), lp->orig_rhs[j]) == lp->infinite) write_data(userhandle, write_modeldata, "+Inf %s ", (is_chsign(lp, j)) ? ">=" : "<="); else write_data(userhandle, write_modeldata, "%+.12g %s ", (lp->orig_upbo[j]-lp->orig_rhs[j]) * (is_chsign(lp, j) ? 1.0 : -1.0) / (lp->scaling_used ? lp->scalars[j] : 1.0), (is_chsign(lp, j)) ? ">=" : "<="); }#endif if((!write_lprow(lp, j, userhandle, write_modeldata, maxlen)) && (ncols >= 1)) write_data(userhandle, write_modeldata, "0 %s", get_col_name(lp, 1)); if(lp->orig_upbo[j] == 0) write_data(userhandle, write_modeldata, " ="); else if(is_chsign(lp, j)) write_data(userhandle, write_modeldata, " >="); else write_data(userhandle, write_modeldata, " <="); if(fabs(get_rh(lp, j) + lp->infinite) < 1) write_data(userhandle, write_modeldata, " -Inf;/n"); else if(fabs(get_rh(lp, j) - lp->infinite) < 1) write_data(userhandle, write_modeldata, " +Inf;/n"); else write_data(userhandle, write_modeldata, " %.12g;/n", get_rh(lp, j));#ifdef SingleBoundedRowInLP /* Write the ranged part of the constraint, if specified */ if ((lp->orig_upbo[j]) && (lp->orig_upbo[j] < lp->infinite)) { if(((lp->names_used) && (lp->row_name[j] != NULL)) || (write_lprow(lp, j, userhandle, NULL, maxlen) == 1)) ptr = get_row_name(lp, j); else ptr = NULL; if((ptr != NULL) && (*ptr)) write_data(userhandle, write_modeldata, "%s: ", ptr); if((!write_lprow(lp, j, userhandle, write_modeldata, maxlen)) && (get_Ncolumns(lp) >= 1)) write_data(userhandle, write_modeldata, "0 %s", get_col_name(lp, 1)); write_data(userhandle, write_modeldata, " %s %g;/n", (is_chsign(lp, j)) ? "<=" : ">=", (lp->orig_upbo[j]-lp->orig_rhs[j]) * (is_chsign(lp, j) ? 1.0 : -1.0) / (lp->scaling_used ? lp->scalars[j] : 1.0)); }#endif } /* Write bounds on variables *///.........这里部分代码省略.........
开发者ID:bakhansen,项目名称:service-technology.org,代码行数:101,
示例4: command_liststatic void command_list(void){ write_command(ILI9341_PWCTRB); write_data(0x00); write_data(0XC1); write_data(0X30); write_command(ILI9341_TIMCTRA); write_data(0x85); write_data(0x00); write_data(0x78); write_command(ILI9341_PWCTRSEQ); write_data(0x39); write_data(0x2C); write_data(0x00); write_data(0x34); write_data(0x02); write_command(ILI9341_PUMP); write_data(0x20); write_command(ILI9341_TIMCTRB); write_data(0x00); write_data(0x00); write_command(ILI9341_PWCTR1); write_data(0x23); write_command(ILI9341_PWCTR2); write_data(0x10); write_command(ILI9341_VMCTR1); write_data(0x3e); write_data(0x28); write_command(ILI9341_VMCTR2); write_data(0x86); write_command(ILI9341_MADCTL); write_data(0x48); write_command(ILI9341_PIXFMT); write_data(0x55); write_command(ILI9341_FRMCTR1); write_data(0x00); write_data(0x18); write_command(ILI9341_DFUNCTR); write_data(0x08); write_data(0x82); write_data(0x27); write_command(ILI9341_ENGMCTR); write_data(0x00); write_command(ILI9341_GAMMASET); write_data(0x01); write_command(ILI9341_GMCTRP1); write_data(0x0F); write_data(0x31); write_data(0x2B); write_data(0x0C); write_data(0x0E); write_data(0x08); write_data(0x4E); write_data(0xF1); write_data(0x37); write_data(0x07); write_data(0x10); write_data(0x03); write_data(0x0E); write_data(0x09); write_data(0x00); write_command(ILI9341_GMCTRN1); write_data(0x00); write_data(0x0E); write_data(0x14); write_data(0x03); write_data(0x11); write_data(0x07); write_data(0x31); write_data(0xC1); write_data(0x48); write_data(0x08); write_data(0x0F); write_data(0x0C); write_data(0x31); write_data(0x36); write_data(0x0F); write_command(ILI9341_SLPOUT); nrf_delay_ms(120); write_command(ILI9341_DISPON);}
开发者ID:TanekLiang,项目名称:rt-thread,代码行数:98,
示例5: do_workvoiddo_work(unsigned int start){ unsigned int stack_array[STACK_ARRAY_ELEMS]; unsigned int i = 0; unsigned int array1_start = start; unsigned int array2_start = start + (ELEMS / (ELEMS_PER_PAGE)) + 10; printf("Checking uninitialized array1/n"); /* check the uninitialized array1 before initialization */ for (i=0; i<ELEMS; i++) { if (array1[i] != 0) { printf("FAILED in file %s at line %d: array1[%d] = %u != %d/n", __FILE__, __LINE__, i, array1[i], 0); exit(1); } } printf("Checking uninitialized array2/n"); /* check the uninitialized array2 before initialization */ for (i=0; i<ELEMS; i++) { if (array2[i] != 0) { printf("FAILED in file %s at line %d: array2[%d] = %u != %d/n", __FILE__, __LINE__, i, array2[i], 0); exit(1); } } for (i=0; i<STACK_ARRAY_ELEMS; i++) { stack_array[i] = i * 1000; } for (i=0; i<2; i++) { call_all(); write_data(array1, array1_start); call_all(); printf("Checking initialized array1/n"); read_data(array1, array1_start, "array1"); } /* check the uninitialized array2 again before initialization */ printf("Checking initialized array2 again/n"); for (i=0; i<ELEMS; i++) { if (array2[i] != 0) { printf("FAILED in file %s at line %d: array2[%d] = %u != %d/n", __FILE__, __LINE__, i, array2[i], 0); exit(1); } } printf("Checking initialized stack_array/n"); for (i=0; i<STACK_ARRAY_ELEMS; i++) { if (stack_array[i] != i * 1000) { printf("FAILED in file %s at line %d: stack_array[%d] = %u != %d/n", __FILE__, __LINE__, i, stack_array[i], i); exit(1); } } printf("Checking initialized init/n"); /* check the initialized array */ for (i=0; i<INIT_ARRAY_ELEMS; i++) { if (init[i] != i) { printf("FAILED in file %s at line %d: init[%d] = %u != %d/n", __FILE__, __LINE__, i, init[i], i); exit(1); } } for (i=0; i<2; i++) { call_all(); write_data(array2, array2_start); call_all(); printf("Checking initialized array2/n"); read_data(array2, array2_start, "array2"); } printf("Checking initialized stack_array/n"); for (i=0; i<STACK_ARRAY_ELEMS; i++) { if (stack_array[i] != i * 1000) { printf("FAILED in file %s at line %d: stack_array[%d] = %u != %d/n", __FILE__, __LINE__, i, stack_array[i], i); exit(1); } } /* check the initialized array */ printf("Checking initialized init/n"); for (i=0; i<INIT_ARRAY_ELEMS; i++) { if (init[i] != i) { printf("FAILED in file %s at line %d: init[%d] = %u != %d/n", __FILE__, __LINE__, i, init[i], i); exit(1); } } printf("Checking initialized array1 for the last time/n"); read_data(array1, array1_start, "array1"); printf("Checking initialized array2 for the last time/n"); read_data(array2, array2_start, "array2"); printf("SUCCEEDED/n");}
开发者ID:PhelanHarris,项目名称:os161,代码行数:98,
示例6: kcs_event//.........这里部分代码省略......... kcs->state = KCS_WAIT_WRITE_END; } else { write_next_byte(kcs); } break; case KCS_WAIT_WRITE_END: if (state != KCS_WRITE_STATE) { start_error_recovery(kcs, "Not in write state for write end"); break; } clear_obf(kcs, status); write_next_byte(kcs); kcs->state = KCS_WAIT_READ; break; case KCS_WAIT_READ: if ((state != KCS_READ_STATE) && (state != KCS_IDLE_STATE)) { start_error_recovery( kcs, "Not in read or idle in read state"); break; } if (state == KCS_READ_STATE) { if (! check_obf(kcs, status, time)) return KCS_CALL_WITH_DELAY; read_next_byte(kcs); } else { /* We don't implement this exactly like the state machine in the spec. Some broken hardware does not write the final dummy byte to the read register. Thus obf will never go high here. We just go straight to idle, and we handle clearing out obf in idle state if it happens to come in. */ clear_obf(kcs, status); kcs->orig_write_count = 0; kcs->state = KCS_IDLE; return KCS_TRANSACTION_COMPLETE; } break; case KCS_ERROR0: clear_obf(kcs, status); write_cmd(kcs, KCS_GET_STATUS_ABORT); kcs->state = KCS_ERROR1; break; case KCS_ERROR1: clear_obf(kcs, status); write_data(kcs, 0); kcs->state = KCS_ERROR2; break; case KCS_ERROR2: if (state != KCS_READ_STATE) { start_error_recovery(kcs, "Not in read state for error2"); break; } if (! check_obf(kcs, status, time)) return KCS_CALL_WITH_DELAY; clear_obf(kcs, status); write_data(kcs, KCS_READ_BYTE); kcs->state = KCS_ERROR3; break; case KCS_ERROR3: if (state != KCS_IDLE_STATE) { start_error_recovery(kcs, "Not in idle state for error3"); break; } if (! check_obf(kcs, status, time)) return KCS_CALL_WITH_DELAY; clear_obf(kcs, status); if (kcs->orig_write_count) { restart_kcs_transaction(kcs); } else { kcs->state = KCS_IDLE; return KCS_TRANSACTION_COMPLETE; } break; case KCS_HOSED: break; } if (kcs->state == KCS_HOSED) { init_kcs_data(kcs, kcs->port, kcs->addr); return KCS_SM_HOSED; } return KCS_CALL_WITHOUT_DELAY;}
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:101,
示例7: write_key_init/* * move the file pointer to the point where the next key can be written and return * that offset */intwrite_key_init(int fd, UINT32 pub_data_size, UINT32 blob_size, UINT32 vendor_data_size){ UINT32 num_keys; BYTE version; int rc, offset; /* seek to the PS version */ rc = lseek(fd, TSSPS_VERSION_OFFSET, SEEK_SET); if (rc == ((off_t) - 1)) { LogError("lseek: %s", strerror(errno)); return -1; } /* go to NUM_KEYS */ rc = lseek(fd, TSSPS_NUM_KEYS_OFFSET, SEEK_SET); if (rc == ((off_t) - 1)) { LogError("lseek: %s", strerror(errno)); return -1; } /* read the number of keys */ rc = read(fd, &num_keys, sizeof(UINT32)); num_keys = LE_32(num_keys); if (rc == -1) { LogError("read of %zd bytes: %s", sizeof(UINT32), strerror(errno)); return -1; } else if (rc == 0) { /* This is the first key being written */ num_keys = 1; version = 1; /* seek to the PS version */ rc = lseek(fd, TSSPS_VERSION_OFFSET, SEEK_SET); if (rc == ((off_t) - 1)) { LogError("lseek: %s", strerror(errno)); return -1; } /* write out the version info byte */ if ((rc = write_data(fd, &version, sizeof(BYTE)))) { LogError("%s", __FUNCTION__); return rc; } rc = lseek(fd, TSSPS_NUM_KEYS_OFFSET, SEEK_SET); if (rc == ((off_t) - 1)) { LogError("lseek: %s", strerror(errno)); return -1; } num_keys = LE_32(num_keys); if ((rc = write_data(fd, &num_keys, sizeof(UINT32)))) { LogError("%s", __FUNCTION__); return rc; } /* return the offset */ return (TSSPS_NUM_KEYS_OFFSET + sizeof(UINT32)); } /* if there is a hole in the file we can write to, find it */ offset = find_write_offset(pub_data_size, blob_size, vendor_data_size); if (offset != -1) { /* we found a hole, seek to it and don't increment the # of keys on disk */ rc = lseek(fd, offset, SEEK_SET); } else { /* we didn't find a hole, increment the number of keys on disk and seek * to the end of the file */ num_keys++; /* go to the beginning */ rc = lseek(fd, TSSPS_NUM_KEYS_OFFSET, SEEK_SET); if (rc == ((off_t) - 1)) { LogError("lseek: %s", strerror(errno)); return -1; } num_keys = LE_32(num_keys); if ((rc = write_data(fd, &num_keys, sizeof(UINT32)))) { LogError("%s", __FUNCTION__); return rc; } rc = lseek(fd, 0, SEEK_END); } if (rc == ((off_t) - 1)) { LogError("lseek: %s", strerror(errno)); return -1; } /* lseek returns the number of bytes of offset from the beginning of the file */ return rc;}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:99,
示例8: lcd_initialvoid lcd_initial(){ int i; // hard reset for (i=0; i<120; i++) SPI_LCD_REST_LOW(); for (i=0; i<120; i++) SPI_LCD_REST_HIGH(); //-------------------Software Reset-------------------------------// write_command(0x11);//Sleep exit //ST7735R Frame Ratewrite_command(0xB1); write_data(0x01); write_data(0x2C); write_data(0x2D); write_command(0xB2); write_data(0x01); write_data(0x2C); write_data(0x2D); write_command(0xB3); write_data(0x01); write_data(0x2C); write_data(0x2D); write_data(0x01); write_data(0x2C); write_data(0x2D); write_command(0xB4); //Column inversion write_data(0x07); //ST7735R Power Sequencewrite_command(0xC0); write_data(0xA2); write_data(0x02); write_data(0x84); write_command(0xC1); write_data(0xC5); write_command(0xC2); write_data(0x0A); write_data(0x00); write_command(0xC3); write_data(0x8A); write_data(0x2A); write_command(0xC4); write_data(0x8A); write_data(0xEE); write_command(0xC5); //VCOM write_data(0x0E); write_command(0x36); //MX, MY, RGB mode #if ROTATION == 90write_data(0xa0 | SBIT_RGB);#elif ROTATION == 180write_data(0xc0 | SBIT_RGB); #elif ROTATION == 270write_data(0x60 | SBIT_RGB); #elsewrite_data(0x00 | SBIT_RGB); #endif#if ROTATION == 90 || ROTATION == 270write_command(0x2a);write_data(0x00);write_data(0x00);write_data(0x00);write_data(0x9f);write_command(0x2b);write_data(0x00);write_data(0x00);write_data(0x00);write_data(0x7f);#elsewrite_command(0x2a);write_data(0x00);write_data(0x00);write_data(0x00);write_data(0x7f);write_command(0x2b);write_data(0x00);write_data(0x00);write_data(0x00);write_data(0x9f);#endif//ST7735R Gamma Sequencewrite_command(0xe0); write_data(0x0f); write_data(0x1a); write_data(0x0f); write_data(0x18); write_data(0x2f); write_data(0x28); write_data(0x20); write_data(0x22); write_data(0x1f); write_data(0x1b); write_data(0x23); write_data(0x37); write_data(0x00); write_data(0x07); write_data(0x02); write_data(0x10); write_command(0xe1); write_data(0x0f); write_data(0x1b); write_data(0x0f); write_data(0x17); write_data(0x33); write_data(0x2c); write_data(0x29); write_data(0x2e); write_data(0x30); write_data(0x30); write_data(0x39); write_data(0x3f); write_data(0x00); write_data(0x07); write_data(0x03); write_data(0x10); write_command(0xF0); //Enable test command write_data(0x01); write_command(0xF6); //Disable ram power save mode write_data(0x00); write_command(0x3A); //65k mode write_data(0x05); //.........这里部分代码省略.........
开发者ID:Blade87,项目名称:contiki-stm32f10x-iar,代码行数:101,
示例9: write_itemvoid write_item(uint8_t *buf){ write_data(buf+1, buf[0]);}
开发者ID:grfrost,项目名称:fpgajtag,代码行数:4,
示例10: RequestMonitoredPagesvoid RequestMonitoredPages(void){ DIR *dir; struct dirent* ent; /* Open the monitor subdirectory. */ if(chdir("monitor")) {PrintMessage(Warning,"Cannot change to directory 'monitor'; [%!s] no files monitored.");return;} dir=opendir("."); if(!dir) {PrintMessage(Warning,"Cannot open directory 'monitor'; [%!s] no files monitored.");ChangeBackToSpoolDir();return;} ent=readdir(dir); if(!ent) {PrintMessage(Warning,"Cannot read directory 'monitor'; [%!s] no files monitored.");closedir(dir);ChangeBackToSpoolDir();return;} /* Scan through all of the files. */ do { struct stat buf; if(ent->d_name[0]=='.' && (ent->d_name[1]==0 || (ent->d_name[1]=='.' && ent->d_name[2]==0))) continue; /* skip . & .. */ if(stat(ent->d_name,&buf)) {PrintMessage(Inform,"Cannot stat file 'monitor/%s'; [%!s] race condition?",ent->d_name);return;} else if(S_ISREG(buf.st_mode) && *ent->d_name=='O') { URL *Url=FileNameToURL(ent->d_name); int last,next; ChangeBackToSpoolDir(); if(!Url) continue; MonitorTimes(Url,&last,&next); PrintMessage(Debug,"Monitoring '%s' last=%dh next=%dh => %s",Url->name,last,next,next?"No":"Yes"); chdir("monitor"); if(next==0) { int ifd=open(ent->d_name,O_RDONLY|O_BINARY); if(ifd==-1) PrintMessage(Warning,"Cannot open monitored file 'monitor/%s' to read; [%!s].",ent->d_name); else { int ofd; init_io(ifd); ChangeBackToSpoolDir(); ofd=OpenNewOutgoingSpoolFile(); if(ofd==-1) PrintMessage(Warning,"Cannot open outgoing spool file for monitored URL '%s'; [%!s].",Url->name); else { char *contents=(char*)malloc(buf.st_size+1); init_io(ofd); read_data(ifd,contents,buf.st_size); if(write_data(ofd,contents,buf.st_size)==-1) PrintMessage(Warning,"Cannot write to outgoing file; disk full?"); finish_io(ofd); CloseNewOutgoingSpoolFile(ofd,Url); free(contents); } chdir("monitor"); finish_io(ifd); close(ifd); if(utime(URLToFileName(Url,'M',0),NULL)) PrintMessage(Warning,"Cannot change timestamp of monitored file 'monitor/%s'; [%!s].",URLToFileName(Url,'M',0)); } } FreeURL(Url); } } while((ent=readdir(dir))); ChangeBackToSpoolDir(); closedir(dir);}
开发者ID:metux,项目名称:wwwoffle,代码行数:98,
示例11: mainint main(int argc, char *argv[]){ DWORD status = 0; DWORD errorstatus = 0; string error_str; scu_mil myscu;/* int test = 0; BYTE blub = 0x38; cin>>hex>>test; printf("test 0x%x /n", (unsigned char)test); cout<<"HEX :"<<hex<<test<<endl; cout<<"DEC :"<<dec<<test<<endl; cout<<"BYTE HEX :"<<hex<<char(test)<<endl; cout<<"BYTE DEC :"<<dec<<BYTE(test)<<endl; //blub = test; cout<<"HEX blub: "<<hex<<blub<<endl;*/ if(argc == 1){ cout<<"No target device defined !"<<endl; cout<<"example : scumil tcp/scuxl0089.acc"<<endl; cout<<"end"<<endl; return 0; } int choice = 0; bool run = true; // generator starten srand((unsigned)time(NULL));// status = myscu.scu_milbusopen("tcp/scuxl0089.acc", errorstatus); status = myscu.scu_milbusopen(argv[1], errorstatus); error_str = myscu.scu_milerror(status); cout <<"open scu : "<<error_str<<endl; if (status != status_ok){ return 0; } // ------------------------- do{ choice = print_menue(); switch (choice) { case 1: scan_milbus_loop(myscu); break; case 2: write_data(myscu); break; case 3: write_cmd(myscu); break; case 4: read_data(myscu); break; case 5: write_ifk(myscu); break; case 6: read_ifk(myscu); break; case 7: cout<<endl<<"IFKs online:"<<endl; cout<<"----------------"<<endl; echo_test(myscu,choose_ifk(myscu)); break; default : run = false; break; } }while (run); // ------------------------- status = myscu.scu_milbusclose(errorstatus); error_str = myscu.scu_milerror(status); cout <<"close scu : "<<error_str<<endl; return 0;}
开发者ID:zweig1971,项目名称:scu_mil,代码行数:89,
示例12: main//.........这里部分代码省略......... vect_free(subdispdt); } /* Allocate our data array and start getting data */ if (myid == 0) { printf("De-dispersing using %d subbands./n", cmd->nsub); if (cmd->downsamp > 1) printf("Downsampling by a factor of %d (new dt = %.10g)/n", cmd->downsamp, dsdt); printf("/n"); } /* Print the nodes and the DMs they are handling */ print_dms(hostname, myid, numprocs, local_numdms, dms); outdata = gen_fmatrix(local_numdms, worklen / cmd->downsamp); numread = get_data(outdata, blocksperread, &s, &obsmask, idispdt, offsets, &padding); while (numread == worklen) { numread /= cmd->downsamp; if (myid == 0) print_percent_complete(totwrote, totnumtowrite); /* Write the latest chunk of data, but don't */ /* write more than cmd->numout points. */ numtowrite = numread; if (cmd->numoutP && (totwrote + numtowrite) > cmd->numout) numtowrite = cmd->numout - totwrote; if (myid > 0) { write_data(outfiles, local_numdms, outdata, 0, numtowrite); /* Update the statistics */ if (!padding) { for (ii = 0; ii < numtowrite; ii++) update_stats(statnum + ii, outdata[0][ii], &min, &max, &avg, &var); statnum += numtowrite; } } totwrote += numtowrite; /* Stop if we have written out all the data we need to */ if (cmd->numoutP && (totwrote == cmd->numout)) break; numread = get_data(outdata, blocksperread, &s, &obsmask, idispdt, offsets, &padding); } datawrote = totwrote; } else { /* Main loop if we are barycentering... */ /* What ephemeris will we use? (Default is DE200) */ if (cmd->de405P) strcpy(ephem, "DE405"); else strcpy(ephem, "DE200"); /* Define the RA and DEC of the observation */ ra_dec_to_string(rastring, idata.ra_h, idata.ra_m, idata.ra_s); ra_dec_to_string(decstring, idata.dec_d, idata.dec_m, idata.dec_s);
开发者ID:cptwin,项目名称:presto,代码行数:67,
示例13: mifare_desfire_write_record_exssize_tmifare_desfire_write_record_ex (MifareTag tag, uint8_t file_no, off_t offset, size_t length, void *data, int cs){ return write_data (tag, 0x3B, file_no, offset, length, data, cs);}
开发者ID:jrayner,项目名称:bv_embedded,代码行数:5,
示例14: fd_read_body//.........这里部分代码省略......... if (fd_read_line (fd) == NULL) ret = -1; break; } } rdsize = MIN (remaining_chunk_size, dlbufsize); } else rdsize = exact ? MIN (toread - sum_read, dlbufsize) : dlbufsize; if (progress_interactive) { /* For interactive progress gauges, always specify a ~1s timeout, so that the gauge can be updated regularly even when the data arrives very slowly or stalls. */ tmout = 0.95; if (opt.read_timeout) { double waittm; waittm = ptimer_read (timer) - last_successful_read_tm; if (waittm + tmout > opt.read_timeout) { /* Don't let total idle time exceed read timeout. */ tmout = opt.read_timeout - waittm; if (tmout < 0) { /* We've already exceeded the timeout. */ ret = -1, errno = ETIMEDOUT; break; } } } } ret = fd_read (fd, dlbuf, rdsize, tmout); if (progress_interactive && ret < 0 && errno == ETIMEDOUT) ret = 0; /* interactive timeout, handled above */ else if (ret <= 0) break; /* EOF or read error */ if (progress || opt.limit_rate || elapsed) { ptimer_measure (timer); if (ret > 0) last_successful_read_tm = ptimer_read (timer); } if (ret > 0) { sum_read += ret; if (!write_data (out, dlbuf, ret, &skip, &sum_written)) { ret = -2; goto out; } if (chunked) { remaining_chunk_size -= ret; if (remaining_chunk_size == 0) if (fd_read_line (fd) == NULL) { ret = -1; break; } } } if (opt.limit_rate) limit_bandwidth (ret, timer); if (progress) progress_update (progress, ret, ptimer_read (timer));#ifdef WINDOWS if (toread > 0 && !opt.quiet) ws_percenttitle (100.0 * (startpos + sum_read) / (startpos + toread));#endif } if (ret < -1) ret = -1; out: if (progress) progress_finish (progress, ptimer_read (timer)); if (elapsed) *elapsed = ptimer_read (timer); if (timer) ptimer_destroy (timer); if (qtyread) *qtyread += sum_read; if (qtywritten) *qtywritten += sum_written; free (dlbuf); return ret;}
开发者ID:BrowenChen,项目名称:startupEngineering,代码行数:101,
示例15: relay_traffic//.........这里部分代码省略......... rc = set_timeouts( ssockfd, dsockfd, ctx->rcv_tmout, 0, ctx->snd_tmout, 0 ); if( 0 != rc ) break; } if( dsockfd > 0 ) { rc = sync_dsockbuf_len( ssockfd, dsockfd ); if( 0 != rc ) break; rc = send_http_response( dsockfd, 200, "OK" ); if( 0 != rc ) break; /* timeshift: to detect PAUSE make destination * socket non-blocking, otherwise make it blocking * (since it might have been set unblocking earlier) */ rc = set_nblock( dsockfd, (ALLOW_PAUSES ? 1 : 0) ); if( 0 != rc ) break; } data = malloc(data_len); if( NULL == data ) { mperror( g_flog, errno, "%s: malloc", __func__ ); break; } if( g_uopt.cl_tpstat ) tpstat_init( &tps, SET_PID ); } while(0); TRACE( (void)tmfprintf( g_flog, "Relaying traffic from socket[%d] " "to socket[%d], buffer size=[%d], Rmsgs=[%d], pauses=[%d]/n", ssockfd, dsockfd, data_len, g_uopt.rbuf_msgs, ALLOW_PAUSES) ); /* RELAY LOOP */ ropt.max_frgs = g_uopt.rbuf_msgs; ropt.buf_tmout = g_uopt.dhold_tmout; pause_time = 0; while( (0 == rc) && !(quit = must_quit()) ) { if( g_uopt.mcast_refresh > 0 ) { check_mcast_refresh( ssockfd, &rfr_tm, mifaddr ); } nrcv = read_data( &ds, ssockfd, data, data_len, &ropt ); if( -1 == nrcv ) break; TRACE( check_fragments( "received new", data_len, lrcv, nrcv, t_delta, g_flog ) ); lrcv = nrcv; if( dsockfd && (nrcv > 0) ) { nsent = write_data( &ds, data, nrcv, dsockfd ); if( -1 == nsent ) break; if ( nsent < 0 ) { if ( !ALLOW_PAUSES ) break; if ( 0 != pause_detect( nsent, MAX_PAUSE_MSEC, &pause_time ) ) break; } TRACE( check_fragments("sent", nrcv, lsent, nsent, t_delta, g_flog) ); lsent = nsent; } if( (dfilefd > 0) && (nrcv > 0) ) { nwr = write_data( &ds, data, nrcv, dfilefd ); if( -1 == nwr ) break; TRACE( check_fragments( "wrote to file", nrcv, lsent, nwr, t_delta, g_flog ) ); lsent = nwr; } if( ds.flags & F_SCATTERED ) reset_pkt_registry( &ds ); if( uf_TRUE == g_uopt.cl_tpstat ) tpstat_update( ctx, &tps, nsent ); } /* end of RELAY LOOP */ /* CLEANUP */ TRACE( (void)tmfprintf( g_flog, "Exited relay loop: received=[%ld], " "sent=[%ld], quit=[%ld]/n", (long)nrcv, (long)nsent, (long)quit ) ); free_dstream_ctx( &ds ); if( NULL != data ) free( data ); if( 0 != (quit = must_quit()) ) { TRACE( (void)tmfprintf( g_flog, "Child process=[%d] must quit/n", getpid()) ); } return rc;}
开发者ID:Tarydium,项目名称:udpxy,代码行数:101,
示例16: read_satpower//.........这里部分代码省略......... for (b=1; b<513; b++) { fscanf(satpowerfile, "%f %f %f %f", &fftbin1[b], &fftbin2[b], &fftbin3[b], &fftbin4[b]); aq.tot1 += fftbin1[b]*fftbin1[b]; aq.tot2 += fftbin2[b]*fftbin2[b]; aq.tot3 += fftbin3[b]*fftbin3[b]; aq.tot4 += fftbin4[b]*fftbin4[b]; } // prepare data for storage // printf("Preparing data storage .../n"); aq.dyear=dyear; aq.month = month; aq.day = date; aq.hour = hour; aq.min = minute; aq.sec = second; for (j=1; j<(totsatpassid+1); j++){ // for all sats for (k=1; k<i; k++){ // for all passes // check if the current time is between the pass start and end time if ((dyear>satpasses[j].wstart) && (dyear< satpasses[j].wstop) && (satpasses[j].satid==satinfo[k].satnum)){ aq.satfmnum=satinfo[k].satnum; aq.satorbitnum=satinfo[k].orbitnum; aq.meananom=satinfo[k].meananom; sprintf(aq.station, "GB"); aq.azimuth=satinfo[k].azimuth; aq.elevation=satinfo[k].elevation; aq.range=satinfo[k].range; aq.satchannel=satpasses[j].chan; centerbin = (int)((float) aq.satchannel*2.5*512/1000); aq.fftbincenter=centerbin; aq.bin1[1]=fftbin1[centerbin-3]; aq.bin1[2]=fftbin1[centerbin-2]; aq.bin1[3]=fftbin1[centerbin-1]; aq.bin1[4]=fftbin1[centerbin]; aq.bin1[5]=fftbin1[centerbin+1]; aq.bin1[6]=fftbin1[centerbin+2]; aq.bin1[7]=fftbin1[centerbin+3]; aq.bin2[1]=fftbin2[centerbin-3]; aq.bin2[2]=fftbin2[centerbin-2]; aq.bin2[3]=fftbin2[centerbin-1]; aq.bin2[4]=fftbin2[centerbin]; aq.bin2[5]=fftbin2[centerbin+1]; aq.bin2[6]=fftbin2[centerbin+2]; aq.bin2[7]=fftbin2[centerbin+3]; aq.bin3[1]=fftbin3[centerbin-3]; aq.bin3[2]=fftbin3[centerbin-2]; aq.bin3[3]=fftbin3[centerbin-1]; aq.bin3[4]=fftbin3[centerbin]; aq.bin3[5]=fftbin3[centerbin+1]; aq.bin3[6]=fftbin3[centerbin+2]; aq.bin3[7]=fftbin3[centerbin+3]; aq.bin4[1]=fftbin4[centerbin-3]; aq.bin4[2]=fftbin4[centerbin-2]; aq.bin4[3]=fftbin4[centerbin-1]; aq.bin4[4]=fftbin4[centerbin]; aq.bin4[5]=fftbin4[centerbin+1]; aq.bin4[6]=fftbin4[centerbin+2]; aq.bin4[7]=fftbin4[centerbin+3]; write_data(); channel1=0; channel2=0; channel3=0; channel4=0; for (n=1; n<8; n++) channel1=channel1+aq.bin1[n]; for (n=1; n<8; n++) channel2=channel2+aq.bin2[n]; for (n=1; n<8; n++) channel3=channel3+aq.bin3[n]; for (n=1; n<8; n++) channel4=channel4+aq.bin4[n]; azIndex=(int) rintf(10*aq.azimuth); elIndex=(int) rintf(10*aq.elevation); //printf("%d %d/n", azIndex, elIndex); mapAzimuth[azIndex].ratio1[elIndex]=(channel1*channel1/(50*2))/(channel2*channel2/(50*2)); mapAzimuth[azIndex].ratio2[elIndex]=(channel3*channel3/(50*2))/(channel4*channel4/(50*2)); // printf("Processing satellite %d /n", satinfo[k].satnum); } } } } fclose(satpowerfile); return 0;}
开发者ID:abrahamneben,项目名称:orbcomm_beam_mapping,代码行数:101,
示例17: write_next_bytestatic inline void write_next_byte(struct kcs_data *kcs){ write_data(kcs, kcs->write_data[kcs->write_pos]); (kcs->write_pos)++; (kcs->write_count)--;}
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:6,
示例18: assembleconstsize_t assemble( uint8_t *const bytecode, const size_t bytecode_sz, const char *const assembly, const size_t asm_sz){ char path[PATH_MAX]; snprintf(path, sizeof(path), "/tmp/rappel-input.XXXXXX"); const int t = mkstemp(path); if (t == -1) { perror("mkstemp"); exit(EXIT_FAILURE); } REQUIRE (unlink(path) == 0); dprintf(t, BITSTR); dprintf(t, "section .text vstart=%ld/n", options.start); write_data(t, (uint8_t *)assembly, asm_sz); int fildes[2]; REQUIRE (pipe(fildes) == 0); const pid_t asm_pid = fork(); if (asm_pid < 0) { perror("fork"); exit(EXIT_FAILURE); } else if (asm_pid == 0) { _child(fildes, t); // Not reached abort(); } verbose_printf("nasm is pid %d/n", asm_pid); REQUIRE (close(fildes[1]) == 0); mem_assign(bytecode, bytecode_sz, TRAP, TRAP_SZ); size_t sz = read_data(fildes[0], bytecode, bytecode_sz); if (sz >= bytecode_sz) { fprintf(stderr, "Too much bytecode to handle, exiting.../n"); exit(EXIT_FAILURE); } int status; REQUIRE (waitpid(asm_pid, &status, 0) != -1); if (WIFSIGNALED(status)) fprintf(stderr, "nasm exited with signal %d./n", WTERMSIG(status)); else if (WIFEXITED(status) && WEXITSTATUS(status)) fprintf(stderr, "nasm exited %d./n", WEXITSTATUS(status)); REQUIRE (close(t) == 0); return sz;}
开发者ID:SRI-CSL,项目名称:ripple,代码行数:63,
示例19: cdoInitializevoid *Importobs(void *argument){ int operatorID; char line[MAX_LINE_LEN]; int streamID; int tsID; int gridID, zaxisID, taxisID, vlistID; int i, j; int nvars = MAX_VARS; int vdate = 0, vtime = 0; int vdate0 = 0, vtime0 = 0; int gridsize, xsize, ysize; double *xvals = NULL, *yvals = NULL; double *data[MAX_VARS]; FILE *fp; char dummy[32], station[32], datetime[32]; float lat, lon, height1, pressure, height2, value; double latmin = 90, latmax = -90, lonmin = 360, lonmax = -360; int code; int index; double dx, dy; char *pstation; cdoInitialize(argument); cdoOperatorAdd("import_obs", 0, 0, "grid description file or name"); operatorID = cdoOperatorID(); operatorInputArg(cdoOperatorEnter(operatorID)); gridID = cdoDefineGrid(operatorArgv()[0]); if ( gridInqType(gridID) != GRID_LONLAT ) cdoAbort("Unsupported grid type: %s", gridNamePtr(gridInqType(gridID))); gridsize = gridInqSize(gridID); xsize = gridInqXsize(gridID); ysize = gridInqYsize(gridID); // printf("gridsize=%d, xsize=%d, ysize=%d/n", gridsize, xsize, ysize); xvals = (double*) malloc(gridsize*sizeof(double)); yvals = (double*) malloc(gridsize*sizeof(double)); gridInqXvals(gridID, xvals); gridInqYvals(gridID, yvals); /* Convert lat/lon units if required */ { char units[CDI_MAX_NAME]; gridInqXunits(gridID, units); grid_to_degree(units, gridsize, xvals, "grid center lon"); gridInqYunits(gridID, units); grid_to_degree(units, gridsize, yvals, "grid center lat"); } fp = fopen(cdoStreamName(0)->args, "r"); if ( fp == NULL ) { perror(cdoStreamName(0)->args); exit(EXIT_FAILURE); } vdate = getDate(cdoStreamName(0)->args); if ( vdate <= 999999 ) vdate = vdate*100 + 1; streamID = streamOpenWrite(cdoStreamName(1), cdoFiletype()); zaxisID = zaxisCreate(ZAXIS_SURFACE, 1); taxisID = taxisCreate(TAXIS_ABSOLUTE); vlistID = vlistCreate(); vlistDefTaxis(vlistID, taxisID); { for ( i = 0; i < nvars; ++i ) data[i] = (double*) malloc(gridsize*sizeof(double)); init_vars(vlistID, gridID, zaxisID, nvars); streamDefVlist(streamID, vlistID); vdate0 = 0; vtime0 = 0; //ntime = 0; tsID = 0; while ( readline(fp, line, MAX_LINE_LEN) ) { sscanf(line, "%s %s %s %g %g %g %d %g %g %g", dummy, station, datetime, &lat, &lon, &height1, &code, &pressure, &height2, &value); sscanf(datetime, "%d_%d", &vdate, &vtime); if ( vdate != vdate0 || vtime != vtime0 ) { if ( tsID > 0 ) write_data(streamID, vlistID, nvars, data); vdate0 = vdate; vtime0 = vtime; /* printf("%s %d %d %g %g %g %d %g %g %g/n", station, vdate, vtime, lat, lon, height1, code, pressure, height2, value); */ taxisDefVdate(taxisID, vdate);//.........这里部分代码省略.........
开发者ID:AZed,项目名称:cdo,代码行数:101,
示例20: mainint main(int argc,char *argv[]){ if(argc<2) { fprintf(stderr,"usage:%s port/n",argv[0]); exit(1); } // 创建一个socket套接字 sockfd=socket(AF_INET,SOCK_STREAM,0); // AF_INET表示使用IPv4地址族(AF_INET6表示使用IPv6地址族) // SOCK_STREAM是数据流(tcp协议);若传递报文则是udp协议 // 0由tcp决定 if(sockfd<0) { fprintf(stderr,"socket:%s/n",strerror(errno)); exit(1); } // 设置ip和端口号 struct sockaddr_in addr; memset(&addr,0,sizeof(addr)); // 目的:把ip地址中的后8个字节置为0 addr.sin_family=AF_INET; addr.sin_port=htons(atoi(argv[1]));// argv[1]是传入的端口地址,atio将其转为整形,htons将这个整形转为网络字节序 addr.sin_addr.s_addr=INADDR_ANY; // INADDR_ANY是本地的一个宏,代表本地回环地址的网络字节序 //绑定ip和端口号 int len=sizeof(addr); if(bind(sockfd,(struct sockaddr*)&addr,len)<0) { fprintf(stderr,"bind:%s/n",strerror(errno)); exit(1); } // 开始监听 if(listen(sockfd,10)<0) // 10 代表客户端的个数,假定有10个 { fprintf(stderr,"listen:%s/n",strerror(errno)); exit(1); } while(1) // 循环获取监听对象 { struct sockaddr_in client_addr; int c_len=sizeof(client_addr); int fd=accept(sockfd,(struct sockaddr*)&client_addr,&len); // 返回一个文件描述符 if(fd<0) { fprintf(stderr,"accept:%s/n",strerror(errno)); continue; } print_client_information(client_addr); // 将客户端的连接信息打印出来 write_data(fd);//向fd中写入要传入的信息 close(fd); } return 0;}
开发者ID:crazyacking,项目名称:notes,代码行数:62,
示例21: write_lpcommentSTATIC void write_lpcomment(void *userhandle, write_modeldata_func write_modeldata, char *string, MYBOOL newlinebefore){ write_data(userhandle, write_modeldata, "%s/* %s *//n", (newlinebefore) ? "/n" : "", string);}
开发者ID:bakhansen,项目名称:service-technology.org,代码行数:4,
示例22: write_bufferstatic void write_buffer( filter_t *p_filter, block_t *p_in_buf ){ write_data( p_filter, p_in_buf->p_buffer, p_in_buf->i_buffer, is_big_endian( p_filter, p_in_buf ) ); p_filter->p_sys->p_out_buf->i_length += p_in_buf->i_length;}
开发者ID:IAPark,项目名称:vlc,代码行数:6,
示例23: write_datavoid RelaxedVariables::write(std::ostream& s) const{ write_data(s, allContinuousVars, all_continuous_variable_labels()); }
开发者ID:distanceModling,项目名称:DAKOTA,代码行数:2,
示例24: download_simple/* return value: * 0 success * -1 fopen failed * -2 curl initialization failed * -2 faild to parse the URL (InternetCrackUrl) (windows) * -2 scheme is neither http nor https * -3 https responce status is not HTTP_STATUS_OK (windows) * -4 HttpQueryInfo failed (windows) */int download_simple (char* uri,char* path,int verbose) {#ifndef HAVE_WINDOWS_H CURL *curl; CURLcode res=!CURLE_OK; char* path_partial=cat(path,".partial",NULL); curl = curl_easy_init(); if(curl) { FILE *bodyfile; char* current=get_opt("ros.proxy",1); if(current) { /*<[protocol://][user:[email C++ write_dword函数代码示例 C++ write_cr3函数代码示例
|