Exemplo n.º 1
0
static void print_text (unsigned long offs) {
    printf("     <textarea rows=10 cols=80 name=comments wrap=virtual>\n");
    if (program_error) {
        printf ("Program error report: %s<br>\n", str_error);
    }
    else
    if (error_report) {
        if (!language) {
           printf(" %s\n", RUS_ERROR_MSG);
           printf("     Анекдот номер %d на полосатом роботе\n", start_number);
	   }
        else
           printf(" %s\n", ENG_ERROR_MSG);
           printf("     The joke number %d at \"Passed Jokes\" robot\n",
                start_number);
        printf("     %s%s\n", KULICHKI_URL, Get_Program_Path());
        print_one_block (offs);
    }
    else { // not program error, not error report, it means,
           // just sending info to friend
       if (!language) {
         printf ("Чиста пацанам в тему хохма номер %d\n", start_number);
         printf ("на роботе полосатых анекдотов\n");
       }
       else {
         printf ("Cool joke number %d\n", start_number);
         printf ("at \"Passed Jokes\" robot\n");
       }
       printf ("%s%s?n=%d&l=%d\n",
               KULICHKI_URL, Get_Program_Path (), start_number, language);

       if (!link_only)
           print_one_block (offs);
    }
    printf("\n");
    printf("     </textarea>\n");
}
Exemplo n.º 2
0
int main (int argc, char * argv[])
{
    char * file_name;
    int dev, i;

#if 1
    if (1) {
	/* ???? */
	schedule ();
	iput (0);
    }
#endif

    fprintf (stderr, "\n<-----------dumpreiserfs, version 0.99, 2000----------->\n"); 
    file_name = parse_options (argc, argv);


    dev = open (file_name, O_RDONLY);
    if (dev == -1)
	die ("dumpreiserfs: Can not open device %s: %s\n", file_name, strerror (errno));
    g_sb.s_dev = dev;

    if (uread_super_block (&g_sb))
	die ("dumpreiserfs: no reiserfs found on %s", file_name);
    if (uread_bitmaps (&g_sb))
	die ("dumpreiserfs: read_bitmap failed");

    if (opt_pack || opt_pack_all) {
	pack_partition (&g_sb);
    } else {
	/* dump file system to stdout */
	if (opt_block_to_print != -1) {
	    print_one_block (opt_block_to_print);
	    goto end;
	}

	print_block (SB_BUFFER_WITH_SB (&g_sb));

	if (opt_print_journal)
	    print_journal (&g_sb);
    
	if (opt_print_objectid_map == 1)
	    print_objectid_map (&g_sb);
    
	if (opt_print_block_map) {
	    print_bmap (&g_sb, opt_print_block_map == 1 ? 1 : 0);
	}

	if (opt_print_regular_file_content || opt_print_directory_contents ||
	    opt_print_leaf_items) {
	    print_disk_tree (SB_ROOT_BLOCK (&g_sb));

	    /* print the statistic */
	    printf ("File system uses %d internal + %d leaves + %d unformatted nodes = %d blocks\n", 
		    g_stat_info.nr_internals, g_stat_info.nr_leaves, g_stat_info.nr_unformatted, 
		    g_stat_info.nr_internals + g_stat_info.nr_leaves + g_stat_info.nr_unformatted);
	}
    }


 end:
    /* brelse bitmaps */
    if (SB_AP_BITMAP (&g_sb)) {
	for (i = 0; i < SB_BMAP_NR (&g_sb); i ++) {
	    brelse (SB_AP_BITMAP (&g_sb)[i]);
	}
	freemem (SB_AP_BITMAP (&g_sb));
    }

    /* brelse buffer containing super block */
    brelse (SB_BUFFER_WITH_SB (&g_sb));

    check_and_free_buffer_mem ();

    return 0;
}