// Copyright status: this file is in the public domain. #include #include "lx.h" #include "proto.h" #include "internal.h" void lx_SGC_SetDashes(LX_CONN *xc, LX_SGC sgcid, int offset, int ndash, const unsigned char *dashes) { SGC *sgc; if ( (xc->flags & XCF_FAIL) || (offset < 0) || (offset > 65535) || (ndash < 1) || (ndash > ((65535-3)*4)) ) { lx__bad_call(xc,"lx_SGC_SetDashes"); return; } sgc = lx__lookup_sgc(xc,sgcid); if (! sgc) { lx__bad_call(xc,"lx_SGC_SetDashes"); return; } while (!(ndash & 1) && !bcmp(dashes,dashes+(ndash>>1),ndash>>1)) ndash >>= 1; if (lx__set_sgc_dash_list_len(&sgc->setv,ndash)) { lx__nomem_fail(xc); return; } sgc->set |= LX_GCM_DashOffset | LX_GCM_Dashes; sgc->setv.core.dash_offset = offset; bcopy(dashes,sgc->setv.dashv,ndash); }