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

C++ printmsg函数代码示例

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

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



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

示例1: frdmsg

short frdmsg(char *str)
{
   char *smax;
   char *s = str;

   smax = s + MAXPACK - 1;
   for (;;) {
      if (sread(s, 1, M_fPacketTimeout) <= 0)
      {
         printmsg(0,"frdmsg: timeout reading message");
         *s++ = '\0';
         goto msgerr;
      }
      if (*s == '\r')
         break;
      if (*s < ' ')
         continue;
      if (s++ >= smax)
      {
         printmsg(0,"frdmsg: buffer overflow");
         *--s = '\0';
         goto msgerr;
      } /* if (s++ >= smax) */
   }
   *s = '\0';
   return DCP_OK;

msgerr:
   printmsg(0,"frdmsg: Message received \"%s\"", str);
   return DCP_FAILED;
} /* frdmsg */
开发者ID:swhobbit,项目名称:UUPC,代码行数:31,代码来源:dcpfpkt.c


示例2: imStatus

static void imStatus(IMFILE *imf)
{

#ifdef UDEBUG
   if (imf->buffer != NULL)
      printmsg(18,"imStatus: "
#ifdef BIT32ENV
               "%p"
#else
               "%Fp"
#endif
                  " buffer address, %ld bytes used, %ld bytes capacity, "
                  "current position %ld%s%s",
                  imf->buffer,
                  imf->inUse,
                  imf->length,
                  imf->position,
                  imeof(imf)     ? ", EOF"   : "",
                  imerror(imf) ? ", ERROR" : "");
#endif
   else if (imf->filename != NULL)
   {
      /* Only report the file is on disk once */
      if ((imf->flag & IM_FLAG_DISKR) == 0)
      {
         imf->flag |= IM_FLAG_DISKR;
         printmsg(5,"imStatus: File resides on disk as %s with %ld bytes",
                  imf->filename,
                  imlength( imf ));
      }
   }
   else
      printmsg(5,"imstatus: No backing store exists for file");

} /* imStatus */
开发者ID:swhobbit,项目名称:UUPC,代码行数:35,代码来源:imfile.c


示例3: main

int main(int argc,char** argv)
{
   const char* server_name;
   int port =__COMMON_PORT__;
   if (argc > 2) {
	port = atoi(argv[2]);
	if(port <= 0) {
           printmsg("DIE! Invalid port");
           exit(1);
	}
   }
   
   if (argc > 1) {
       server_name = argv[1];
   }
   else {
       server_name = "localhost";
   }
   
   if(signal(SIGPIPE,SIG_IGN)==SIG_ERR) {
       printmsg("DIE! signal(SIGPIPE)");
       exit(1);
   }

   sOperacion ops[500];
   int totalops = cargar_archivo(&ops[0]);

   main_proc(server_name,port,ops,totalops);
   
}
开发者ID:diegonc,项目名称:Sistemas-Distribuidos-TP-Museo,代码行数:30,代码来源:client.cpp


示例4: ddelay

void ddelay( const KEWSHORT milliseconds )
{
   MSG msg;
   WORD TimerId = 1;
   BOOL bTimerDone = KWFalse;

/*--------------------------------------------------------------------*/
/*          A 0-delay call means give up control to Windows           */
/*--------------------------------------------------------------------*/

   if (milliseconds == 0)
   {
      while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
      {
         TranslateMessage(&msg);

         DispatchMessage(&msg);
      }
      return;
   }

   TimerId = SetTimer( hOurWindow,
                       TimerId,
                       (milliseconds > 55) ? (WORD)milliseconds : (WORD)55 ,
                       NULL );

   if ( TimerId == 0 )
   {
      printmsg(0, "WindowsDelay: Unable to set Windows Timer");
      panic();
      return;
   } /* if */

/*--------------------------------------------------------------------*/
/*       LOCAL MESSAGE LOOP - Service Windows while waiting for       */
/*       the timer message.                                           */
/*--------------------------------------------------------------------*/

   while(!bTimerDone && GetMessage(&msg, NULL, NULL, NULL))
   {
      TranslateMessage(&msg);

      switch( msg.message )
      {
         case WM_TIMER:
            bTimerDone = KWTrue;
            /* Fall through and dispatch message   */

         default:
            DispatchMessage(&msg);
            break;

      } /* switch( msg.message ) */
   } /* while */

   if (KillTimer( hOurWindow, TimerId ) == 0)
      printmsg(0, "WindowsDelay: Unable to kill Windows Timer %d",
                  (int) TimerId );

} /* ddelay */
开发者ID:swhobbit,项目名称:UUPC,代码行数:60,代码来源:ssleep.c


