Lines Matching refs:cctx
21 struct custom_ctx *cctx = (struct custom_ctx*)ctx; in _rym_bg() local
22 cctx->fpath[0] = '/'; in _rym_bg()
24 strcpy(&(cctx->fpath[1]), (const char*)buf); in _rym_bg()
25 cctx->fd = open(cctx->fpath, O_CREAT | O_WRONLY | O_TRUNC, 0); in _rym_bg()
26 if (cctx->fd < 0) in _rym_bg()
34 cctx->flen = atoi((const char*)buf+strlen((const char*)buf)+1); in _rym_bg()
35 if (cctx->flen == 0) in _rym_bg()
36 cctx->flen = -1; in _rym_bg()
45 struct custom_ctx *cctx = (struct custom_ctx*)ctx; in _rym_tof() local
46 RT_ASSERT(cctx->fd >= 0); in _rym_tof()
47 if (cctx->flen == -1) in _rym_tof()
49 write(cctx->fd, buf, len); in _rym_tof()
53 int wlen = len > cctx->flen ? cctx->flen : len; in _rym_tof()
54 write(cctx->fd, buf, wlen); in _rym_tof()
55 cctx->flen -= wlen; in _rym_tof()
65 struct custom_ctx *cctx = (struct custom_ctx*)ctx; in _rym_end() local
67 RT_ASSERT(cctx->fd >= 0); in _rym_end()
68 close(cctx->fd); in _rym_end()
69 cctx->fd = -1; in _rym_end()