- new double control (former controlmode = 2)

- better sea client compatibility
This commit is contained in:
zolliker
2006-06-20 13:30:48 +00:00
parent c1bbdb935e
commit 735a0e6987
10 changed files with 556 additions and 94 deletions

View File

@@ -22,6 +22,7 @@
#define ARG_INT 2
#define ARG_FLT 3
#define ARG_ARR 4
#define ARG_OUT 5
/*-------------------------------------------------------------------------*/
@@ -290,14 +291,21 @@ int CocGetArray(CocConn *conn, const char *name, float *value, int value_size) {
/*-------------------------------------------------------------------------*/
int CocGetOut(CocConn *conn, const char *name, OutFunc *func) {
return(CocPushArg(conn, name, func, ARG_OUT, 0));
}
/*-------------------------------------------------------------------------*/
int CocDoIt(CocConn *conn, char *res, int res_len) {
StrBuf *buf;
int i, pending;
float *arr;
CocArg *a;
char *resp, *t, tag;
char *resp, *t, tag, *str;
int iret=0;
int siz;
OutFunc *f;
assert(conn!=NULL);
ERR_I(CocCmdWithRetry(conn));
@@ -354,6 +362,10 @@ int CocDoIt(CocConn *conn, char *res, int res_len) {
resp="<array>";
} else if (a->type==ARG_CHAR) {
ERR_P(StrNGet(buf, (char *)a->adr, a->size, COC_SEP));
} else if (a->type==ARG_OUT) {
ERR_P(str=StrNGet(buf, NULL, 0, COC_SEP));
f=(OutFunc *)a->adr;
f->func(str, f->arg);
} else {
ERR_MSG("unknown type");
}