示例5: do_test

/* Check if negative offsets are handled correctly by mmap.  */
static int
do_test (void)
{
  const int prot = PROT_READ | PROT_WRITE;
  const int flags = MAP_SHARED;
  const unsigned long length = 0x10000;
  const unsigned long offset = 0xace00000;
  const unsigned long size = offset + length;
  void *addr;
  int fd;
  char fname[] = "tst-mmap-offset-XXXXXX";

  fd = mkstemp64 (fname);
  if (fd < 0)
    return printmsg (1, "mkstemp");

  if (unlink (fname))
    return printmsg (1, "unlink");

  if (ftruncate64 (fd, size))
    return printmsg (0, "ftruncate64");

  addr = mmap (NULL, length, prot, flags, fd, offset);
  if (MAP_FAILED == addr)
    return printmsg (1, "mmap");

  /* This memcpy is likely to SIGBUS if mmap has messed up with offset.  */
  memcpy (addr, fname, sizeof (fname));

  return 0;
}
开发者ID:JamesLinus,项目名称:glibc-mips,代码行数:32,代码来源:tst-mmap-offset.c


示例6: iflowcontrol

void iflowcontrol( KWBoolean flow )
{

#ifdef ARTICOMM_INT14 /* Richard H. Gumpertz ([email protected]), 28 Sep 1993 */
   union REGS regs;          /* Scratch area for interrupt calls. */

/*
   With INT14, don't open and close the port; toggle it in place
   by using INT14/AX=800A, which is again Artisoft-specific.
*/
   printmsg(4, "iflowcontrol: %sabling in-band flow control",
                               (flow ? "en" : "dis"));
   regs.x.ax = 0x800A;
   regs.h.bl = (unsigned char) (flow ? 2 : 1);
                                 /* 2 is hardware, 1 is XON/XOFF */
   regs.x.dx = portNum;
   int86(0x14, &regs, &regs);
#else /* ARTICOMM_INT14 */
   if (flow)
   {
      printmsg(4, "iflowcontrol: in-band flow control not supported");
   }
#endif /* ARTICOMM_INT14 */

   ShowModem();

} /* iflowcontrol */
开发者ID:swhobbit,项目名称:UUPC,代码行数:27,代码来源:ulib14.c


示例7: pWinSockInit

KWBoolean pWinSockInit( void )
{

/*--------------------------------------------------------------------*/
/*                          Load the library                          */
/*--------------------------------------------------------------------*/

   if (!hWinsock)
      hWinsock = LoadLibrary("WINSOCK.DLL");
   else {
      printmsg(0,"pWinSockInit: called twice with no termination");
      panic();
   }

   if (!hWinsock)
   {
      printmsg(0, "pWinSockInit: could not find Winsock.DLL");
      return KWFalse;
   }

/*--------------------------------------------------------------------*/
/*       Initialize pointers to functions with in the libraries       */
/*--------------------------------------------------------------------*/

#ifdef __TURBOC__
#pragma warn -sus
#endif

   paccept                = GetProcAddress(hWinsock, (LPSTR)MAKELONG(  1,0));
   pbind                  = GetProcAddress(hWinsock, (LPSTR)MAKELONG(  2,0));
   pclosesocket           = GetProcAddress(hWinsock, (LPSTR)MAKELONG(  3,0));
   pconnect               = GetProcAddress(hWinsock, (LPSTR)MAKELONG(  4,0));
   phtonl                 = GetProcAddress(hWinsock, (LPSTR)MAKELONG(  8,0));
   phtons                 = GetProcAddress(hWinsock, (LPSTR)MAKELONG(  9,0));
   pinet_addr             = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 10,0));
   plisten                = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 13,0));
   pntohl                 = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 14,0));
   pntohs                 = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 15,0));
   precv                  = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 16,0));
   pselect                = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 18,0));
   psend                  = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 19,0));
   psetsockopt            = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 21,0));
   pshutdown              = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 22,0));
   psocket                = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 23,0));
   pgethostbyname         = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 52,0));
   pgetservbyname         = GetProcAddress(hWinsock, (LPSTR)MAKELONG( 55,0));
   pWSAGetLastError       = GetProcAddress(hWinsock, (LPSTR)MAKELONG(111,0));
   pWSACancelBlockingCall = GetProcAddress(hWinsock, (LPSTR)MAKELONG(113,0));
   pWSAIsBlocking         = GetProcAddress(hWinsock, (LPSTR)MAKELONG(114,0));
   pWSAStartup            = GetProcAddress(hWinsock, (LPSTR)MAKELONG(115,0));
   pWSACleanup            = GetProcAddress(hWinsock, (LPSTR)MAKELONG(116,0));

