Newer
Older
ubixos / src / tools / make_kernel_string_pool.h
@grayspace grayspace on 7 Jul 2002 1 KB *** empty log message ***
/*
   "make_kernel_string_pool.h"

   created by: grayspace aka J. Leveille
   for: UbixOS Project
   date: July 3, 2002

   purpose: - tool to create string pools for in kernel use
            - will generate the source for including a global
            set of ASCII (for now) strings into the kernel
            to avoid memory wastage for kernel output strings
            for long lists of things such as device descriptions

   NOTEs:
      - for now only ASCII is supported

   TODO:
      - expand to support unicode
      - use huffman encoding instead

   $Id$
*/


#ifndef _MAKE_KERNEL_STRING_POOL_H
#define _MAKE_KERNEL_STRING_POOL_H


// Resets *everything*, frees all memory in use, closes all open files
void MakeKSP_ResetAll();

// given a path, creates a sub string file for writing to
// as the current open sub string file
//
// returns 1 on success, 0 on failure
int Create_SubStringFile( const char * p_path );

// writes out and closes the current sub string file if possible
// and frees the current sub string list
// returns 1 on success, 0 on failure
int WriteAndClose_SubStringFile();

// closes the current open sub string file and frees
// the current sub string list
// returns 1 on success, 0 on failure
int Close_SubStringFile();

// given a path, opens an existing sub string file
// (shoudl conatin an alphabetically sorted list of unique substrings)
// reads in the contents as the current sub string list and sets
// the file as the current open sub string file
//
// returns 1 on success, 0 on failure
int Open_SubStringFile( const char * p_path );

// given a plain text files, extracts any unique sub strings
// and adds them into the current sub string list
//
// returns 1 on success, 0 on failure
int Add_SubStringsFromFile( const char * p_path );



#endif // _MAKE_KERNEL_STRING_POOL_H