您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ write_output函数代码示例

51自学网 2021-06-03 10:06:24
  C++
这篇教程C++ write_output函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中write_output函数的典型用法代码示例。如果您正苦于以下问题:C++ write_output函数的具体用法?C++ write_output怎么用?C++ write_output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了write_output函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: logger_command_line

static void logger_command_line(const struct logger_ctl *ctl, char **argv){	/* note: we never re-generate the syslog header here, even if we	 * generate multiple messages. If so, we think it is the right thing	 * to do to report them with the same timestamp, as the user actually	 * intended to send a single message.	 */	char *const buf = xmalloc(ctl->max_message_size + 1);	char *p = buf;	const char *endp = buf + ctl->max_message_size - 1;	size_t len;	while (*argv) {		len = strlen(*argv);		if (endp < p + len && p != buf) {			write_output(ctl, buf);			p = buf;		}		if (ctl->max_message_size < len) {			(*argv)[ctl->max_message_size] = '/0'; /* truncate */			write_output(ctl, *argv++);			continue;		}		if (p != buf)			*p++ = ' ';		memmove(p, *argv++, len);		*(p += len) = '/0';	}	if (p != buf)		write_output(ctl, buf);	free(buf);}
开发者ID:alisw,项目名称:uuid,代码行数:32,


示例2: clear_program_state_action

static voidclear_program_state_action (Widget w, XtPointer client_data,			    XtPointer call_data){  long clear_op = (long) client_data;  switch (clear_op)    {    case CLEAR_REGS:      write_output (message_out, "Registers cleared/n/n");      initialize_registers ();      break;    case CLEAR_MEM_REGS:      write_output (message_out, "Memory and registers cleared/n/n");      initialize_world (load_exception_handler ? exception_file_name : NULL);      write_startup_message ();      break;    case CLEAR_CONSOLE:      write_output (message_out, "Console display cleared/n/n");      clear_console_display ();      break;    default:      fatal_error("Unknown action: %d/n", clear_op);    }  redisplay_text ();  redisplay_data ();}
开发者ID:Bpara001,项目名称:CS_UCR,代码行数:31,


示例3: write_opcodes

char write_opcodes (void){	char err;	opcs = get_opcodes();	if (pass == 1)	{	addr = addr + opcs;	return;	}	if (pass==2)		{		if (opcs == 0)			{			opc0 = get_opcode0();			err = write_output(addr,0,(unsigned char *)file_line,line);			}		if (opcs == 1) 			{			opc0 = get_opcode0();			err = write_output(addr,opc0,(unsigned char *)file_line,line);			addr++;			}		if (opcs == 2)			{			opc0 = get_opcode0();			opc1 = get_opcode1();			err = write_output(addr,opc0,(unsigned char *)file_line,line);			addr++;			err = write_output(addr,opc1,(unsigned char *)"",line);			addr++;			}		}return err;}
开发者ID:godzivan,项目名称:PP04-camel_computer,代码行数:34,


示例4: lasikbd_leds

static void lasikbd_leds(unsigned char leds){	int loop = 1000;	if (!lasikbd_hpa)		return;	cmd_status=2;	while (cmd_status!=0 && --loop > 0) {		write_output(KBD_CMD_SET_LEDS, lasikbd_hpa);		mdelay(5); 	}   	cmd_status=2;	while (cmd_status!=0 && --loop > 0) {		write_output(leds, lasikbd_hpa);		mdelay(5);	}	cmd_status=2;	while (cmd_status!=0 && --loop > 0) {	   write_output(KBD_CMD_ENABLE, lasikbd_hpa);   	   mdelay(5);	}	if (loop <= 0)		printk("lasikbd_leds: timeout/n");}
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:27,


示例5: mmap_read