#ifdef __TURBOC__
#pragma warn .sus
#endif

   return KWTrue;

} /* pWinSockInit */
开发者ID:swhobbit,项目名称:UUPC,代码行数:59,代码来源:pwinsock.c


示例8: viewcmd

bool viewcmd(char *itemName, CFErrorRef *err) {
    char *cmd, *viewname;
    SOSViewActionCode ac = kSOSCCViewQuery;
    CFStringRef viewspec;
    
    viewname = strchr(itemName, ':');
    if(viewname == NULL) return false;
    *viewname = 0;
    viewname++;
    cmd = itemName;
    
    if(strcmp(cmd, "enable") == 0) {
        ac = kSOSCCViewEnable;
    } else if(strcmp(cmd, "disable") == 0) {
        ac = kSOSCCViewDisable;
    } else if(strcmp(cmd, "query") == 0) {
        ac = kSOSCCViewQuery;
    } else {
        return false;
    }
    
    if(strchr(viewname, ',') == NULL) { // original single value version
        viewspec = convertStringToView(viewname);
        if(!viewspec) return false;
        
        SOSViewResultCode rc = SOSCCView(viewspec, ac, err);
        CFStringRef resultString = convertViewReturnCodeToString(rc);
        
        printmsg(CFSTR("View Result: %@ : %@\n"), resultString, viewspec);
        return true;
    }
    
    if(ac == kSOSCCViewQuery) return false;
    
    // new multi-view version
    char *viewlist = strdup(viewname);
    char *token;
    char *tofree = viewlist;
    CFMutableSetRef viewSet = CFSetCreateMutable(NULL, 0, &kCFCopyStringSetCallBacks);
    
    while ((token = strsep(&viewlist, ",")) != NULL) {
        CFStringRef resultString = convertStringToView(token);
        CFSetAddValue(viewSet, resultString);
    }
    
    printmsg(CFSTR("viewSet provided is %@\n"), viewSet);
    
    free(tofree);
    
    bool retcode;
    if(ac == kSOSCCViewEnable) retcode = SOSCCViewSet(viewSet, NULL);
    else retcode = SOSCCViewSet(NULL, viewSet);
    
    fprintf(outFile, "SOSCCViewSet returned %s\n", (retcode)? "true": "false");
    
    return true;
}
开发者ID:darlinghq,项目名称:darling-security,代码行数:57,代码来源:secViewDisplay.c


示例9: AutoBounceSMTP

