• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ putstring函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DoRemotePut

static trap_retval DoRemotePut( byte *snd, trap_elen len )
{
    WORD        rc;

putstring( "RemotePut\r\n" );
putconnstatus( Connection );
    if( len == 0 ) {
        _INITSPXECB( Send, 1, NULL, 0 );
    } else {
        _INITSPXECB( Send, 2, (char *)snd, len );
    }
    SendECB.hsem = (HSEM) &SendSem;
    SendHead.connectionCtl |= 0x10;
    SendHead.packetLen = _SWAPINT( sizeof( SendHead ) + len );
    DosSemSet( &SendSem );
    rc = SpxSendSequencedPacket( Connection, &SendECB );
    putrc( "SPXSendSequencedPacket", rc );

    for( ;; ) {
        /*
            I don't know what the 0x1001 status is - I can't find it
            in any documentation, but if we don't wait for it to clear,
            things mess up badly.
        */
        if( SendECB.status != SPX_SUCCESSFUL && !InUse( SendECB ) && SendECB.status != 0x1001 )
            break;
        rc = DosSemWait( &SendSem, 1000 );
        if( rc != ERROR_SEM_TIMEOUT ) {
            break;
        }
    }
    SendECB.hsem = 0;
putstring( "Done RemotePut\r\n" );
    return( len );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:35,代码来源:novos2.c


示例2: set_dest_ip

bool set_dest_ip( )
{
	u8 retry;
	u8 respond_str[AT_CMD_LENGTH];

	for ( retry = 0 ;retry < 3 ; retry++) {
		putstring(COM2,"AT^SISS=0,address,\"socktcp:\/\/");
		putstring(COM2,my_icar.mg323.server_ip_port);
		putstring(COM2,"\"\r\n");
		memset(respond_str, 0x0, AT_CMD_LENGTH);
		if ( my_icar.stm32_u2_rx.empty ) {//no data...
			OSTimeDlyHMSM(0, 0,	0, 100);
		}
		while ( !my_icar.stm32_u2_rx.empty ) {//have data ...
			if ( get_respond(respond_str) ) {
				//debug_gsm("Res_str:%s\r\n",respond_str);
				if (strstr((char *)respond_str,"ERROR")) {
					return false;
				}
				if (strstr((char *)respond_str,"OK\r\n")) {
					return true;
				}
			}
			else {
				debug_gsm("CMD:AT^SICS no respond, timeout\r\n");
			}
		}
		OSTimeDlyHMSM(0, 0,	1, 0);
	}
	return false ;      
}
开发者ID:bg8wj,项目名称:icar-firmware,代码行数:31,代码来源:drv_mg323.c


示例3: uip_debug_ipaddr_print

/*---------------------------------------------------------------------------*/
void
uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
{
#if UIP_CONF_IPV6
  uint16_t a;
  unsigned int i;
  int f;
  for(i = 0, f = 0; i < sizeof(uip_ipaddr_t); i += 2) {
    a = (addr->u8[i] << 8) + addr->u8[i + 1];
    if(a == 0 && f >= 0) {
      if(f++ == 0) {
        putstring("::");
      }
    } else {
      if(f > 0) {
        f = -1;
      } else if(i > 0) {
        putstring(":");
      }
      puthex(a >> 8);
      puthex(a & 0xFF);
    }
  }
#else /* UIP_CONF_IPV6 */
  PRINTA("%u.%u.%u.%u", addr->u8[0], addr->u8[1], addr->u8[2], addr->u8[3]);
#endif /* UIP_CONF_IPV6 */
}
开发者ID:1uk3,项目名称:contiki,代码行数:28,代码来源:uip-debug.c


示例4: gsm_dial

bool gsm_dial( unsigned char * phone_number )
{
	u8 retry;
	u8 respond_str[AT_CMD_LENGTH];

	for ( retry = 0 ;retry < 10 ; retry++) {
		putstring(COM2,"ATD");
		putstring(COM2,phone_number);
		putstring(COM2,";\r\n");
		memset(respond_str, 0x0, AT_CMD_LENGTH);
		if ( my_icar.stm32_u2_rx.empty ) {//no data...
			OSTimeDlyHMSM(0, 0,	0, 100);
		}
		while ( !my_icar.stm32_u2_rx.empty ) {//have data ...
			if ( get_respond(respond_str) ) {
				//debug_gsm("Res_str:%s\r\n",respond_str);
				if (strstr((char *)respond_str,"ERROR")) {
					return false;
				}
				if (strstr((char *)respond_str,"CONF: 1")) {
				//^CONF: 1
					return true;
				}
			}
			else {
				debug_gsm("CMD:ATD no respond, timeout\r\n");
			}
		}
		OSTimeDlyHMSM(0, 0,	1, 0);
	}
	return false ;      
}
开发者ID:bg8wj,项目名称:icar-firmware,代码行数:32,代码来源:drv_mg323.c


示例5: main

int main(void) {
  char y[10];

  x[0] = 'H';
  x[1] = 'e';
  x[2] = 'l';
  x[3] = 'l';
  x[4] = 'o';
  x[5] = '\n';
  x[6] = 0;

  y[0] = 'G';
  y[1] = 'o';
  y[2] = 'o';
  y[3] = 'd';
  y[4] = ' ';
  y[5] = 'b';
  y[6] = 'y';
  y[7] = 'e';
  y[8] = '\n';  
  y[9] = 0;

  putstring(x);   
  putstring(y);
}
开发者ID:CoffeMug,项目名称:ML-MuC-compiler,代码行数:25,代码来源:sim04.c


示例6: flushrow

static void
flushrow( )
    {
    unsigned char *outp, *p, *q;
    int count;
    int col = outmax;

    if (linerepeat > 1)
      {
        /* Put out line repeat count */
        fwrite ("\0\0\377", 3, 1, stdout);
        putchar (linerepeat);
      }
    for (outp = p = lastrow; col > 0;)
    {
            for (q = p, count=0; (count < col) && (*q == *p); q++,count++);
            if (count > MINRUN)
            {
                if (p > outp)
                {
                    putstring (outp, p-outp);
                    outp = p;
                }
                col -= count;
                switch (*p)
                {
                case SOLID_0:
#ifdef DEBUG
/*                      if (outcol > 0) */
                        fprintf (stderr, "Solid run 0, length: %d\n", count);
#endif
                        putsolid (SOLID_0, count);
                        break;

                case SOLID_1:
#ifdef DEBUG
                        fprintf (stderr, "Solid run 1, length: %d, pos %d\n", count, outcol);
#endif
                        putsolid (SOLID_1, count);
                        break;
                default:
#ifdef DEBUG
                        fprintf (stderr, "Pattern run, length: %d\n", count);
#endif
                        putpattern (*p, count);
                        break;
                }
                outp = p = q;
            }
            else
            {
                p++;
                col--;
            }
    }           
    if (p > outp)
         putstring (outp, p-outp);
    if (ferror (stdout))
      pm_error ("write error");
}
开发者ID:chneukirchen,项目名称:netpbm-mirror,代码行数:60,代码来源:pbmtogem.c


示例7: startup_message

void startup_message(void)
{
    putcrlf();
#ifdef __GNUC__
    putstring("GCC " __VERSION__ "\r\n");
#endif
    putstring(name_string);
    putspace();
    putstring(version_string);
    /* Silicon Revision */
    putstring(" Mask(");
    puthex(ECHV);
    /* ADC reading codes Board ID */
    putstring(") ID(");
    putstring(board_id_to_string());
    /* Stack pointer */
    putstring(") SP(");
    puthex(SP);
    putstring(") ");
    putstring(date_string);
    putspace();
    putstring(time_string);

    /* now for some manufacturing data */
    putcrlf();
    if( manufacturing_find_tag("T#") )
        manufacturing_print_tag();
    putspace();
    if( manufacturing_find_tag("SN") || manufacturing_find_tag("S#") )
        manufacturing_print_tag();
}
开发者ID:XVilka,项目名称:OpenEC,代码行数:31,代码来源:main.c


示例8: bytnodtyp

int bytnodtyp(void) {
	int going=TRUE,nr,x;
	struct NodeType *nt=NULL;
	puttekn("\n\n\rVilken nodtyp vill du ha som förinställd?\n\n\r",-1);
	puttekn(" 0: Ingen, jag vill bli tillfrågad vid inloggning.\n\r",-1);
	for(x=0; x<MAXNODETYPES; x++) {
		if(Servermem->nodetypes[x].nummer==0) break;
		sprintf(outbuffer,"%2d: %s\n\r",Servermem->nodetypes[x].nummer,Servermem->nodetypes[x].desc);
		putstring(outbuffer,-1,0);
	}
	while(going) {
		putstring("\n\rVal: ",-1,0);
		if(getstring(EKO,2,NULL)) return(1);
		nr = atoi(inmat);
		if(nr<0) putstring("\n\rDu måste ange ett positivt heltal.\n\r",-1,0);
		else if(nr==0) going=FALSE;
		else if(!(nt=GetNodeType(atoi(inmat)))) putstring("\n\rFinns ingen sådan nodtyp.\n\r",-1,0);
		else going=FALSE;
	}
	if(!nt) {
		Servermem->inne[nodnr].shell=0;
		puttekn("\n\n\rDu har nu ingen förinställd nodtyp.\n\r",-1);
	} else {
		Servermem->inne[nodnr].shell = nt->nummer;
		puttekn("\n\n\rDin förinställda nodtyp är nu:\n\r",-1);
		puttekn(nt->desc,-1);
		puttekn("\n\n\r",-1);
	}
	return(0);
}
开发者ID:punktniklas,项目名称:NiKom,代码行数:30,代码来源:NiKFuncs5.c


示例9: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(udp_server_process, ev, data)
{

  PROCESS_BEGIN();
  putstring("Starting UDP server\n");

#if BUTTON_SENSOR_ON
  putstring("Button 1: Print RIME stats\n");
#endif

#if SERVER_RPL_ROOT
  create_dag();
#endif

  server_conn = udp_new(NULL, UIP_HTONS(0), NULL);
  udp_bind(server_conn, UIP_HTONS(3000));

  PRINTF("Listen port: 3000, TTL=%u\n", server_conn->ttl);

  while(1) {
    PROCESS_YIELD();
    if(ev == tcpip_event) {
      tcpip_handler();
#if (BUTTON_SENSOR_ON && (DEBUG==DEBUG_PRINT))
    } else if(ev == sensors_event && data == &button_sensor) {
      print_stats();
#endif /* BUTTON_SENSOR_ON */
    }
  }

  PROCESS_END();
}
开发者ID:EmuxEvans,项目名称:contiki-cc2530eb,代码行数:33,代码来源:server.c


示例10: set_gprs_passwd

bool set_gprs_passwd( )
{
	u8 retry;
	u8 respond_str[AT_CMD_LENGTH];

	for ( retry = 0 ;retry < 3 ; retry++) {
		putstring(COM2, (unsigned char *)at_set_channel0_para);
		putstring(COM2, "passwd,");
		putstring(COM2, (unsigned char *)apn_list[my_icar.mg323.apn_index][3]);
		putstring(COM2, "\r\n");
		memset(respond_str, 0x0, AT_CMD_LENGTH);
		if ( my_icar.stm32_u2_rx.empty ) {//no data...
			OSTimeDlyHMSM(0, 0,	0, 100);
		}
		while ( !my_icar.stm32_u2_rx.empty ) {//have data ...
			if ( get_respond(respond_str) ) {
				//debug_gsm("Res_str:%s\r\n",respond_str);
				if (strstr((char *)respond_str,"ERROR")) {
					return false;
				}
				if (strstr((char *)respond_str,"OK\r\n")) {
					return true;
				}
			}
			else {
				debug_gsm("CMD:AT^SICS no respond, timeout\r\n");
			}
		}
		OSTimeDlyHMSM(0, 0,	0, 500);
	}
	return false ;      
}
开发者ID:bg8wj,项目名称:icar-firmware,代码行数:32,代码来源:drv_mg323.c


示例11: prompt

static void prompt(char *filename)
{
	if (clreol)
		cleareol();
	else if (promptlen > 0)
		kill_line();
	if (!hard) {
		promptlen = 0;
		if (Senter && Sexit) {
			putstring(Senter);
			promptlen += (2 * soglitch);
		}
		if (clreol)
			cleareol();
		promptlen += printf(_("--More--"));
		if (filename != NULL) {
			promptlen += printf(_("(Next file: %s)"), filename);
		} else if (!no_intty) {
			promptlen +=
			    printf("(%d%%)",
				   (int)((file_pos * 100) / file_size));
		}
		if (dum_opt) {
			promptlen +=
			    printf(_("[Press space to continue, 'q' to quit.]"));
		}
		if (Senter && Sexit)
			putstring(Sexit);
		if (clreol)
			clreos();
		fflush(stdout);
	} else
		ringbell();
	inwait++;
}
开发者ID:pali,项目名称:util-linux,代码行数:35,代码来源:more.c


示例12: putrc

void putrc( char *func, WORD rc )
{
    if( rc == 0 ) return;
    putstring( func );
    putstring( " returned " );
    puthex( rc );
    putstring( "\r\n" );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:8,代码来源:novos2.c


示例13: InitMessage

void InitMessage(){
		putstring("DDS generator driver v_");
		putnum(10);
		USART_Transmit(  '\n' );
		USART_Transmit(  '\r' );
		putstring("Type help for command list");
		USART_Transmit(  '\n' );
		USART_Transmit(  '\r' );
}
开发者ID:kerteszsasa,项目名称:AVR,代码行数:9,代码来源:console.c


示例14: sendtocon

int sendtocon(char *pekare, int size)
{
	struct IntuiMessage *mymess;
	struct NiKMess *nikmess;
	int aborted = FALSE, paused=FALSE;
	ULONG signals,conwritesig = 1L << conwriteport->mp_SigBit,
		conreadsig = 1L << conreadport->mp_SigBit,windsig = 1L << NiKwind->UserPort->mp_SigBit,
		nikomnodesig = 1L << nikomnodeport->mp_SigBit;
	char console = 1, tecken;

	conwritereq->io_Command=CMD_WRITE;
	conwritereq->io_Data=(APTR)pekare;
	conwritereq->io_Length=size;
	SendIO((struct IORequest *)conwritereq);
	while(console)
	{
		signals = Wait(conwritesig | conreadsig | windsig | nikomnodesig);
		if(signals & conwritesig) {
			console=0;
			if(WaitIO((struct IORequest *)conwritereq)) printf("Error console\n");
		}
		if(signals & conreadsig) {
			if((tecken=congettkn()) == 3) {
				if(console) {
					AbortIO((struct IORequest *)conwritereq);
					WaitIO((struct IORequest *)conwritereq);
				}
				aborted=TRUE;
				console=0;
				putstring("^C\n\r",-1,0);
			} else if((tecken==' ' && (Servermem->inne[nodnr].flaggor & MELLANSLAG)) || tecken==19) paused=TRUE;
			else if(tecken && typeaheadbuftkn<50) {
				typeaheadbuf[typeaheadbuftkn++]=tecken;
				typeaheadbuf[typeaheadbuftkn]=0;
			}
		}
		if(signals & windsig) {
			mymess=(struct IntuiMessage *)GetMsg(NiKwind->UserPort);
			ReplyMsg((struct Message *)mymess);
			cleanup(OK,"");
		}
		if(signals & nikomnodesig) {
			while(nikmess = (struct NiKMess *) GetMsg(nikomnodeport)) {
				handleservermess(nikmess);
				ReplyMsg((struct Message *)nikmess);
			}
			if(carrierdropped()) aborted = TRUE;
		}
	}
	if(paused && gettekn()==3)
	{
		putstring("^C\n\r",-1,0);
		return(TRUE);
	}

	return(aborted);
}
开发者ID:jayminer81,项目名称:NiKom,代码行数:57,代码来源:ConsoleIO.c


示例15: set_rime_addr

//added by dongbo huang, this is to set the short address of this node
static void
 set_rime_addr(void)
 {
	signed char i;
  
	#if CC2530_CONF_MAC_FROM_PRIMARY
		unsigned char __xdata *macp = &X_IEEE_ADDR;
	#else
		unsigned char __code *macp = (__code unsigned char *)0xFFE8;
	#endif


//#if CC2530_CONF_MAC_FROM_PRIMARY
//  	putstring("Reading MAC from Info Page\r\n");
//#else
//  	putstring("Reading MAC from flash\r\n");

  /*
   * The MAC is always stored in 0xFFE8 of the highest BANK of our flash. This
   * maps to address 0xFFF8 of our CODE segment, when this BANK is selected.
   * Load the bank, read 8 bytes starting at 0xFFE8 and restore last BANK.
   * Since we are called from main(), this MUST be BANK1 or something is very
   * wrong. This code can be used even without a bankable firmware.
   */

  /* Don't interrupt us to make sure no BANK switching happens while working */
//  DISABLE_INTERRUPTS();

  /* Switch to the BANKn,
   * map CODE: 0x8000 - 0xFFFF to FLASH: 0xn8000 - 0xnFFFF */
//  FMAP = CC2530_LAST_FLASH_BANK;
//#endif

  for(i = (RIMEADDR_SIZE - 1); i >= 0; --i) {
    rimeaddr_node_addr.u8[i] = *macp;
    macp++;
  }

#if !CC2530_CONF_MAC_FROM_PRIMARY
  /* Remap 0x8000 - 0xFFFF to BANK1 */
  FMAP = 1;
  ENABLE_INTERRUPTS();
#endif

  /* Now the address is stored MSB first */
#if STARTUP_CONF_VERBOSE
  putstring("Rime configured with address ");
  for(i = 0; i < RIMEADDR_SIZE - 1; i++) {
    puthex(rimeaddr_node_addr.u8[i]);
    putchar(':');
  }
  puthex(rimeaddr_node_addr.u8[i]);
  putstring("\r\n");
#endif
  cc2530_rf_set_addr(IEEE802154_PANID);
  return;
}
开发者ID:hbofffw,项目名称:mywork,代码行数:58,代码来源:hello-world.c


示例16: HandleOP

static int
HandleOP(GetTargetName)
{
    if (targetname)
	putstring(c, targetname);
    else
	putstring(c, "");
    return 0;
}
开发者ID:lha,项目名称:heimdal,代码行数:9,代码来源:gssmask.c


示例17: set_at_echo

//------------------------------------------------------------------------------
//原型:
//功能:设置回显模式
//参数:
//返回:
//备注:1-回显  0-不回显
//------------------------------------------------------------------------------
void set_at_echo(u8 f_mod)
{
	if (f_mod)  // 1 回显  不需要
	{
		putstring(COM2, "ATE1\r\n"); //enable echo
	}
	else  // 0 禁止回显
	{
		putstring(COM2, "ATE0\r\n"); //disable echo
	}
}
开发者ID:bg8wj,项目名称:icar-firmware,代码行数:18,代码来源:drv_mg323.c


示例18: macrodump

void
macrodump(struct macrotable *node, FILE * f)
{
	if (!node)
		return;
	macrodump(node->left, f);
	putstring(f, node->name);
	putstring(f, node->definition);
	putref(f, node->implementor);
	macrodump(node->right, f);
}
开发者ID:revarbat,项目名称:fuzzball,代码行数:11,代码来源:game.c


示例19: prbuf

/* Print a buffer of n characters */
static void prbuf(register char *s, register int n)
{
	register char c;	/* next output character */
	register int state;	/* next output char's UL state */
#define wouldul(s,n)	((n) >= 2 && (((s)[0] == '_' && (s)[1] == '\b') || ((s)[1] == '\b' && (s)[2] == '_')))

	while (--n >= 0)
		if (!ul_opt)
			putchar(*s++);
		else {
			if (*s == ' ' && pstate == 0 && ulglitch
			    && wouldul(s + 1, n - 1)) {
				s++;
				continue;
			}
			if ((state = wouldul(s, n)) != 0) {
				c = (*s == '_') ? s[2] : *s;
				n -= 2;
				s += 3;
			} else
				c = *s++;
			if (state != pstate) {
				if (c == ' ' && state == 0 && ulglitch
				    && wouldul(s, n - 1))
					state = 1;
				else
					putstring(state ? ULenter : ULexit);
			}
			if (c != ' ' || pstate == 0 || state != 0
			    || ulglitch == 0)
#ifdef HAVE_WIDECHAR
			{
				wchar_t wc;
				size_t mblength;
				mbstate_t mbstate;
				memset(&mbstate, '\0', sizeof(mbstate_t));
				s--;
				n++;
				mblength = xmbrtowc(&wc, s, n, &mbstate);
				while (mblength--)
					putchar(*s++);
				n += mblength;
			}
#else
				putchar(c);
#endif				/* HAVE_WIDECHAR */
			if (state && *chUL) {
				putsout(chBS);
				putstring(chUL);
			}
			pstate = state;
		}
}
开发者ID:pali,项目名称:util-linux,代码行数:54,代码来源:more.c


示例20: play

/*
 * play recursively - possible stack overflow if subdirectories too nested
 */
void play(FatReader &dir) {
  FatReader file;
  while (dir.readDir(dirBuf) > 0) {    // Read every file in the directory one at a time
  
    // Skip it if not a subdirectory and not a .WAV file
    if (!DIR_IS_SUBDIR(dirBuf)
         && strncmp_P((char *)&dirBuf.name[8], PSTR("WAV"), 3)) {
      continue;
    }

    Serial.println();            // clear out a new line
    
    for (uint8_t i = 0; i < dirLevel; i++) {
       Serial.write(' ');       // this is for prettyprinting, put spaces in front
    }
    if (!file.open(vol, dirBuf)) {        // open the file in the directory
      error("file.open failed");          // something went wrong
    }
    
    if (file.isDir()) {                   // check if we opened a new directory
      putstring("Subdir: ");
      printEntryName(dirBuf);
      Serial.println();
      dirLevel += 2;                      // add more spaces
      // play files in subdirectory
      play(file);                         // recursive!
      dirLevel -= 2;    
    }
    else {
      // Aha! we found a file that isnt a directory
      putstring("Playing ");
      printEntryName(dirBuf);              // print it out
      if (!wave.create(file)) {            // Figure out, is it a WAV proper?
        putstring(" Not a valid WAV");     // ok skip it
      } else {
        Serial.println();                  // Hooray it IS a WAV proper!
        wave.play();                       // make some noise!
        
        uint8_t n = 0;
        while (wave.isplaying) {// playing occurs in interrupts, so we print dots in realtime
          putstring(".");
          if (!(++n % 32))Serial.println();
          delay(100);
        }       
        sdErrorCheck();                    // everything OK?
        // if (wave.errors)Serial.println(wave.errors);     // wave decoding errors
      }
    }
  }
}
开发者ID:Coreduino,项目名称:ArduinoLibraries,代码行数:53,代码来源:daphc.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pututline函数代码示例发布时间:2022-05-30
下一篇:
C++ putstr函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap