Example #1
0
Local void subgrep(struct LOC_grep *LINK)
{
  LINK->matching = true;
  if (LINK->pattern[LINK->p-1] == '*') {
    remember(LINK->s, strlen(LINK->source), LINK);
    LINK->p++;
    return;
  }
  if (LINK->pattern[LINK->p-1] == '?') {
    remember(LINK->s, LINK->s, LINK);
    LINK->p++;
    return;
  }
  if (LINK->pattern[LINK->p-1] == '#') {
    matchnum(LINK);
    return;
  }
  if (LINK->pattern[LINK->p-1] == '\\') {
    matchmeta(LINK);
    return;
  }
  if (LINK->source[LINK->s-1] == LINK->pattern[LINK->p-1]) {
    LINK->s++;
    LINK->p++;
  } else
    LINK->matching = false;
}
Example #2
0
static int FRAMERATE (const char *line)
{
    int num;
    num = matchnum (&line);
    if (num >= 1 && num <= 20)
	changed_prefs.gfx_framerate = num;
    else {
	sprintf (RESULT,"Invalid frame rate: %d\n", num);
	return RC_WARN;
    }
    return RC_OK;
}
Example #3
0
static int EJECT (const char *line)
{
    unsigned int drive = matchnum (&line);
    int result = RC_WARN;

    if (drive < 4) {
	if (currprefs.dfxtype[drive] >= 0) {
	    disk_eject (drive);
	    sprintf (RESULT, "Drive %d ejected.", drive);
	    result = RC_OK;
	} else
	    sprintf (RESULT, "Drive %d is disabled.", drive);
    }
    return result;
}
Example #4
0
static int INSERT (const char *line)
{
    unsigned int drive = matchnum (&line);
    int result = RC_WARN;

    if (drive < 4) {
	if (currprefs.dfxtype[drive] >= 0) {
	    char buff[256];
	    extractstr (&line, buff, 256);
	    strcpy (changed_prefs.df[drive], buff);
	    result = RC_OK;
	} else
	    sprintf (RESULT, "Drive %d is disabled.", drive);
    }
    return result;
}