static KWBoolean
AutoBounceSMTP(
   int   status,
   IMFILE *imf,
   const MAIL_ADDR *sender,
   SMTP_ADDR *toAddress,
   int count,
   const char *relay,
   const KWBoolean validate,
   const unsigned int timeout
)
{
   int subscript;

   switch(status)
   {
      case KWNSSuccess:
         /* No problem, so do not force termination */
         return KWFalse;

      case KWNSNoNet:
         printmsg(0,"Network connection lost with %s"
                    ", requeuing for retry.",
                    relay);
         shutdownSMTP(0);
         return KWTrue;

      case KWNSNetTimeout:
         printmsg(0,"Network timeout occurred, breaking off exchange with %s"
                    " and requeuing for retry.",
                    relay );
         shutdownSMTP(timeout);
         return KWTrue;

      case KWNSTransientError:
         printmsg(0,"Transient procotol error with %s"
                     ", requeuing for retry.",
                     relay);
         shutdownSMTP(timeout);
         return KWTrue;

      default:
         Bounce(imf,
                sender,
                "SMTP Protocol Permanent Error occurred",
                GET_TRACE_BUFFER(),
                relay,
                validate);
       /* Treat all bounced addresses as processed */
       for (subscript = 0; subscript < count; subscript++)
             toAddress[subscript].processed = KWTrue;
         return KWTrue;

   } /* switch(status) */

} /* SMTPAutoBounce */
开发者ID:swhobbit,项目名称:UUPC,代码行数:56,代码来源:delivers.c


示例10: getSeq

unsigned long getSeq()
{
   char seqfile[FILENAME_MAX];
   FILE *stream;
   unsigned long seq = 0;

   mkfilename(seqfile, E_spooldir, SFILENAME);

   if ((stream = FOPEN(seqfile, "r+", IMAGE_MODE)) == nil(FILE))
   {
      printerr( seqfile );

      if ((stream = FOPEN(seqfile, "w", IMAGE_MODE)) == nil(FILE))
      {
         printerr( seqfile );
         panic();
      }
   }
   else {
      if ( fread( &seq, sizeof seq, 1, stream ) != 1 )
         printerr( seqfile );
   }

/*--------------------------------------------------------------------*/
/*     Generate a new seed for our sequence if we can't read one      */
/*--------------------------------------------------------------------*/

   if ( ! seq++ )
   {
      seq = ((unsigned long) getpid()) % 10000000;
                                    /* Start number small, semi-unique*/

      printmsg(0,"Resetting sequence number to %lu (0x%08lx)",
                  seq,
                  seq );
   }

/*--------------------------------------------------------------------*/
/*                       Update sequence number                       */
/*--------------------------------------------------------------------*/

   rewind( stream );

   if ((fwrite( &seq, sizeof seq, 1, stream ) != 1) || fclose(stream))
   {
      printerr( seqfile );
      panic();
   }

#ifdef UDEBUG
   printmsg(8, "getseq: seq#=%ld", seq);
#endif

   return seq;

} /* getseq */
开发者ID:swhobbit,项目名称:UUPC,代码行数:56,代码来源:getseq.c


示例11: freeBuf

void
freeBuf( void *oldBuffer, const char *file, const size_t line )
{
   while( top != NULL )
   {
      BUFQUEUE *save = top;

      KWBoolean done = (KWBoolean) ( top->userBuffer == oldBuffer ?
                                       KWTrue : KWFalse );

      if ( top->signature != SIGNATURE )
      {
         printmsg(0, "freeBuf: Invalid buffer queue at %p", top );
         bugout( file, line );
      }

      if ( top->userBuffer == oldBuffer )
         done = KWTrue;

#ifdef UDEBUG
      printmsg(done ? 8 : 2,"%s(%d): freeBuf: %slicit "
                  "free of %p (%d,%d) for %u bytes",
                  file,
                  line,
                  done ? "ex" : "im",
                  top,
                  top->entry,
                  entries,
                  top->length );

      entries--;
#endif

/*--------------------------------------------------------------------*/
/*            Pop the current entry off the stack and free it         */
/*--------------------------------------------------------------------*/

      top = top->previous;
      free( save );

      if ( done )
         return;

   } /* while( top != NULL ) */

/*--------------------------------------------------------------------*/
/*       If we didn't find the block to free, we have a serious       */
/*       internal error -- report it and exit.                        */
/*--------------------------------------------------------------------*/

   printmsg( 0, "freeBuf: Unable to locate requested memory block at %p",
                 oldBuffer );
   bugout( file, line );

} /* freeBuf */
开发者ID:swhobbit,项目名称:UUPC,代码行数:55,代码来源:makebuf.c


