Lines Matching refs:offset
825 target.jstrcpy = function(jstr, tgt, offset = 0, maxBytes = -1, addNul = true){ argument
831 if(maxBytes<0) maxBytes = tgt.length - offset;
832 if(!(maxBytes>0) || !(offset>=0)) return 0;
834 const begin = offset, end = offset + maxBytes - (addNul ? 1 : 0);
835 for(; i < max && offset < end; ++i){
841 if(offset >= end) break;
842 tgt[offset++] = u;
844 if(offset + 1 >= end) break;
845 tgt[offset++] = 0xC0 | (u >> 6);
846 tgt[offset++] = 0x80 | (u & 0x3f);
848 if(offset + 2 >= end) break;
849 tgt[offset++] = 0xe0 | (u >> 12);
850 tgt[offset++] = 0x80 | ((u >> 6) & 0x3f);
851 tgt[offset++] = 0x80 | (u & 0x3f);
853 if(offset + 3 >= end) break;
854 tgt[offset++] = 0xf0 | (u >> 18);
855 tgt[offset++] = 0x80 | ((u >> 12) & 0x3f);
856 tgt[offset++] = 0x80 | ((u >> 6) & 0x3f);
857 tgt[offset++] = 0x80 | (u & 0x3f);
860 if(addNul) tgt[offset++] = 0;
861 return offset - begin;