Lines Matching refs:sp
44 fd_fetch(krb5_storage * sp, void *data, size_t size)
46 return net_read(FD(sp), data, size);
50 fd_store(krb5_storage * sp, const void *data, size_t size)
52 return net_write(FD(sp), data, size);
56 fd_seek(krb5_storage * sp, off_t offset, int whence)
58 return lseek(FD(sp), offset, whence);
62 fd_trunc(krb5_storage * sp, off_t offset)
64 if (ftruncate(FD(sp), offset) == -1)
70 fd_free(krb5_storage * sp)
72 close(FD(sp));
91 krb5_storage *sp;
111 sp = malloc(sizeof(krb5_storage));
112 if (sp == NULL) {
117 sp->data = malloc(sizeof(fd_storage));
118 if (sp->data == NULL) {
120 free(sp);
123 sp->flags = 0;
124 sp->eof_code = HEIM_ERR_EOF;
125 FD(sp) = fd;
126 sp->fetch = fd_fetch;
127 sp->store = fd_store;
128 sp->seek = fd_seek;
129 sp->trunc = fd_trunc;
130 sp->free = fd_free;
131 sp->max_alloc = UINT_MAX/8;
132 return sp;