示例12: gotpacket

static void
gotpacket(char msg[], int len)
{
	int	i;

	/* What did we get?  */
	switch (msg[0]) {
	case 'a':
		break;
	case 'b':
		printmsg(msg, len, 0);
		break;
	case 'c':
		printmsg(msg, len, 1);
		break;
	case 'd':
	case 'f':
		printmsg(msg, len, 2);
		break;
	case 'e':
		timestamp();
		fprintf(stdout, "%s ", tbuf);
		fputs("-!- [Error] ", stdout);
		for (i = 1; i < len; i++)
			fputc(msg[i], stdout);
		fputc('\n', stdout);
		break;
	case 'g':
		timestamp();
		fprintf(stdout, "%s ", tbuf);
		fputs("-!- [Error] Connection closed by server\n", stdout);
		running = 0;
		break;
	case 'i':
		printicmd(msg, len);
		break;
	case 'j':
		sendlogin();	/* Now we can log in.  */
		break;
	case 'k':
		timestamp();
		fprintf(stdout, "%s ", tbuf);
		fputs("-!- [Beep] You were beeped by ", stdout);
		for (i = 1; i < len; i++)
			fputc(msg[i], stdout);
		fputc('\n', stdout);
		break;
	case 'l':
	case 'm':
		break;
	default:
		fputs("Received invalid packet.\n", stdout);
		break;
	}
}
开发者ID:JamesLinus,项目名称:LiteBSD-Ports,代码行数:55,代码来源:icb.c


示例13: internal

static KWBoolean internal( const char *command )
{
   static char *commands[] = { "break",   "cd",    "chdir",    "copy",
                               "ctty",    "date",  "del",      "dir",
                               "echo",    "erase", "for",      "md",
                               "mkdir",   "rd",    "rem",      "ren",
                               "rename",  "rmdir", "time",     "type",
                               "ver",     "verify",  "vol",
                               NULL };
   char **list;

/*--------------------------------------------------------------------*/
/*       Empty commands are a special signal to use the command       */
/*       processor to run the arguments.                              */
/*--------------------------------------------------------------------*/

   if ( *command == '\0' )
   {
      printmsg(4,"internal: Empty command, using command processor");
      return KWTrue;
   }

/*--------------------------------------------------------------------*/
/*                   Determine command list to use                    */
/*--------------------------------------------------------------------*/

   if (E_internal == NULL )
      list = commands;
   else
      list = E_internal;

/*--------------------------------------------------------------------*/
/*                   Scan the list for the command                    */
/*--------------------------------------------------------------------*/

   while( *list != NULL )
   {
      if (equali(*list++,command))
      {
         printmsg(4,"\"%s\" is an internal command",command);
         return KWTrue;
      } /* if */

   } /* while( *list != NULL ) */

/*--------------------------------------------------------------------*/
/*       The command is not in the list; return KWFalse (external      */
/*       command)                                                     */
/*--------------------------------------------------------------------*/

   printmsg(4,"\"%s\" is an external command",command);
   return KWFalse;

} /* internal */
开发者ID:swhobbit,项目名称:UUPC,代码行数:54,代码来源:execute.c


示例14: excluded

KWBoolean excluded(char *list, char *path)
{
    char    *t1, *t2, *t3;
    int     temp;

    printmsg(5, "exclude: checking %s against %s", list, path);

    t1 = strtok(list, ", ");

    while (t1 != NULL)
    {
        t2 = strstr(path, t1);

        while (t2 != NULL)
        {
            /* MUST be start of string or preceded by '!' */

            if ((t2 == path) ||
                    (*(t2 - 1) == '!'))
            {
                /* is this the only entry left ? */

                if (equal(t1, t2))
                    return KWTrue;

                /* must be directly followed by a '!' */

                t3 = strchr(t2, '!');

                if (t3 != NULL)
                {
                    *t3 = 0;
                    temp = strcmp(t1, t2);
                    *t3 = '!';
                    if (temp == 0)
                        return KWTrue;
                }
            }

            /* search for another occurence */
            t2 = strstr(t2 + 1, t1);

        }

        t1 = strtok(NULL, ", ");

    } /* while (t1 != NULL) */

    printmsg(5, "exclude: results in KWFalse");
    return KWFalse;

} /* excluded */
开发者ID:swhobbit,项目名称:UUPC,代码行数:52,代码来源:sys.c