static void mmap_read(struct mmap_data *md){	unsigned int head = mmap_read_head(md);	unsigned int old = md->prev;	unsigned char *data = md->base + page_size;	unsigned long size;	void *buf;	int diff;	gettimeofday(&this_read, NULL);	/*	 * If we're further behind than half the buffer, there's a chance	 * the writer will bite our tail and mess up the samples under us.	 *	 * If we somehow ended up ahead of the head, we got messed up.	 *	 * In either case, truncate and restart at head.	 */	diff = head - old;	if (diff < 0) {		struct timeval iv;		unsigned long msecs;		timersub(&this_read, &last_read, &iv);		msecs = iv.tv_sec*1000 + iv.tv_usec/1000;		fprintf(stderr, "WARNING: failed to keep up with mmap data."				"  Last read %lu msecs ago./n", msecs);		/*		 * head points to a known good entry, start there.		 */		old = head;	}	last_read = this_read;	if (old != head)		samples++;	size = head - old;	if ((old & md->mask) + size != (head & md->mask)) {		buf = &data[old & md->mask];		size = md->mask + 1 - (old & md->mask);		old += size;		write_output(buf, size);	}	buf = &data[old & md->mask];	size = head - old;	old += size;	write_output(buf, size);	md->prev = old;	mmap_write_tail(md, old);}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:60,


示例6: go

      void go() override         {         std::unique_ptr<Botan::Private_Key> key;         std::string pass_in = get_arg("pass-in");         if (pass_in.empty())         {            key.reset(Botan::PKCS8::load_key(get_arg("key"), rng()));         }         else         {            key.reset(Botan::PKCS8::load_key(get_arg("key"), rng(), pass_in));         }         const std::chrono::milliseconds pbe_millis(get_arg_sz("pbe-millis"));         const std::string pbe = get_arg("pbe");         const bool der_out = flag_set("der-out");         if(flag_set("pub-out"))            {            if(der_out)               {               write_output(Botan::X509::BER_encode(*key));               }            else               {               output() << Botan::X509::PEM_encode(*key);               }            }         else            {            const std::string pass_out = get_arg("pass-out");            if(der_out)               {               if(pass_out.empty())                  {                  write_output(Botan::PKCS8::BER_encode(*key));                  }               else                  {                  write_output(Botan::PKCS8::BER_encode(*key, rng(), pass_out, pbe_millis, pbe));                  }               }            else               {               if(pass_out.empty())                  {                  output() << Botan::PKCS8::PEM_encode(*key);                  }               else                  {                  output() << Botan::PKCS8::PEM_encode(*key, rng(), pass_out, pbe_millis, pbe);                  }               }            }         }
开发者ID:Rohde-Schwarz-Cybersecurity,项目名称:botan,代码行数:57,


示例7: list_breakpoints

voidlist_breakpoints (){  bkpt *b;  if (bkpts)    for (b = bkpts;  b != NULL; b = b->next)      write_output (message_out, "Breakpoint at 0x%08x/n", b->addr);  else    write_output (message_out, "No breakpoints set/n");}
开发者ID:peach07up,项目名称:CS398,代码行数:11,


示例8: WRITE8_HANDLER

static WRITE8_HANDLER( firetrk_out_w ){	if (GAME_IS_FIRETRUCK || GAME_IS_MONTECARLO)	{		write_output(data);	}	if (GAME_IS_SUPERBUG)	{		write_output(offset);	}}
开发者ID:BirchJD,项目名称:advancemame-0.106.1-RPi,代码行数:11,


示例9: main

int main(int argc, char *argv[]){  bool success = true;  if (argc < 3) {    std::cerr << "Syntax error: use" << std::endl;    std::cerr << argv[0] << " classname inputpath" << std::endl;    return 1;  }  std::string modname(argv[1]);  std::string inputpath(argv[2]);  std::string ifname = inputpath + std::string("/") + modname + std::string("_tests.un");  std::string impl_fname = modname + std::string("_test_impls-tmp.F90");  std::string calls_fname = modname + std::string("_test_calls.F90");  std::string list_fname = modname + std::string("_tests.tests");  std::string mpilist_fname = modname + std::string("_tests.mpitests");  std::vector<std::string> input, output;  try {    success = success && read_template(ifname, input);    success = success && replace_modname(modname, input);    success = success && parse_impl(ifname, input, output);    success = success && write_output(impl_fname, output);    output.clear();    success = success && parse_calls(ifname, input, output);    success = success && write_output(calls_fname, output);    output.clear();    success = success && parse_list(ifname, input, output);    success = success && write_output(list_fname, output);    output.clear();    success = success && parse_mpilist(ifname, input, output);    success = success && write_output(mpilist_fname, output);    output.clear();  } catch (ParserException &ex) {    std::cerr << "Caught exception: " << ex.getMsg() << std::endl;    success = false;  } catch (std::string &ex) {    std::cerr << "Caught exception: " << ex << std::endl;    success = false;  } catch (...) {    std::cerr << "Caught unknown exception." << std::endl;    success = false;  }  return (success ? 0 : 1);}
开发者ID:00liujj,项目名称:trilinos,代码行数:52,


