#include #include "lx.h" #include "proto.h" #include "internal.h" void lx_ImageText16(LX_CONN *xc, LX_XID drawable, LX_XID gc, int x, int y, const unsigned short int *str, int len) { int reqlen; unsigned char *req; int i; if ((xc->flags & XCF_FAIL) || (x < -32768) || (x > 32767) || (y < -32768) || (y > 32767) || (len < 0) || (len > 255)) { lx__bad_call(xc,"lx_ImageText16"); return; } reqlen = 4 + (((2 * len) + 3) >> 2); req = malloc(reqlen*4); if (! req) { lx__nomem_fail(xc); return; } req[0] = XP_REQ_ImageText16; 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); for (i=len-1;i>=0;i--) w_char2b(req+16+(2*i),str[i]); lx__send_req_free(xc,req,reqlen*4); }