示例15: printmsg

struct UserTable *checkuser(const char *name)
{
   int   lower;
   int   upper;

   if ( (name == NULL) || (strlen(name) == 0) )
   {
      printmsg(0,"checkuser: Invalid argument!");
      panic();
   }

#ifdef UDEBUG
   printmsg(14,"checkuser: Searching for user id %s", name);
#endif

 /*-------------------------------------------------------------------*/
 /*             Initialize the host name table if needed              */
 /*-------------------------------------------------------------------*/

   if (userElements == 0)           /* host table initialized yet?    */
      userElements = loaduser();        /* No --> load it             */

   lower = 0;
   upper = (int) userElements - 1;

/*--------------------------------------------------------------------*/
/*              Peform a binary search on the user table              */
/*--------------------------------------------------------------------*/

   while ( lower <= upper )
   {
      int midpoint;
      int hit;
      midpoint = (lower + upper) / 2;

      hit = stricmp(name,users[midpoint].uid);

      if (hit > 0)
         lower = midpoint + 1;
      else if (hit < 0)
         upper = midpoint - 1;
      else
         return &users[midpoint];
   }

/*--------------------------------------------------------------------*/
/*         We didn't find the user.  Return failure to caller         */
/*--------------------------------------------------------------------*/

   return BADUSER;

}  /* checkuser */
开发者ID:swhobbit,项目名称:UUPC,代码行数:52,代码来源:usertabl.c


示例16: initCtrl

int initCtrl (){
    
    if(!(SDL_Init(SDL_INIT_EVERYTHING))){

        SDL_SetEventFilter(eventFilter);
        SDL_SetVideoMode(200, 200, 0, 0);
        // SDL_WM_GrabInput(SDL_GRAB_ON);
        
        // If gamepad mode specified, open gamepad
        if(ctrlmode == GAMEPAD){

            int num_pads;

            // If more than one joystick attached, let user choose which one
            if((num_pads = SDL_NumJoysticks()) > 1){

                sprintf(termbuf, "Select gamepad index (number from 0 to %d): ", (num_pads-1));
                printmsg();
                while((pad_index = fgetc(stdin)) == EOF);
            }

            if((pad = SDL_JoystickOpen(pad_index))){

                sprintf(termbuf, "%s opened successfully.\n",
                        SDL_JoystickName(pad_index));
                printmsg();
                
                // Set initial modes
                cur_move = MOV_STOP;
                cur_turn = TRN_NONE;
                cur_h_aim = AIM_H_STRGHT;
                cur_v_aim = AIM_V_STRGHT;
                cur_fire = FIRE_OFF;
                cur_l_strf = STRF_L_OFF;
                cur_r_strf = STRF_R_OFF;

                SDL_JoystickEventState(SDL_ENABLE);
            }
            else{

                sprintf(termbuf, "Gamepad %s not opened successfully.\nReverting to keyboard control\n",
                        SDL_JoystickName(pad_index));
                printmsg();
                ctrlmode = KEYBOARD;
            }
        }

        return -1;
    }

    return 0;
}
开发者ID:illinoistechrobotics,项目名称:mongol,代码行数:52,代码来源:Controller.c


示例17: main