示例10: run

int run(int argc, const char** argv) {	options opts;	if(int err = parse_options(argc, argv, opts)) {		return err;	}	if(opts.output_path.value() == eagine::cstr_ref("-")) {		write_output(std::cout, opts);	} else {		std::ofstream output_file(opts.output_path.value().c_str());		write_output(output_file, opts);	}	return 0;}
开发者ID:matus-chochlik,项目名称:oglplu2,代码行数:15,


示例11: mp3_close

static void mp3_close(void){    if (output_file) {        int imp3, encout;        /* write remaining mp3 data */        encout = lame_encode_flush_nogap(gfp, encbuffer, LAME_MAXMP3BUFFER);        write_output(encbuffer, encout);        /* set gfp->num_samples for valid TLEN tag */        lame_set_num_samples(gfp, numsamples);        /* append v1 tag */        imp3 = lame_get_id3v1_tag(gfp, encbuffer, sizeof(encbuffer));        if (imp3 > 0)            write_output(encbuffer, imp3);        /* update v2 tag */        imp3 = lame_get_id3v2_tag(gfp, encbuffer, sizeof(encbuffer));        if (imp3 > 0) {            if (vfs_fseek(output_file, 0, SEEK_SET) != 0) {                AUDDBG("can't rewind/n");            }            else {                write_output(encbuffer, imp3);            }        }        /* update lame tag */        if (id3v2_size) {            if (vfs_fseek(output_file, id3v2_size, SEEK_SET) != 0) {                AUDDBG("fatal error: can't update LAME-tag frame!/n");            }            else {                imp3 = lame_get_lametag_frame(gfp, encbuffer, sizeof(encbuffer));                write_output(encbuffer, imp3);            }        }    }    g_free (write_buffer);    lame_close(gfp);    AUDDBG("lame_close() done/n");    free_lameid3(&lameid3);    numsamples = 0;}
开发者ID:ivan-dives,项目名称:audacious-plugins,代码行数:48,


示例12: mp3_write

static void mp3_write(void *ptr, gint length){    gint encoded;    if (write_buffer_size == 0)    {        write_buffer_size = 8192;        write_buffer = g_realloc (write_buffer, write_buffer_size);    }RETRY:    if (input.channels == 1)        encoded = lame_encode_buffer (gfp, ptr, ptr, length / 2, write_buffer,         write_buffer_size);    else        encoded = lame_encode_buffer_interleaved (gfp, ptr, length / 4,         write_buffer, write_buffer_size);    if (encoded == -1)    {        write_buffer_size *= 2;        write_buffer = g_realloc (write_buffer, write_buffer_size);        goto RETRY;    }    if (encoded > 0)        write_output (write_buffer, encoded);    numsamples += length / (2 * input.channels);}
开发者ID:ivan-dives,项目名称:audacious-plugins,代码行数:30,


示例13: main

