The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
%require "common.ps"
%require "rect.ps"
%require "break.ps"

% arrow from sv_u.pvx
% /Helvetica-Bold 9 SF
% 5 262 M (svu_rv) show
% 42 265 47 265 47 310 112 310 112 292.5 118 292.5 ptrn
% newpath 97.5 292.5 2 0 360 arc fill
% 97.5 292.5 M 113 292.5 L stroke
% 113 290 M 120 292.5 L 113 295 L closepath fill

% char* box
gsave
   0.8 setgray
   190 285 220 300 rect F
grestore

0.5 setlinewidth
130 10 210 {
   dup 300 M 285 L S
} for
1 setlinewidth
120 285 220 300 rect S

/Courier 8 SF
120 302 M (char[]) show
208 302 M (REFCNT) show
208 309 M (>5.18)  show

125 290 M
[(a) (b) (c) (?) (x) (y) (z) (\\0) () (C)] {
   gsave
     dup stringwidth pop 2 div neg 0 RM show
   grestore
   10 0 RM
} forall



%break in the midle of char*
153 300 break

% Some lines indicating the value of CUR/LEN
gsave
red

% CUR length
0.5 setlinewidth
120 260 M 120 265 L
120 262.5 M 190 262.5 L
190 260 M 190 265 L
stroke
120 262.5 M 124 264 L 124 261 L closepath fill
190 262.5 M 186 264 L 186 261 L closepath fill

% LEN length
120 250 M 120 245 L
120 247.5 M 220 247.5 L
220 250 M 220 245 L
stroke
120 247.5 M 124 249 L 124 244 L closepath fill
220 247.5 M 216 249 L 216 244 L closepath fill

grestore