# SKIP -- Skip characters/fields/lines in an input stream. define MAXSKIP 100 # maximum number of skips procedure t_skip () pointer input # Input pointer nskip # Array of skips int flag # Type of skip int start # Initial skip pointer sp, str int skips, ip, clgwrd(), clgeti(), ctoi() begin call smark (sp) call salloc (input, SZ_FNAME, TY_CHAR) call salloc (str, SZ_LINE, TY_CHAR) call salloc (nskip, MAXSKIP, TY_INT) call clgstr ("input", Memc[input], SZ_FNAME) flag = clgwrd ("type", Memc[str], SZ_LINE, "|characters|fields|lines|") start = clgeti ("start") call clgstr ("pattern", Memc[str], SZ_LINE) ip = 1 for (skips=0; ctoi (Memc[str], ip, Memi[nskip+skips])!=0; skips=skips+1) ; call strpak (Memc[input], Memc[input], SZ_FNAME) call skip (Memc[input], flag, start, Memi[nskip], skips) call sfree (sp) end