int main(int argc, char *argv[]){ 	PetscErrorCode ierr;	params params;	Mat H; 	SlepcInitialize(&argc,&argv,(char*)0,help);	ierr = PetscPrintf(PETSC_COMM_WORLD,"--------------------------------------------------------------------------------------/n");CHKERRQ(ierr);	ierr = PetscPrintf(PETSC_COMM_WORLD,"               _______ __  __  _______          _______ ______ _______                /n");CHKERRQ(ierr);        ierr = PetscPrintf(PETSC_COMM_WORLD,"              |__   __|  ///  |/ ____// //        / /_   _|  ____|__   __|               /n");CHKERRQ(ierr);        ierr = PetscPrintf(PETSC_COMM_WORLD,"                 | |  | //  / | (___  // //  ///  / /  | | | |__     | |                  /n");CHKERRQ(ierr);        ierr = PetscPrintf(PETSC_COMM_WORLD,"                 | |  | |///| |//___ //  // ///  /// /   | | |  __|    | |                  /n");CHKERRQ(ierr);        ierr = PetscPrintf(PETSC_COMM_WORLD,"                 | |  | |  | |____) |  //  ///  /   _| |_| |       | |                  /n");CHKERRQ(ierr);        ierr = PetscPrintf(PETSC_COMM_WORLD,"                 |_|  |_|  |_|_____/    ///  ///   |_____|_|       |_|                  /n");CHKERRQ(ierr);        ierr = PetscPrintf(PETSC_COMM_WORLD,"               True Muonium Solver with Iterative Front-Form Techniques               /n");CHKERRQ(ierr);        ierr = PetscPrintf(PETSC_COMM_WORLD,"                                                                                      /n");CHKERRQ(ierr);        ierr = PetscPrintf(PETSC_COMM_WORLD,"--------------------------------------------------------------------------------------/n");CHKERRQ(ierr);	read_input(ierr,argv,&params);	print_input(ierr,&params);		if(check_file(params.hfile))	{		PetscViewer    viewer_H;		PetscViewerBinaryOpen(PETSC_COMM_WORLD,params.hfile.c_str(),FILE_MODE_READ,&viewer_H);		MatCreate(PETSC_COMM_WORLD,&H);		MatSetFromOptions(H);		MatLoad(H,viewer_H);		PetscViewerDestroy(&viewer_H);			}else	{        	discretize(ierr,&params);//  	    	ierr = VecView(params.mu,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);//        	ierr = VecView(params.theta,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);		write_output(ierr,&params);	        	coulomb_trick(ierr,&params);	//		ierr = VecView(params.CT,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);		ct_discrete(ierr,&params);//		ierr = VecView(params.CT,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);		hamiltonian(ierr,&params,H);// 		ierr = PetscViewerSetFormat(PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_ASCII_DENSE);//DENSE<-->COMMON//	      	MatView(H,PETSC_VIEWER_STDOUT_WORLD);	}	cleanup(ierr,&params);		eigensolver(ierr,&params,H,argc,argv);	ierr = MatDestroy(&H);CHKERRQ(ierr);	ierr = SlepcFinalize();	return 0;}
开发者ID:OperaBed,项目名称:TMSWIFT,代码行数:60,


示例14: render_pdf

/** Reads an skp file, renders it to pdf and writes the output to a pdf file * @param inputPath The skp file to be read. * @param outputDir Output dir. * @param renderer The object responsible to render the skp object into pdf. */static bool render_pdf(const SkString& inputPath, const SkString& outputDir,                       sk_tools::PdfRenderer& renderer) {    SkString inputFilename;    sk_tools::get_basename(&inputFilename, inputPath);    SkFILEStream inputStream;    inputStream.setPath(inputPath.c_str());    if (!inputStream.isValid()) {        SkDebugf("Could not open file %s/n", inputPath.c_str());        return false;    }    bool success = false;    SkAutoTUnref<SkPicture>        picture(SkNEW_ARGS(SkPicture, (&inputStream, &success)));    if (!success) {        SkDebugf("Could not read an SkPicture from %s/n", inputPath.c_str());        return false;    }    SkDebugf("exporting... [%i %i] %s/n", picture->width(), picture->height(),             inputPath.c_str());    renderer.init(picture);    renderer.render();    success = write_output(outputDir, inputFilename, renderer);    renderer.end();    return success;}
开发者ID:Cue,项目名称:skia,代码行数:38,


示例15: main

int main( int argc, char *argv[] ){   if ( argc != 2 )    {      std::cout << "usage: " << argv[0] << " N " << "/n";      return 1;   }        int N = atoi( argv[1] );   assert( N > 1 );      double h = N / 100.0;   double y = 1;      std::ofstream write_output("xy.dat");   assert(write_output.is_open());    write_output.setf(std::ios::scientific);   write_output.setf(std::ios::showpos);   write_output.precision(4);   for ( double i = 0; i < N; i += h )   {      y += h * (-i);         write_output << i << " " << y << "/n";   }   write_output << "/n";   write_output.flush();   write_output.close();   return 0;}
开发者ID:jmhal,项目名称:parallel,代码行数:33,


示例16: main

int main(int argc, char *argv[]){    FILE *input = NULL;    FILE *output = NULL;    Edges edges = {0, NULL} ;    double *shapley = NULL;    long kernel_time = 0;    long summary_time = 0;    int n;    Adjacency *adjacency;    input = safeFopen(argv[1], "r");    output = safeFopen(argv[2], "w");    read_input(input, &edges);    n = number_of_vertices(&edges);    shapley = (double *) safeMalloc(n * sizeof(double));    adjacency = createAdjacency(n, &edges, n);    compute_shapley(adjacency, n, shapley, function, &kernel_time, &summary_time);        write_output(n, shapley, output);    print_time("kernel", kernel_time);    print_time("summary", summary_time);    releaseAdjacency(adjacency);    free(shapley);    free(edges.list);    fclose(input);    fclose(output);    return 0;}
开发者ID:piotyrus,项目名称:Shapley,代码行数:35,


示例17: decipher

static int decipher(struct sc_pkcs15_object *obj){	u8 buf[1024], out[1024];	int r, c, len;	if (opt_input == NULL) {		fprintf(stderr, "No input file specified./n");		return 2;	}	c = read_input(buf, sizeof(buf));	if (c < 0)		return 2;	len = sizeof(out);	if (!((struct sc_pkcs15_prkey_info *) obj->data)->native) {                fprintf(stderr, "Deprecated non-native key detected! Upgrade your smart cards./n");		return SC_ERROR_NOT_SUPPORTED;	}	r = sc_pkcs15_decipher(p15card, obj, opt_crypt_flags & SC_ALGORITHM_RSA_PAD_PKCS1, buf, c, out, len);	if (r < 0) {		fprintf(stderr, "Decrypt failed: %s/n", sc_strerror(r));		return 1;	}	r = write_output(out, r);	return 0;}
开发者ID:andyvand,项目名称:OpenSC,代码行数:28,


示例18: vorbis_close

static void vorbis_close(void){    vorbis_write_real (NULL, 0); /* signal end of file */    while (ogg_stream_flush (& os, & og))    {        write_output (og.header, og.header_len);        write_output (og.body, og.body_len);    }    ogg_stream_clear(&os);    vorbis_block_clear(&vb);    vorbis_dsp_clear(&vd);    vorbis_info_clear(&vi);}
开发者ID:ivan-dives,项目名称:audacious-plugins,代码行数:16,


示例19: compiler_core

unsigned char compiler_core (void){line_position = find_next_substring((unsigned char*)file_line, 0);		//and find first wordif (line_position>0)													//where is it?{	if (line_position<255)	{																	//this is instruction - outside first row		error = E_OK;		if (file_line[line_position]>' ')		{//non-empty line			token_len = get_next_token((unsigned char *)file_line,(unsigned char *) token, 0);	//take opcode			if ((token_len>0)&(token_len<255))																//if valid			{				if (token[0]!='#')					{					if (pass==2)						{						replaced = replace_objects((unsigned char *)file_line,(unsigned char *)file_line2,line_position+token_len);						if (replaced==255) error = E_DEF_UNKNOWN;						strcpy((char *)file_line,(char *) file_line2);						}					if ((error == E_OK)|(pass==1))						{						token_len = get_next_token((unsigned char *)file_line,(unsigned char *) token, 0);	//take opcode						opcode_jump();												}					}				else					{					pseudoopcode_jump();										}			}			else error = E_UNKNOWN_OPCODE;			if (error==E_OK) 				{				if (write_opcodes()!=0) error = E_FILE_ERROR;				}			else				{				write_output(0xFFFF,error,(unsigned char *)file_line,line);				}		}	}}else{//this is label, first row	if (pass==1)		{		token_len = get_next_token((unsigned char *)file_line,(unsigned char *) token, 0);	//take label name		if (token_len>0)			{			dt_pointer = update_deftable_num((unsigned char *)token, addr);			if (dt_pointer > ((DEFATABLE_LEN/TABLE_ENTRY_LEN)-2)) return E_DEFTAB_OVER;			}		}}return error;}
开发者ID:godzivan,项目名称:PP04-camel_computer,代码行数:59,


示例20: put_console_char

void put_console_char(char c){    char buf[4];    buf[0] = c;    buf[1] = '/0';    write_output(console_out, buf);}
开发者ID:chaitu236,项目名称:spim,代码行数:9,


示例21: main

int main(int argc, char *argv[]){   int ret_value = 0;   libettercap_init(PROGRAM, EC_VERSION);   ef_globals_alloc();   select_text_interface();   libettercap_ui_init();   /* etterfilter copyright */   USER_MSG("/n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s/n/n",                       PROGRAM, EC_VERSION, EC_COPYRIGHT, EC_AUTHORS);    /* initialize the line number */   EF_GBL->lineno = 1;     /* getopt related parsing...  */   parse_options(argc, argv);   /* set the input for source file */   if (EF_GBL_OPTIONS->source_file) {      yyin = fopen(EF_GBL_OPTIONS->source_file, "r");      if (yyin == NULL)         FATAL_ERROR("Input file not found !");   } else {      FATAL_ERROR("No source file.");   }   /* no buffering */   setbuf(yyin, NULL);   setbuf(stdout, NULL);   setbuf(stderr, NULL);      /* load the tables in etterfilter.tbl */   load_tables();   /* load the constants in etterfilter.cnt */   load_constants();   /* print the message */   USER_MSG("/n Parsing source file /'%s/' ", EF_GBL_OPTIONS->source_file);   ef_debug(1, "/n");   /* begin the parsing */   if (yyparse() == 0)      USER_MSG(" done./n/n");   else      USER_MSG("/n/nThe script contains errors.../n/n");     /* write to file */   ret_value = write_output();   if (ret_value == -E_NOTHANDLED)      FATAL_ERROR("Cannot write output file (%s): the filter is not correctly handled.", EF_GBL_OPTIONS->output_file);   else if (ret_value == -E_INVALID)      FATAL_ERROR("Cannot write output file (%s): the filter format is not correct. ", EF_GBL_OPTIONS->output_file);   ef_exit(0);}
开发者ID:Ettercap,项目名称:ettercap,代码行数:57,


示例22: init_keyb

static int init_keyb(unsigned long hpa){	int res = 0;	unsigned long flags;	spin_lock_irqsave(&kbd_controller_lock, flags);	if (write_output(KBD_CMD_SET_LEDS, hpa) &&			wait_input(hpa) == AUX_REPLY_ACK &&			write_output(0, hpa) &&			wait_input(hpa) == AUX_REPLY_ACK &&			write_output(KBD_CMD_ENABLE, hpa) &&			wait_input(hpa) == AUX_REPLY_ACK)		res = 1;	spin_unlock_irqrestore(&kbd_controller_lock, flags);	return res;}
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:19,


示例23: sign

static int sign(struct sc_pkcs15_object *obj){	u8 buf[1024], out[1024];	struct sc_pkcs15_prkey_info *key = (struct sc_pkcs15_prkey_info *) obj->data;	int r, c, len;	if (opt_input == NULL) {		fprintf(stderr, "No input file specified./n");		return 2;	}	c = read_input(buf, sizeof(buf));	if (c < 0)		return 2;	len = sizeof(out);	if (obj->type == SC_PKCS15_TYPE_PRKEY_RSA			&& !(opt_crypt_flags & SC_ALGORITHM_RSA_PAD_PKCS1)			&& (size_t)c != key->modulus_length/8) {		fprintf(stderr, "Input has to be exactly %lu bytes, when using no padding./n",			(unsigned long) key->modulus_length/8);		return 2;	}	if (!key->native) {		fprintf(stderr, "Deprecated non-native key detected! Upgrade your smart cards./n");		return SC_ERROR_NOT_SUPPORTED;	}	r = sc_pkcs15_compute_signature(p15card, obj, opt_crypt_flags, buf, c, out, len);	if (r < 0) {		fprintf(stderr, "Compute signature failed: %s/n", sc_strerror(r));		return 1;	}	len = r;	if (obj->type == SC_PKCS15_TYPE_PRKEY_EC)   {		if (opt_sig_format &&  (!strcmp(opt_sig_format, "openssl") || !strcmp(opt_sig_format, "sequence")))   {			unsigned char *seq;			size_t seqlen;			if (sc_asn1_sig_value_rs_to_sequence(ctx, out, len, &seq, &seqlen))   {				fprintf(stderr, "Failed to convert signature to ASN1 sequence format./n");				return 2;			}			memcpy(out, seq, seqlen);			len = seqlen;			free(seq);		}	}	r = write_output(out, len);	return r;}
开发者ID:andyvand,项目名称:OpenSC,代码行数:55,


示例24: main

int main(int argc, char* argv[]) {    const Parameters* par = new Parameters(argc, argv);    Community* community = build_community(par);    vector<int> initial_susceptibles = community->getNumSusceptible();    seed_epidemic(par, community);    simulate_epidemic(par, community);    write_output(par, community, initial_susceptibles);        return 0;}
开发者ID:PulliamLab-UFL,项目名称:dengue,代码行数:11,


示例25: error

void error(char *fmt, ...){    va_list args;    char io_buffer [IO_BUFFSIZE];    va_start (args, fmt);    vsprintf (io_buffer, fmt, args);    va_end (args);    write_output(message_out, io_buffer);}
开发者ID:chaitu236,项目名称:spim,代码行数:11,


示例26: write_event

static void write_event(event_t *buf, size_t size){	/*	* Add it to the list of DSOs, so that when we finish this	 * record session we can pick the available build-ids.	 */	if (buf->header.type == PERF_RECORD_MMAP)		dsos__findnew(buf->mmap.filename);	write_output(buf, size);}
开发者ID:Aircell,项目名称:asp-kernel,代码行数:11,


示例27: compile_repo

void compile_repo() {  auto ues = load_input();  std::cout << folly::format("{} units/n", ues.size());  ues = whole_program(std::move(ues));  {    trace_time timer("writing output repo");    write_output(std::move(ues));  }}
开发者ID:Kofel,项目名称:hhvm,代码行数:11,


示例28: logger_stdin

static void logger_stdin(struct logger_ctl *ctl){	int default_priority = ctl->pri;	int last_pri = default_priority;	size_t max_usrmsg_size = ctl->max_message_size - strlen(ctl->hdr);	char *const buf = xmalloc(max_usrmsg_size + 2 + 2);	int pri;	int c;	size_t i;	c = getchar();	while (c != EOF) {		i = 0;		if (ctl->prio_prefix) {			if (c == '<') {				pri = 0;				buf[i++] = c;				while (isdigit(c = getchar()) && pri <= 191) {					buf[i++] = c;					pri = pri * 10 + c - '0';				}				if (c != EOF && c != '/n')					buf[i++] = c;				if (c == '>' && 0 <= pri && pri <= 191) { /* valid RFC PRI values */					i = 0;					if (pri < 8)						pri |= 8; /* kern facility is forbidden */					ctl->pri = pri;				} else					ctl->pri = default_priority;				if (ctl->pri != last_pri) {					generate_syslog_header(ctl);					max_usrmsg_size = ctl->max_message_size - strlen(ctl->hdr);					last_pri = ctl->pri;				}				if (c != EOF && c != '/n')					c = getchar();			}		}		while (c != EOF && c != '/n' && i < max_usrmsg_size) {			buf[i++] = c;			c = getchar();		}		buf[i] = '/0';		if (i > 0 || !ctl->skip_empty_lines)			write_output(ctl, buf);		if (c == '/n')	/* discard line terminator */			c = getchar();	}}
开发者ID:alisw,项目名称:uuid,代码行数:54,



注:本文中的write_output函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ write_packet函数代码示例
C++ write_one函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。