#include #include "lx.h" #include "proto.h" #include "internal.h" void lx_PolyPoint(LX_CONN *xc, LX_XID drawable, LX_XID gc, LX_COORDMODE cm, int npts, const LX_POINT *pts) { unsigned char *req; int i; int o; const LX_POINT *p; if ( (xc->flags & XCF_FAIL) || (npts < 0) || (npts > (65535-3)) ) { lx__bad_call(xc,"lx_PolyPoint"); return; } i = lx__coordmode_to_proto(cm); if (i < 0) { lx__bad_call(xc,"lx_PolyPoint"); return; } req = malloc(12+(4*npts)); if (! req) { lx__nomem_fail(xc); return; } req[0] = XP_REQ_PolyPoint; req[1] = i; w_card16(&req[2],3+npts); w_card32(&req[4],drawable); w_card32(&req[8],gc); o = 12; for (i=0;ix < -32768) || (p->x > 32767) || (p->y < -32768) || (p->y > 32767) ) { free(req); lx__bad_call(xc,"lx_PolyPoint"); return; } w_int16(&req[o],p->x); w_int16(&req[o+2],p->y); o += 4; } lx__send_req_free(xc,req,12+(4*npts)); }