 |
My Project
debian-1:4.1.2-p1+ds-2
|
Go to the source code of this file.
◆ s_si_link_extension
struct s_si_link_extension |
◆ sip_link
Definition at line 52 of file silink.h.
Data Fields |
void * |
data |
|
BITSET |
flags |
|
si_link_extension |
m |
|
char * |
mode |
|
char * |
name |
|
short |
ref |
|
◆ link_struct
◆ SI_LINK_CLOSE
◆ SI_LINK_CLOSE_P
#define SI_LINK_CLOSE_P |
( |
|
l | ) |
(!(l)->flags) |
◆ SI_LINK_OPEN
◆ SI_LINK_OPEN_P
◆ SI_LINK_R_OPEN_P
◆ SI_LINK_READ
◆ SI_LINK_RW_OPEN_P
◆ SI_LINK_SET_CLOSE_P
◆ SI_LINK_SET_OPEN_P
◆ SI_LINK_SET_R_OPEN_P
◆ SI_LINK_SET_RW_OPEN_P
◆ SI_LINK_SET_W_OPEN_P
◆ SI_LINK_W_OPEN_P
◆ SI_LINK_WRITE
◆ link_list
◆ si_link
◆ slCloseProc
◆ slDumpProc
◆ slGetDumpProc
◆ slKillProc
◆ slOpenProc
◆ slPrepCloseProc
◆ slRead2Proc
◆ slReadProc
◆ slSetRingProc
◆ slWriteProc
◆ slCleanUp()
Definition at line 126 of file silink.cc.
134 if (
l->m->Close !=
NULL)
l->m->Close(
l);
136 if ((
l->data !=
NULL) && (
l->m->Kill !=
NULL))
l->m->Kill(
l);
139 memset((
void *)
l, 0,
sizeof(ip_link));
◆ slClose()
Definition at line 241 of file silink.cc.
249 if (
l->m->Close !=
NULL)
251 res =
l->m->Close(
l);
253 Werror(
"close: Error for link of type: %s, mode: %s, name: %s",
254 l->m->type,
l->mode,
l->name);
◆ slCopy()
◆ slDump()
Definition at line 345 of file silink.cc.
356 if (
l->m->Dump !=
NULL)
362 Werror(
"dump: Error for link of type %s, mode: %s, name: %s",
363 l->m->type,
l->mode,
l->name);
369 Werror(
"dump: Error to open link of type %s, mode: %s, name: %s for writing",
370 l->m->type,
l->mode,
l->name);
◆ slGetDump()
Definition at line 375 of file silink.cc.
386 if (
l->m->GetDump !=
NULL)
387 res =
l->m->GetDump(
l);
392 Werror(
"getdump: Error for link of type %s, mode: %s, name: %s",
393 l->m->type,
l->mode,
l->name);
399 Werror(
"dump: Error open link of type %s, mode: %s, name: %s for reading",
400 l->m->type,
l->mode,
l->name);
◆ slInit()
Definition at line 47 of file silink.cc.
57 while (istr[
i] !=
':' && istr[
i] !=
'\0')
i++;
69 while (istr[
j] !=
' ' && istr[
j] !=
'\0')
j++;
76 while (istr[
j] ==
' '&& istr[
j] !=
'\0')
j++;
82 while (istr[
j] ==
' '&& istr[
j] !=
'\0')
j++;
91 si_link_extension prev =
s;
93 while (strcmp(
s->type, type) != 0)
◆ slKill()
◆ slOpen()
Definition at line 193 of file silink.cc.
208 Warn(
"open: link of type: %s, mode: %s, name: %s is already open",
209 l->m->type,
l->mode,
l->name);
212 else if (
l->m->Open !=
NULL)
214 res =
l->m->Open(
l, flag,
h);
216 Werror(
"open: Error for link %s of type: %s, mode: %s, name: %s",
217 c,
l->m->type,
l->mode,
l->name);
◆ slPrepClose()
Definition at line 224 of file silink.cc.
231 if (
l->m->PrepClose !=
NULL)
233 res =
l->m->PrepClose(
l);
235 Werror(
"close: Error for link of type: %s, mode: %s, name: %s",
236 l->m->type,
l->mode,
l->name);
◆ slRead()
Definition at line 262 of file silink.cc.
282 if (
l->m->Read !=
NULL)
v =
l->m->Read(
l);
286 if (
l->m->Read2 !=
NULL)
v =
l->m->Read2(
l,a);
291 Werror(
"read: Error to open link of type %s, mode: %s, name: %s for reading",
292 l->m->type,
l->mode,
l->name);
303 Werror(
"read: Error for link of type %s, mode: %s, name: %s",
304 l->m->type,
l->mode,
l->name);
◆ slStandardInit()
◆ slStatus()
Definition at line 155 of file silink.cc.
157 if (
l ==
NULL)
return "empty link";
158 else if (
l->m ==
NULL)
return "unknown link type";
159 else if (strcmp(request,
"type") == 0)
return l->m->type;
160 else if (strcmp(request,
"mode") == 0)
return l->mode;
161 else if (strcmp(request,
"name") == 0)
return l->name;
162 else if (strcmp(request,
"exists") ==0)
165 if (si_lstat(
l->name,&
buf)==0)
return "yes";
168 else if (strcmp(request,
"open") == 0)
173 else if (strcmp(request,
"openread") == 0)
178 else if (strcmp(request,
"openwrite") == 0)
183 else if (
l->m->Status ==
NULL)
return "unknown status request";
184 else return l->m->Status(
l, request);
◆ slStatusSsiL()
int slStatusSsiL |
( |
lists |
L, |
|
|
int |
timeout |
|
) |
| |
Definition at line 1718 of file ssiLink.cc.
1736 fd_set mask, fdmask;
1743 struct timeval *wt_ptr=&wt;
1751 wt.tv_sec = timeout / 1000000;
1752 wt.tv_usec = timeout % 1000000;
1764 for(
i=L->
nr;
i>=0;
i--)
1769 {
WerrorS(
"all elements must be of type link");
return -2;}
1772 {
WerrorS(
"all links must be open");
return -2;}
1773 if (((strcmp(
l->m->type,
"ssi")!=0) && (strcmp(
l->m->type,
"MPtcp")!=0))
1774 || ((strcmp(
l->mode,
"fork")!=0) && (strcmp(
l->mode,
"tcp")!=0)
1775 && (strcmp(
l->mode,
"launch")!=0) && (strcmp(
l->mode,
"connect")!=0)))
1777 WerrorS(
"all links must be of type ssi:fork, ssi:tcp, ssi:connect");
1780 if (strcmp(
l->m->type,
"ssi")==0)
1786 FD_SET(d_fd, &fdmask);
1787 if (d_fd > max_fd) max_fd=d_fd;
1794 Werror(
"wrong link type >>%s<<",
l->m->type);
1804 for(
k = 0;
k < max_fd;
k++)
1806 if(FD_ISSET(
k, &fdmask))
1813 s = si_select(max_fd, &mask,
NULL,
NULL, wt_ptr);
1816 WerrorS(
"error in select call");
1826 while (
j<=max_fd) {
if (FD_ISSET(
j,&mask))
break;
j++; }
1827 for(
i=L->
nr;
i>=0;
i--)
1832 if (strcmp(
l->m->type,
"ssi")==0)
1840 Werror(
"wrong link type >>%s<<",
l->m->type);
1857 for(
k = 0;
k < max_fd;
k++)
1859 if(FD_ISSET(
k, &fdmask))
1873 wt.tv_sec = timeout / 1000000;
1874 wt.tv_usec = (timeout % 1000000);
1879 else if (isdigit(c))
1883 Werror(
"unknown char in ssiLink(%d)",c);
◆ slString()
◆ slWrite()
Definition at line 308 of file silink.cc.
327 if (
l->m->Write !=
NULL)
333 Werror(
"write: Error for link of type %s, mode: %s, name: %s",
334 l->m->type,
l->mode,
l->name);
339 Werror(
"write: Error to open link of type %s, mode: %s, name: %s for writing",
340 l->m->type,
l->mode,
l->name);
◆ ssiBatch()
int ssiBatch |
( |
const char * |
host, |
|
|
const char * |
port |
|
) |
| |
Definition at line 1890 of file ssiLink.cc.
1897 sprintf(
buf,
"ssi:connect %s:%s",host,port);
◆ ip_link_bin
◆ s_si_link_extension_bin
◆ sip_link_bin
◆ slStatusProc
◆ ssiToBeClosed
◆ ssiToBeClosed_inactive
BOOLEAN ssiWrite(si_link l, leftv data)
#define SI_LINK_SET_CLOSE_P(l)
BOOLEAN slGetDumpAscii(si_link l)
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
VAR omBin s_si_link_extension_bin
static si_link_extension slTypeInit(si_link_extension s, const char *type)
leftv ssiRead1(si_link l)
Class used for (list of) interpreter objects.
const char * slStatusAscii(si_link l, const char *request)
BOOLEAN slOpen(si_link l, short flag, leftv h)
#define SI_LINK_CLOSE_P(l)
#define SI_LINK_W_OPEN_P(l)
EXTERN_VAR omBin sleftv_bin
int status int void * buf
VAR volatile int defer_shutdown
void PrintS(const char *s)
#define omFreeSize(addr, size)
BOOLEAN slInit(si_link l, char *istr)
#define SI_LINK_R_OPEN_P(l)
leftv slReadAscii2(si_link l, leftv pr)
void s_ungetc(int c, s_buff F)
#define SI_LINK_OPEN_P(l)
EXTERN_VAR si_link_extension si_link_root
BOOLEAN slSetRingDummy(si_link, ring r, BOOLEAN)
static int si_max(const int a, const int b)
void Werror(const char *fmt,...)
BOOLEAN slClose(si_link l)
char name(const Variable &v)
void WerrorS(const char *s)
BOOLEAN slCloseAscii(si_link l)
void slCleanUp(si_link l)
const Variable & v
< [in] a sqrfree bivariate poly
VAR si_link_extension si_link_root
const CanonicalForm int s
BOOLEAN slDumpAscii(si_link l)
static void * feOptValue(feOptIndex opt)
#define SI_LINK_SET_RW_OPEN_P(l)
leftv slReadAscii(si_link l)
VAR volatile BOOLEAN do_shutdown
BOOLEAN slWriteAscii(si_link l, leftv v)
#define omFreeBin(addr, bin)
BOOLEAN slOpenAscii(si_link l, short flag, leftv)