home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
NETCLB35.ZIP
/
NETCLB35.EXE
/
EXAMPLES
/
TOSERVER.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-03
|
2KB
|
53 lines
/***************************************************************************/
/* File: TOSERVER.C */
/* */
/* Function: Send message to the default server */
/* */
/* Usage: toserver "message" */
/* */
/* Functions Called: BroadcastToConsole */
/* GetPreferredConnectionID */
/* GetDefaultConnectionID */
/* GetPrimaryConnectionID */
/* SetPreferredConnectionID */
/* ISShellLoaded */
/* */
/***************************************************************************/
#include "netware.h"
#include <stdio.h>
int main (int argc,char *argv[])
{
int thisserver,prefserver;
if (argc !=2)
{
printf("Usage is 'toserver message'\n");
return(-1);
}
else
if (IsShellLoaded() != SUCCESS)
{
printf("*** No netware shell loaded ***\n");
return(255);
}
if ((prefserver = GetPreferredConnectionID()) == 0)
{
if ((thisserver = GetDefaultConnectionID()) == 0)
thisserver = GetPrimaryConnectionID();
SetPreferredConnectionID( thisserver );
}
else
thisserver = prefserver;
BroadcastToConsole(argv[1]);
if (thisserver != prefserver) /* reset preferred server */
SetPreferredConnectionID( prefserver );
return 0;
}