KernelNewbies:

StructDumper

Rough python script to dump structs from header files to .html.

Endless room to improve, no ego on the part of the developer.

But enough of that.

#!/usr/bin/python """Version: 0.1

"""

import re

import os

import tempfile

from os.path import join

#Edit the desired list of structs to this list.

root = "/usr/src/linux/"

all_your_paths = []

all_your_paths.append( root + 'arch/i386' )

#all_your_paths.append( root + 'fs/ext3' )

#all_your_paths.append( root + 'include/linux' )

tmp_file = []

output = open( "/mnt/dmz/proj/allstructs.htm", "w" )

FAT_TAB = "  " #      "

COLUMN_COUNT = 4

#File scanning regexes

re_h = re.compile("\.h$" ) #a header file

re_s = re.compile("^(struct)\s*([\w|_]*)(.*{$)") #a structure

re_c = re.compile("^}.*;$") #end of a struct

struct_names = {} #index builder

long_name = 0

struct_counter = 1

def print_struct( file_handle, i ):

def scan_file( path_name, file_handle, i ):

def descend_path( start_here ):

def format_struct_names( key_list, long_name ):

if name == "main":

KernelNewbies: StructDumper (last edited 2017-12-30 01:30:00 by localhost)