void
process_options(char *options, struct request_info *request)
{
    char   *key;
    char   *value;
    char   *curr_opt;
    char   *next_opt;
    struct option *op;
    char    bf[BUFSIZ];

    for (curr_opt = get_field(options); curr_opt; curr_opt = next_opt) {
	next_opt = get_field((char *) 0);

	/*
	 * Separate the option into name and value parts. For backwards
	 * compatibility we ignore exactly one '=' between name and value.
	 */
	curr_opt = chop_string(curr_opt);
	if (*(value = curr_opt + strcspn(curr_opt, whitespace_eq))) {
	    if (*value != '=') {
		*value++ = 0;
		value += strspn(value, whitespace);
	    }
	    if (*value == '=') {
		*value++ = 0;
		value += strspn(value, whitespace);
	    }
	}
	if (*value == 0)
	    value = 0;
	key = curr_opt;

	/*
	 * Disallow missing option names (and empty option fields).
	 */
	if (*key == 0)
	    tcpd_jump("missing option name");

	/*
	 * Lookup the option-specific info and do some common error checks.
	 * Delegate option-specific processing to the specific functions.
	 */

	for (op = option_table; op->name && STR_NE(op->name, key); op++)
	     /* VOID */ ;
	if (op->name == 0)
	    tcpd_jump("bad option name: \"%s\"", key);
	if (!value && need_arg(op))
	    tcpd_jump("option \"%s\" requires value", key);
	if (value && !permit_arg(op))
	    tcpd_jump("option \"%s\" requires no value", key);
	if (next_opt && use_last(op))
	    tcpd_jump("option \"%s\" must be at end", key);
	if (value && expand_arg(op))
	    value = chop_string(percent_x(bf, sizeof(bf), value, request));
	if (hosts_access_verbose)
	    syslog(LOG_DEBUG, "option:   %s %s", key, value ? value : "");
	(*(op->func)) (value, request);
    }
}
示例#2
0
void main(int argc, char *argv[]) {
  char outname[512], inname[512], *boh;
  int len, i, j, total;
  IMAGE *img = NIL, *newimg = 0;
  struct cmap_color *cmap;
  struct gl_color *gl_buffer;

  toonz_init(DUMMY_KEY_SLOT, (int *)&argc, argv);
  InibisciDongle();
  unprotect_lib();

  if (argc < 2) {
    printf("### %s error: missing argument\n", argv[0]);
    printf(" usage: %s infile \n", argv[0]);
    exit(0);
  }

  if (*argv[1] == '-') {
    printf("bad filename <%s> \n", argv[1]);
    exit(0);
  }

  printf("\n\n");

  for (i = 1; i < argc; i++) {
    strcpy(inname, argv[i]);

    len = strlen(inname);
    if (len < 4 || (STR_NE(inname + len - 4, ".tzu") &&
                    STR_NE(inname + len - 4, ".tzp"))) {
      printf("### %s error: file %s is not tz(up)\n", argv[0], inname);
      continue;
    }

    /*   printf(">> Loading %s\n", inname); */

    img = img_read_tzup_info(inname);
    if (!img) {
      printf("### %s error: file %s not found\n", argv[0], inname);
      continue;
    }

    printf(" > IMAGE: %s \n\n", inname);
    printf("   > Dimension:    xsize=%d\t\tysize=%d\n", img->pixmap.xsize,
           img->pixmap.ysize);
    printf("   > Savebox:\n");
    printf("   >   Start       x0=%d\t\ty0=%d \n", img->pixmap.xD,
           img->pixmap.yD);
    printf("   >   Dimensions  xsize=%d\t\tysize=%d \n", img->pixmap.xSBsize,
           img->pixmap.ySBsize);
    printf("   > Resolution:   x_dpi=%g\ty_dpi=%g \n", img->pixmap.x_dpi,
           img->pixmap.y_dpi);
    printf("   > H-position (pixels): %g \n", img->pixmap.h_pos);

    printf("\n");
    if (img->history) print_history(img->history);

    printf("\n\n");
    free_img(img);
    img = NIL;
  }

  printf(" Bye!!\n");
}