Hi all,
 
>     Can you provide s short segment of source about how to use these
two
> functions? I just tried to use __console() send message to console but
got
> nothing.
>      Thx!

here is a small test program using the __console() function to display a
message on the console and/or the system log, then wait for either a
MODIFY or a STOP command and then terminate.

I don't have a running program for the __console2() function. We simply
did not need the enhanced capabilities of routing code specifications
etc., so we settled with the __console().

Wolfgang 

----- cut here -----
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/__messag.h>

static char szHelloMessage[] = "TEST Program for console() started" ;

extern int main ( int argc , char *argv[] )
{
   struct __cons_msg  consoleMessage;
   int rc;
   char caCommandString[200];
   int  iConsoleCommand;

   consoleMessage.__format.__f1.__msg_length = strlen(szHelloMessage);
   consoleMessage.__format.__f1.__msg        = szHelloMessage;

   printf ( "Calling __console() function\n" );

   rc = __console(&consoleMessage,caCommandString,&iConsoleCommand);

   if ( rc == 0 )
   {
      switch ( iConsoleCommand )
      {
         case _CC_modify:
            printf ( "Modify command received, CMD = %s\n" ,
                     caCommandString );
            break;

         case _CC_stop:
            printf ( "Stop command received\n" );
            break;

         default:
            printf ( "Invalid command type received from __console(),"
                     " type = %d\n" , iConsoleCommand );
            break;
      }
   }
   else
   {
      printf ( "Call to __console() failed, errno = %d\n" , errno );
   }
}

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to