-struct pipe_char_state {
- const char *name;
- unsigned long count;
- unsigned long sleep;
-};
-
-void pipe_char_pull(
- char * _state,
- unsigned char * buf,
- unsigned long esize,
- unsigned long * ecount)
-{
- struct pipe_char_state *state = (struct pipe_char_state *)_state;
-
- printf("pull1:%s: esize[%u] ecount[%u]\n",
- state->name, esize, *ecount);
- *ecount = state->count--;
- if (*ecount > esize) {
- *ecount = esize;
- }
- memset(buf, 0xDD, *ecount * sizeof(*buf));
- printf("pull2:%s: esize[%u] ecount[%u]\n",
- state->name, esize, *ecount);
-}
-
-void pipe_char_push(
- char * _state,
- unsigned char * buf,
- unsigned long ecount)
-{
- struct pipe_char_state *state = (struct pipe_char_state *)_state;
-
- printf("push:%s: ecount[%u]\n",
- state->name, ecount);
-}
-
-void pipe_char_alloc(
- char * _state,
- unsigned long bsize,
- unsigned char * * buf,
- unsigned long * bcount)
-{
- struct pipe_char_state *state = (struct pipe_char_state *)_state;
-
- printf("alloc1:%s: bsize[%u], bcount[%u]\n",
- state->name, bsize, *bcount);
- *bcount = bsize / sizeof(**buf);
- *buf = malloc(*bcount * sizeof(**buf));
- printf("alloc2:%s: bsize[%u], bcount[%u]\n",
- state->name, bsize, *bcount);
-}
-
-struct pipe_hyper_state {
- const char *name;
- unsigned long count;
- unsigned long sleep;
-};
-
-void pipe_hyper_pull(
- char * _state,
- hyper * buf,
- unsigned long esize,
- unsigned long * ecount)
-{
- struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
-
- printf("pull1:%s: esize[%u] ecount[%u]\n",
- state->name, esize, *ecount);
- *ecount = state->count--;
- if (*ecount > esize) {
- *ecount = esize;
- }
- memset(buf, 0xDD, *ecount * sizeof(*buf));
- printf("pull2:%s: esize[%u] ecount[%u]\n",
- state->name, esize, *ecount);
-}
-
-void pipe_hyper_push(
- char * _state,
- hyper * buf,
- unsigned long ecount)
-{
- struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
-
- printf("push:%s: ecount[%u]\n",
- state->name, ecount);
-}
-
-void pipe_hyper_alloc(
- char * _state,
- unsigned long bsize,
- hyper * * buf,
- unsigned long * bcount)
-{
- struct pipe_hyper_state *state = (struct pipe_hyper_state *)_state;
-
- printf("alloc1:%s: bsize[%u], bcount[%u]\n",
- state->name, bsize, *bcount);
- *bcount = bsize / sizeof(**buf);
- *buf = malloc(*bcount * sizeof(**buf));
- printf("alloc2:%s: bsize[%u], bcount[%u]\n",
- state->name, bsize, *bcount);
-}
-struct pipe_structtype_state {
- const char *name;
- unsigned long count;
- unsigned long sleep;
-};
-
-RPC_STATUS pipe_structtype_pull(
- char * _state,
- structtype * buf,
- unsigned long esize,
- unsigned long * ecount)
-{
- struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
-
- printf("pull1:%s: esize[%u] ecount[%u]\n",
- state->name, esize, *ecount);
- *ecount = state->count--;
- if (*ecount > esize) {
- *ecount = esize;
- }
- memset(buf, 0xDD, *ecount * sizeof(*buf));
- printf("pull2:%s: esize[%u] ecount[%u]\n",
- state->name, esize, *ecount);
-}
-
-RPC_STATUS pipe_structtype_push(
- char * _state,
- structtype * buf,
- unsigned long ecount)
-{
- struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
-
- printf("push:%s: ecount[%u]\n",
- state->name, ecount);
-}
-
-RPC_STATUS pipe_structtype_alloc(
- char * _state,
- unsigned long bsize,
- structtype * * buf,
- unsigned long * bcount)
-{
- struct pipe_structtype_state *state = (struct pipe_structtype_state *)_state;
-
- printf("alloc1:%s: bsize[%u], bcount[%u]\n",
- state->name, bsize, *bcount);
- *bcount = bsize / sizeof(**buf);
- *buf = malloc(*bcount * sizeof(**buf));
- printf("alloc2:%s: bsize[%u], bcount[%u]\n",
- state->name, bsize, *bcount);
-}