/*----------------------------------------------------------------
* main
*
* wlanctl-ng entry point.
*
* Arguments:
*	argc	number of command line arguments
*	argv	array of argument strings
*
* Returns: 
*	0	- success 
*	~0	- failure
----------------------------------------------------------------*/
int main ( int argc, char **argv )
{
	UINT8	message[MSG_BUFF_LEN];
	UINT32	msgcode = P80211DID_INVALID;
	INT	result = 0;
	INT	i;

	if ( argc < 4 && argc >= 2 && strcmp( argv[1], "version") == 0) {
		printf("wlanctl-ng: %s\n", WLAN_RELEASE);			
	}
	else if ( argc < 4 && argc >= 2 && strcmp( argv[1], "commands") == 0) {
		print_allrequests();			
	}
	else if ( argc < 4 && argc >= 2 && strcmp( argv[1], "mibs") == 0) {
		print_allmibs();			
	}
	else if ( argc <  3 ) {
		usage();
	} else {
		/* stuff the device name in a global */
		devname = argv[1];

		/* returns P80211DID_INVALID no match */
		for ( i = 0; i < sizeof(cmdcats)/sizeof(cmdcats[0]); i++) {
			msgcode = p80211_text2did(msg_catlist, 
					cmdcats[i], argv[2], NULL);
			if ( msgcode != P80211DID_INVALID ) {
				break;
			}
		}

		if (msgcode != P80211DID_INVALID) { /* msgcode valid */
			result = cmdline2requestmsg( message, msgcode, argc, argv );

			if ( result == 0 ) {
				if ( (result = do_ioctl( message, msgcode )) == 0 ){
				printmsg( message, msgcode );
				}
			} else {
				printmsg( message, msgcode );
/*
				printf("Message \"%s\" was unable to be created\n", argv[2]);
*/
			}
		} else { /* msgcode invalid */
			printf("The cmd \'%s\' is invalid\n", argv[2]);
			result=msgcode;
		} 
	}

	return(result);
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:65,代码来源:wlanctl.c


示例18: SendSMTPCmd

static KWNetStatus
SendSMTPCmd(
  char        *cmd      /* IN The command to send */
)
{
   char buffer[KW_BUFSIZ];
   int len = (int) strlen(cmd);
   KWBoolean buffered = KWFalse;

  bufferTrace(">>>", cmd, len);

/*--------------------------------------------------------------------*/
/*       Buffer the command if possible to allow appending the        */
/*       CR/LF for transmission of the resulting logical line as      */
/*       one network write.                                           */
/*--------------------------------------------------------------------*/

  if (sizeof buffer > (len + 3))
  {
     strcpy(buffer, cmd);
     strcpy(buffer + len, CRLF);
     len += CRLF_LEN;
     cmd = buffer;
     buffered = KWTrue;
  }

/*--------------------------------------------------------------------*/
/*           Actually perform the network write of the command        */
/*--------------------------------------------------------------------*/

  if (swrite(cmd, len) < len)
  {
     printmsg(0,"Error sending command to remote host");
     return KWNSNoNet;
  }

/*--------------------------------------------------------------------*/
/*       If the command was not buffered, write the trailing CR/LF    */
/*--------------------------------------------------------------------*/

  if (!buffered && (swrite(CRLF, CRLF_LEN) < CRLF_LEN))
  {
    printmsg(0, "Error sending CR/LF to remote host");
    return KWNSNoNet;
  }

  return KWNSSuccess;

} /* SendSMTPCmd */
开发者ID:swhobbit,项目名称:UUPC,代码行数:49,代码来源:delivers.c


示例19: safefree

void safefree( void *input , const char UUFAR *file, size_t line)
{
   STR_QUEUE *current = anchor;
   int buffers = 0;

   while( current != NULL )
   {
      buffers ++;
      if (( input > (void *) current ) &&
          (input < (void *) (current->pool + pool_size ) ))
      {
         printmsg(0,"Attempt to free string \"%s\" allocated via newstr() in pool %d",
                  input , buffers );

         bugout( file, line);
      }

      current = current->next_link;
   }

#undef free

   free(input);

} /* safefree */
开发者ID:swhobbit,项目名称:UUPC,代码行数:25,代码来源:strpool.c


示例20: main

int main() {
  char str[10] = "<1E2F1>";

  printmsg(str);


}
开发者ID:erlendkg,项目名称:Sanntid,代码行数:7,代码来源:test.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ printout函数代码示例发布时间:2022-05-30
下一篇:
C++ printm函数代码示例发布时间: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