/** returns true if the pointer associated with the storage is NULL */ bool is_null() const { void *ptr; status_t status = get_data_handle(&ptr); assert(status == status::success); MAYBE_UNUSED(status); return !ptr; }
void *data_handle() const { void *handle; status_t status = get_data_handle(&handle); assert(status == status::success); MAYBE_UNUSED(status); return handle; }
static char *displ_picture(char *c) { char *d; int x,y,hn,z,ln,sl; short *sh; d = write_buff; while (*c !=':') *d++= *c++; *d++= 0;c++; hn = get_data_handle(write_buff,pcx_8bit_decomp); x = read_num(c,(z = 0,&z));c += z; y = read_num(c,(z = 0,&z));c += z; ln = read_num(c,(z = 0,&z));c += z; sl = read_num(c,(z = 0,&z));c += z; sh = ablock(hn); if (sh[1]+y>YMAX) return c; y += YLEFT; x += relpos; put_8bit_clipped(sh,GetScreenAdr()+x+scr_linelen2*y,ln,sh[0],sl); return c; }
static void insert_picture(char *filename,int align,int line,int lsize) { int x, y; short *psiz; char *c = write_buff; psiz = ablock(get_data_handle(filename,pcx_8bit_decomp)); switch (align) { case ANUM_CENTER: x = (XMAX-psiz[0])/2; y = linepos; linepos += psiz[1]; *c++= 27; *c++= END_LINE; c += insert_num(c,0,psiz[1]+last_skip); break; case ANUM_LEFT: x = 0; y = linepos; left_skip = psiz[0]+5; total_width = XMAX-left_skip; break; case ANUM_RIGHT: total_width = (x = XMAX-psiz[0])-5; left_skip = 0; y = linepos; break; } if (!lsize) lsize = psiz[1]-line; picture_len = lsize; *c++= 27; *c++= PICTURE; while (*filename) *c++= *filename++; *c++=':'; c += insert_num(c,0,x); c += insert_num(c,0,y); c += insert_num(c,0,line); c += insert_num(c,0,lsize); *c++= 0; str_add(&all_text,write_buff); }
virtual status_t map_data(void **mapped_ptr) const { return get_data_handle(mapped_ptr); }