コード例 #1
0
ファイル: sub.c プロジェクト: AhmadTux/DragonFlyBSD
/* extract_subst_tail: extract substitution tail from the command buffer */
int
extract_subst_tail(int *flagp, long *np)
{
	char delimiter;

	*flagp = *np = 0;
	if ((delimiter = *ibufp) == '\n') {
		rhbufi = 0;
		*flagp = GPR;
		return 0;
	} else if (extract_subst_template() == NULL)
		return  ERR;
	else if (*ibufp == '\n') {
		*flagp = GPR;
		return 0;
	} else if (*ibufp == delimiter)
		ibufp++;
	if ('1' <= *ibufp && *ibufp <= '9') {
		STRTOL(*np, ibufp);
		return 0;
	} else if (*ibufp == 'g') {
		ibufp++;
		*flagp = GSG;
		return 0;
	}
	return 0;
}
コード例 #2
0
ファイル: regex.c プロジェクト: ystk/debian-ed
/* extract substitution tail from the command buffer */
char extract_subst_tail( const char **ibufpp, int *gflagsp, int *snump,
                         const char isglobal )
  {
  const char delimiter = **ibufpp;

  *gflagsp = *snump = 0;
  if( delimiter == '\n' ) { stlen = 0; *gflagsp = GPR; return 1; }
  if( !extract_subst_template( ibufpp, isglobal ) ) return 0;
  if( **ibufpp == '\n' ) { *gflagsp = GPR; return 1; }
  if( **ibufpp == delimiter ) ++(*ibufpp);
  if( **ibufpp >= '1' && **ibufpp <= '9' ) return parse_int( snump, *ibufpp, ibufpp );
  if( **ibufpp == 'g' ) { ++(*ibufpp); *gflagsp = GSG; return 1; }
  return 1;
  }