?? ndial.c
字號:
#include "net.h"
#include "local.h"
#include "support.h"
#include "script.h"
/*
** * * * * * *
** ussDial() Perform a dial script in blocking mode
**
** int ussDial(int netno, const char *script);
**
** PARAMETERS:
** (in) int netno A network number
** (in) const char *script A dial script
**
** RETURNS
** 0 Success
** -1 Failure
**
** DESCRIPTION:
** This function will perform a dial script in blocking mode.
** * * * * * *
*/
int ussDial(int netno, const char *script)
{
struct NET *netp;
int status;
if (netno < 0 || netno >= NNETS) {
#if NTRACE
Nprintf("Ndial: Network number not valid\n");
#endif
return -1;
}
/* This routine only works with serial devices */
netp = &nets[netno];
if (netp->protoc[0] != SLIP && netp->protoc[0] != PPP) {
#if NTRACE
Nprintf("Ndial: Interface not SLIP or PPP\n");
#endif
return -1;
}
/* Do script opertaions until the status is finished, good or bad */
ussScriptInit(netno, script);
do {
status = ussScriptTimeout(netno);
} while (status == 0);
/* If the status is success (1), return 0; else return status (-1) */
return (status == 1) ? 0 : status;
}
/*
** * * * * * *
** Ndial() Perform dial-out or dial-down operation
**
** int Ndial(int netno, char *phonenumber
**
** PARAMETERS:
** (in) int netno a yfnet network number
** (in) char *phonenumber a pointer to an ASCII phone number string
**
** DESCRIPTION:
** This function will dial down if phonenumber == 0. Otherwise, this
** function will dial out to the phonenumber.
** * * * * * *
*/
int Ndial(int netno,char *phonenumber)
{
const char *script;
/* If phone number is defined, dial out */
if (phonenumber) {
ussScriptPhoneNum = phonenumber;
script = ussDialScrTable[ussDialIxOutE];
}
/* Else dial down */
else
script = ussDialScrTable[ussDialIxDownE];
return ussDial(netno, script);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -