#include #include #include "lx.h" #include "proto.h" #include "internal.h" void lx_ImageText8(LX_CONN *xc, LX_XID drawable, LX_XID gc, int x, int y, const unsigned char *str, int len) { int reqlen; unsigned char *req; if ((xc->flags & XCF_FAIL) || (x < -32768) || (x > 32767) || (y < -32768) || (y > 32767) || (len < 0) || (len > 255)) { lx__bad_call(xc,"lx_ImageText8"); return; } lx__nochain(xc); reqlen = 4 + ((len + 3) >> 2); req = malloc(reqlen*4); if (! req) { lx__nomem_fail(xc); return; } req[0] = XP_REQ_ImageText8; req[1] = len; w_card16(req+2,reqlen); w_card32(req+4,drawable); w_card32(req+8,gc); w_int16(req+12,x); w_int16(req+14,y); bcopy(str,req+16,len); lx__send_req_free(xc,req,reqlen*4); }