Example #1
0
void print_boot1_private_head(boot1_private_head_t *hdr)
{
	printf("FHSize    : %u\n", hdr->prvt_head_size);
	printf("FILE ver  : %.4s\n", hdr->prvt_head_vsn);
	printf("UART port : %d\n", hdr->uart_port);
	print_normal_gpio_cfg(hdr->uart_ctrl, 2);
	print_boot_dram_para(&hdr->dram_para);
	print_script(&hdr->script_buf);
	print_core_para(&hdr->core_para);
	printf("TWI port  : %d\n", hdr->twi_port);
	print_normal_gpio_cfg(hdr->twi_ctrl, 2);
	printf("Debug     : %d\n", hdr->debug_enable);
	printf("Hold key min : %d\n", hdr->hold_key_min);
	printf("Hold key max : %d\n", hdr->hold_key_max);
	printf("Work mode : %d\n", hdr->work_mode);
	printf("Storage   : %d\n", hdr->storage_type);
	int i;
	for (i = 0; i < 256; i++) {
		if (i % 16 == 0) {
			if (i) {
				printf("\n");
			}
			printf(" DATA %02x  :", i);
		}
		printf(" %02x", (u8)hdr->storage_data[i]);
	}
	printf("\n");
}
Example #2
0
void
print_sdiff_script (struct change *script)
{
  next0 = next1 = - files[0].prefix_lines;
  print_script (script, print_sdiff_hunk);

  print_sdiff_common_lines (files[0].valid_lines, files[1].valid_lines);
}
Example #3
0
void
print_sdiff_script (struct change *script)
{
    begin_output ();

    next0 = next1 = - files[0].prefix_lines;
    print_script (script, find_change, print_sdiff_hunk);

    print_sdiff_common_lines (files[0].valid_lines, files[1].valid_lines);
}
Example #4
0
void
print_context_script (struct change *script, bool unidiff)
{
  if (ignore_blank_lines || ignore_regexp.fastmap)
    mark_ignorable (script);
  else
    {
      struct change *e;
      for (e = script; e; e = e->link)
	e->ignore = false;
    }

  find_function_last_search = - files[0].prefix_lines;
  find_function_last_match = LIN_MAX;

  if (unidiff)
    print_script (script, find_hunk, pr_unidiff_hunk);
  else
    print_script (script, find_hunk, pr_context_hunk);
}
Example #5
0
File: ifdef.c Project: DonCN/haiku
void
print_ifdef_script (struct change *script)
{
  next_line = - files[0].prefix_lines;
  print_script (script, find_change, print_ifdef_hunk);
  if (next_line < files[0].valid_lines)
    {
      begin_output ();
      format_ifdef (group_format[UNCHANGED], next_line, files[0].valid_lines,
		    next_line - files[0].valid_lines + files[1].valid_lines,
		    files[1].valid_lines);
    }
}
Example #6
0
void
print_html_script (struct change *script/*, int src_codepage*/)
{
  if (ignore_blank_lines_flag)
    mark_ignorable (script);
  else
    {
      struct change *e;
      for (e = script; e; e = e->link)
	e->ignore = 0;
    }

  print_script (script, find_hunk, pr_unidiff_hunk);
}
Example #7
0
static void print_rule(TranslationTableRule *rule) {
  char *opcode = findOpcodeName(rule->opcode);
  char *chars;
  char *dots;
  char *script;
  switch (rule->opcode) {
    case CTO_Context:
    case CTO_Correct:
    case CTO_SwapCd:
    case CTO_SwapDd:
    case CTO_Pass2:
    case CTO_Pass3:
    case CTO_Pass4:
      script = print_script(&rule->charsdots[rule->charslen], rule->dotslen);
      printf("%s\t%s\n", opcode, script);
      break;
    default:
      chars = print_chars(rule->charsdots, rule->charslen);
      dots = print_dots(&rule->charsdots[rule->charslen], rule->dotslen);
      printf("%s\t%s\t%s\n", opcode, chars, dots);
      break; }
}
Example #8
0
static gboolean
print_scripts (GSList *scripts, gboolean color,
	       gboolean verbose, const char *rxstr, GError **err)
{
	GSList *cur;

	if (!scripts) {
		g_print ("No scripts available\n");
		return TRUE; /* not an error */
	}

	if (rxstr)
		g_print ("Available scripts matching '%s':\n", rxstr);
	else
		g_print ("Available scripts:\n");

	for (cur = scripts; cur; cur = g_slist_next (cur)) {

		MuScriptInfo *msi;
		const char* descr, *oneline, *name;

		msi     = (MuScriptInfo*)cur->data;
		name    = mu_script_info_name (msi);
		oneline = mu_script_info_one_line (msi);
		descr   = mu_script_info_description (msi);

		/* if rxstr is provide, only consider matching scriptinfos */
		if (rxstr && !mu_script_info_matches_regex (msi, rxstr, err)) {
			if (err && *err)
				return FALSE;
			continue;
		}

		print_script (name, oneline, descr, color, verbose);
	}

	return TRUE;
}
Example #9
0
File: pk2dft.c Project: GBert/misc
int dump_device_file(char *dumpdir) {
    char fname[255], fbase[255], *p;
    FILE *f, *fcfg;
    int i;

    /* create diretory */
    strcpy(fname, "mkdir ");
    strcat(fname, dumpdir);
    system(fname);

    /* write the config file */
    strcpy(fname, dumpdir);
    strcat(fname, "/config.cfg");
    if ((fcfg = fopen(fname, "w+")) == NULL)
	return -1;

    fprintf(fcfg, "# this configiration file was generated automatically\n");
    fprintf(fcfg, "# please modify it according to the rules :-)\n#\n");
    fprintf(fcfg, "# the source file contained:\n");
    fprintf(fcfg, "#   %d families,\n", hdr.num_families);
    fprintf(fcfg, "#   %d devices and\n", hdr.num_devices);
    fprintf(fcfg, "#   %d scripts.\n\n\n", hdr.num_scripts);
    fprintf(fcfg, "# for the device file header\n");
    fprintf(fcfg, "ver_major = %d\n", hdr.version[0]);
    fprintf(fcfg, "ver_minor = %d\n", hdr.version[1]);
    fprintf(fcfg, "ver_dot   = %d\n", hdr.version[2]);
    fprintf(fcfg, "compat    = %d\n", hdr.compat);
    fprintf(fcfg, "unused1a  = %d\n", hdr.unused1a);
    fprintf(fcfg, "unused1b  = %d\n", hdr.unused1b);
    fprintf(fcfg, "unused2   = %d\n", hdr.unused2);
    fprintf(fcfg, "notes     = \n\"%s\"\n\n\n", hdr.notes);

    /* write families */
    strcpy(fname, "mkdir ");
    strcat(fname, dumpdir);
    strcat(fname, "/families");
    system(fname);

    strcpy(fbase, dumpdir);
    strcat(fbase, "/families/");
    p = fbase + strlen(fbase);
    fprintf(fcfg, "# list of device family files\n");
    fprintf(fcfg, "families  = {\n");
    for (i = 0; i < hdr.num_families; i++) {
	special_cat(p, families[i].name);
	strcat(fbase, ".fam");
	printf("filename : \"%s\"\n", fbase);
	fprintf(fcfg, "\t\"%s\",\n", valid_string(fbase, g_tmp));
	if ((f = fopen(fbase, "w+")) == NULL) {
	    printf("error: cannot create file\n");
	    return -1;
	}
	print_family(f, &families[i]);
	fclose(f);
    }
    fprintf(fcfg, "}\n\n");

    /* write devices */
    strcpy(fname, "mkdir ");
    strcat(fname, dumpdir);
    strcat(fname, "/devices");
    system(fname);

    strcpy(fbase, dumpdir);
    strcat(fbase, "/devices/");
    p = fbase + strlen(fbase);
    fprintf(fcfg, "# list of device files\n");
    fprintf(fcfg, "devices   = {\n");
    for (i = 0; i < hdr.num_devices; i++) {
	special_cat(p, devices[i].part_name);
	strcat(fbase, ".dev");
	printf("filename : \"%s\"\n", fbase);
	fprintf(fcfg, "\t\"%s\",\n", valid_string(fbase, g_tmp));
	if ((f = fopen(fbase, "w+")) == NULL) {
	    printf("error: cannot create file\n");
	    return -1;
	}
	print_device(f, &devices[i]);
	fclose(f);
    }
    fprintf(fcfg, "}\n\n");

    /* write scripts */
    strcpy(fname, "mkdir ");
    strcat(fname, dumpdir);
    strcat(fname, "/scripts");
    system(fname);

    strcpy(fbase, dumpdir);
    strcat(fbase, "/scripts/");
    p = fbase + strlen(fbase);
    fprintf(fcfg, "# list of script files\n");
    fprintf(fcfg, "scripts   = {\n");
    for (i = 0; i < hdr.num_scripts; i++) {
	special_cat(p, scripts[i].name);
	strcat(fbase, ".scr");
	printf("filename : \"%s\"\n", fbase);
	fprintf(fcfg, "\t\"%s\",\n", valid_string(fbase, g_tmp));
	if ((f = fopen(fbase, "w+")) == NULL) {
	    printf("error: cannot create file\n");
	    return -1;
	}
	print_script(f, &scripts[i]);
	fclose(f);
    }
    fprintf(fcfg, "}");

    fclose(fcfg);

    return 0;
}
Example #10
0
File: ed.c Project: Lonis/diffutils
void
pr_forward_ed_script (struct change *script)
{
  print_script (script, find_change, pr_forward_ed_hunk);
}
Example #11
0
File: ed.c Project: Lonis/diffutils
void
print_ed_script (struct change *script)
{
  print_script (script, find_reverse_change, print_ed_hunk);
}
Example #12
0
File: ed.c Project: Lonis/diffutils
void
print_rcs_script (struct change *script)
{
  print_script (script, find_change, print_rcs_hunk);
}
Example #13
0
void
print_normal_script (struct change *script)
{
  print_script (script, find_change, print_normal_hunk);
}