static int show_hwinfo(struct seq_file *seq, void *v)
{
	seq_printf(seq, "SOC             : %s\n", "EXYNOS5430");
	seq_printf(seq, "SOC Vendor      : %s\n", "SAMSUNG");
	seq_printf(seq, "Machine Type    : %s\n", machine_type);
	seq_printf(seq, "Board Version   : %d\n", board_version);
	seq_printf(seq, "Hardware Version: %#llx\n", meizu_hardware_version());
	seq_printf(seq, "FpVendor        : %s\n", find_fp());
	seq_printf(seq, "PSN             : %s\n", meizu_get_psn());
	return 0;
}
Example #2
0
static void
load_patch(PatchStore *patch)
{
    long start_fpos;
    int size = 0;
    int limsize;
    char *trace;


    save_scanner_state();
    cfile = find_fp(patch->fpos);

    init_scanner();

    /** First thing I should do is make sure that the name is correct ***/
    start_fpos = fpos;
    get_expected_token(openaxiom_Patch_token);
    get_expected_token(openaxiom_Lbrace_token);
    get_expected_token(openaxiom_Word_token);
    if (strcmp(token.id, patch->name)) {
        /** WOW, Somehow I had the location of the wrong macro **/
        fprintf(stderr, "(HyperDoc) Expected patch name %s: got instead %s in load_patch\n",
                patch->name, token.id);
        jump();
    }
    get_expected_token(openaxiom_Rbrace_token);

    scan_HyperDoc();
    fseek(cfile, patch->fpos.pos + start_fpos, 0);
    limsize = fpos - start_fpos + 1;
    patch->string = (char *) halloc((limsize + 1) * sizeof(char), "Patch String");
    for (size = 1, trace = patch->string; size < limsize; size++)
        *trace++ = getc(cfile);
    *trace = '\0';
    patch->loaded = 1;
    restore_scanner_state();
}
Example #3
0
static char *
load_macro(MacroStore *macro)
{
    int ret_val;
    long start_fpos;
    int size = 0;
    char *trace;
    char *macro_buff;

    save_scanner_state();
    cfile = find_fp(macro->fpos);


    init_scanner();

    /** First thing I should do is make sure that the name is correct ***/
    get_expected_token(NewCommand);
    get_expected_token(Lbrace);
    get_expected_token(Macro);
    if (strcmp(token.id, macro->name)) {
        /** WOW, Somehow I had the location of the wrong macro **/
        fprintf(stderr, "Expected macro name %s got insted %s in load_macro\n",
                macro->name, token.id);
        longjmp(jmpbuf, 1);
    }
    get_expected_token(Rbrace);

    /** Next I should check to see if I have any parameters **/
    get_token();
    if (token.type == Lsquarebrace) {
        /** The person is telling me the number of macros he is going to use **/
        get_expected_token(Word);
        if (!number(token.id)) {
            fprintf(stderr, "load_macro: Expected A Value Instead Got %s\n",
                    token.id);
            longjmp(jmpbuf, 1);
        }
        /** if it is a number, then I should store it in the parameter number
          member of the macro structure **/
        macro->number_parameters = atoi(token.id);
#ifdef DEBUG
        fprintf(stderr,
              "The number of parameters is %d\n", macro->number_parameters);
#endif
        get_expected_token(Rsquarebrace);
        get_token();
    }
    else
        macro->number_parameters = 0;

    /*** Now I should be able to check the token, and insure that I have read
      a leftbrace, then the string will follow                    ****/
    if (token.type != Lbrace) {
        /** The macro is not in a group, uh oh **/
        fprintf(stderr, "load_macro:Expected a Left Brace got type %d\n",
                token.type);
        longjmp(jmpbuf, 1);
    }
    start_fpos = fpos;
    scan_HyperDoc();
    ret_val = fseek(cfile, macro->fpos.pos + start_fpos, 0);
    size = fpos - start_fpos;
    macro_buff = (char *) halloc((size + 1) * sizeof(char), "Macro_buf");
    for (size = 0, trace = macro_buff; size < fpos - (start_fpos) - 1; size++)
        *trace++ = getc(cfile);
    *trace = '\0';
    macro->loaded = 1;
    restore_scanner_state();
    return macro_buff;
}