29 |
30 |
31 |
--------------------------------------------------------------------------------
/bitfile/docs/menudata.js:
--------------------------------------------------------------------------------
1 | /*
2 | @ @licstart The following is the entire license notice for the
3 | JavaScript code in this file.
4 |
5 | Copyright (C) 1997-2017 by Dimitri van Heesch
6 |
7 | This program is free software; you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation; either version 2 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License along
18 | with this program; if not, write to the Free Software Foundation, Inc.,
19 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 |
21 | @licend The above is the entire license notice
22 | for the JavaScript code in this file
23 | */
24 | var menudata={children:[
25 | {text:"Main Page",url:"index.html"},
26 | {text:"Modules",url:"modules.html"},
27 | {text:"Data Structures",url:"annotated.html",children:[
28 | {text:"Data Structures",url:"annotated.html"},
29 | {text:"Data Structure Index",url:"classes.html"},
30 | {text:"Data Fields",url:"functions.html",children:[
31 | {text:"All",url:"functions.html"},
32 | {text:"Variables",url:"functions_vars.html"}]}]},
33 | {text:"Files",url:"files.html",children:[
34 | {text:"File List",url:"files.html"},
35 | {text:"Globals",url:"globals.html",children:[
36 | {text:"All",url:"globals.html",children:[
37 | {text:"b",url:"globals.html#index_b"},
38 | {text:"e",url:"globals.html#index_e"},
39 | {text:"m",url:"globals.html#index_m"},
40 | {text:"n",url:"globals.html#index_n"}]},
41 | {text:"Functions",url:"globals_func.html"},
42 | {text:"Typedefs",url:"globals_type.html"},
43 | {text:"Enumerations",url:"globals_enum.html"},
44 | {text:"Enumerator",url:"globals_eval.html"},
45 | {text:"Macros",url:"globals_defs.html"}]}]}]}
46 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # Makefile for lzss encode/decode library and sample program
3 | ############################################################################
4 | CC = gcc
5 | LD = gcc
6 | CFLAGS = -I. -O3 -Wall -Wextra -pedantic -ansi -c
7 | LDFLAGS = -O3 -o
8 |
9 | # libraries
10 | LIBS = -L. -Lbitfile -Loptlist -llzss -lbitfile -loptlist
11 |
12 | # Treat NT and non-NT windows the same
13 | ifeq ($(OS),Windows_NT)
14 | OS = Windows
15 | endif
16 |
17 | ifeq ($(OS),Windows)
18 | ifeq ($(OSTYPE), cygwin)
19 | EXE = .exe
20 | DEL = rm
21 | else
22 | EXE = .exe
23 | DEL = del
24 | endif
25 | else #assume Linux/Unix
26 | EXE =
27 | DEL = rm -f
28 | endif
29 |
30 | # define the method to be used for searching for matches (choose one)
31 | # brute force
32 | # FMOBJ = brute.o
33 |
34 | # linked list
35 | # FMOBJ = list.o
36 |
37 | # hash table
38 | # FMOBJ = hash.o
39 |
40 | # Knuth–Morris–Pratt search
41 | # FMOBJ = kmp.o
42 |
43 | # binary tree
44 | FMOBJ = tree.o
45 |
46 | LZOBJS = $(FMOBJ) lzss.o
47 |
48 | all: sample$(EXE)
49 |
50 | sample$(EXE): sample.o liblzss.a optlist/liboptlist.a bitfile/libbitfile.a
51 | $(LD) $< $(LIBS) $(LDFLAGS) $@
52 |
53 | sample.o: sample.c lzss.h optlist/optlist.h
54 | $(CC) $(CFLAGS) $<
55 |
56 | liblzss.a: $(LZOBJS)
57 | ar crv liblzss.a $(LZOBJS)
58 | ranlib liblzss.a
59 |
60 | lzss.o: lzss.c lzlocal.h bitfile/bitfile.h
61 | $(CC) $(CFLAGS) $<
62 |
63 | brute.o: brute.c lzlocal.h
64 | $(CC) $(CFLAGS) $<
65 |
66 | list.o: list.c lzlocal.h
67 | $(CC) $(CFLAGS) $<
68 |
69 | hash.o: hash.c lzlocal.h
70 | $(CC) $(CFLAGS) $<
71 |
72 | kmp.o: kmp.c lzlocal.h
73 | $(CC) $(CFLAGS) $<
74 |
75 | tree.o: tree.c lzlocal.h
76 | $(CC) $(CFLAGS) $<
77 |
78 | bitfile/libbitfile.a:
79 | cd bitfile && $(MAKE) libbitfile.a
80 |
81 | optlist/liboptlist.a:
82 | cd optlist && $(MAKE) liboptlist.a
83 |
84 | clean:
85 | $(DEL) *.o
86 | $(DEL) *.a
87 | $(DEL) sample$(EXE)
88 | cd optlist && $(MAKE) clean
89 | cd bitfile && $(MAKE) clean
90 |
--------------------------------------------------------------------------------
/lzss.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************
2 | * Lempel, Ziv, Storer, and Szymanski Encoding and Decoding
3 | *
4 | * File : lzss.h
5 | * Purpose : Header for LZSS encode and decode routines. Contains the
6 | * prototypes to be used by programs linking to the LZSS
7 | * library.
8 | * Author : Michael Dipperstein
9 | * Date : February 21, 2004
10 | *
11 | ****************************************************************************
12 | *
13 | * LZSS: An ANSI C LZSS Encoding/Decoding Routine
14 | * Copyright (C) 2004, 2006, 2007, 2014 by
15 | * Michael Dipperstein (mdipperstein@gmail.com)
16 | *
17 | * This file is part of the lzss library.
18 | *
19 | * The lzss library is free software; you can redistribute it and/or
20 | * modify it under the terms of the GNU Lesser General Public License as
21 | * published by the Free Software Foundation; either version 3 of the
22 | * License, or (at your option) any later version.
23 | *
24 | * The lzss library is distributed in the hope that it will be useful, but
25 | * WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
27 | * General Public License for more details.
28 | *
29 | * You should have received a copy of the GNU Lesser General Public License
30 | * along with this program. If not, see .
31 | *
32 | ***************************************************************************/
33 | #ifndef _LZSS_H
34 | #define _LZSS_H
35 |
36 | /***************************************************************************
37 | * PROTOTYPES
38 | ***************************************************************************/
39 |
40 | /***************************************************************************
41 | * LZSS encoding and decoding prototypes for functions with file pointer
42 | * parameters. Provide these functions with a pointer to the open binary
43 | * file to be encoded/decoded (fpIn) and pointer to the open binary target
44 | * file (fpOut). It is the job of the function caller to open the files
45 | * prior to callings these functions and to close the file after these
46 | * functions have been called.
47 | *
48 | * These functions return 0 for success and -1 for failure. errno will be
49 | * set in the event of a failure.
50 | ***************************************************************************/
51 | int EncodeLZSS(FILE *fpIn, FILE *fpOut);
52 | int DecodeLZSS(FILE *fpIn, FILE *fpOut);
53 |
54 | #endif /* ndef _LZSS_H */
55 |
--------------------------------------------------------------------------------
/bitfile/README:
--------------------------------------------------------------------------------
1 | DESCRIPTION
2 | -----------
3 | This archive contains an ANSI C library implementing bitwise reading and
4 | writing for sequential files. This library is intended to be easy to follow
5 | and expand upon, though it may be used without an understanding of its
6 | implementation.
7 |
8 | FILES
9 | -----
10 | bitfile.c - Library implementing bitwise reading and writing for
11 | sequential files.
12 | bitfile.h - Header for bitfile library.
13 | COPYING - GNU General Public License v3
14 | COPYING.LESSER - GNU Lesser General Public License v3
15 | Makefile - makefile for this project (assumes gcc compiler and GNU make)
16 | README - this file
17 | sample.c - Program demonstrating how to use the bitfile library.
18 |
19 | BUILDING
20 | --------
21 | To build these files with GNU make and gcc, simply enter "make" from the
22 | command line.
23 |
24 | USAGE
25 | -----
26 | sample.c demonstrates usage of each of the bitfile functions.
27 |
28 | DOCUMENTATION
29 | -------------
30 | See https://michaeldipperstein.github.io/bitfile/
31 |
32 | HISTORY
33 | -------
34 | 01/30/04 - Initial release
35 | 06/14/04 - Use incomplete type to hide definition of bitfile structure
36 | 11/09/04 - Added a routine to convert an open bitfile_t to a FILE.
37 | Added a routine to align a bitfile to the next byte.
38 | 06/21/05 - Corrected BitFileGetBits/PutBits error that accessed an extra
39 | byte when given an integral number of bytes.
40 | 12/05/05 - Added BitFileGetBitsInt and BitFilePutBitsInt
41 | 06/06/06 - Corrected error in allocation of constants used to open underlying
42 | read/write/append files.
43 | 08/26/07 - Updated license to LGPL v3.
44 | 12/30/07 - Corrected errors in BitFileOpen and MakeBitFile reported by an
45 | anonymous user. Segment faults may have occurred if fopen returns
46 | a NULL.
47 | 01/23/08 - Added BitFileFlushOutput.
48 | 10/16/14 - Replaced BitFileGetBitsInt and BitFilePutBitsInt with
49 | BitFileGetBitsNum and BitFilePutBitsNum.
50 | - Coded to Michael Barr's "Top 10 Bug-Killing Coding Standard Rules"
51 | 07/12/17 - Updates for github
52 | 09/16/19 - Update e-mail address
53 | - Correct/update doxygen configuration
54 |
55 |
56 | TODO
57 | ----
58 | - Consider adding extra count so that files ending in incomplete bytes
59 | may be appended to starting with the incomplete byte instead of the
60 | next whole byte.
61 | - Test on platforms with character lengths other than 8 bits.
62 |
63 | AUTHOR
64 | ------
65 | Michael Dipperstein (mdipperstein@gmail.com)
66 |
--------------------------------------------------------------------------------
/bitfile/docs/group__examples_ga0ddf1224851353fc92bfbff6f499fa97_cgraph.map:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/bitfile/docs/menu.js:
--------------------------------------------------------------------------------
1 | /*
2 | @licstart The following is the entire license notice for the
3 | JavaScript code in this file.
4 |
5 | Copyright (C) 1997-2017 by Dimitri van Heesch
6 |
7 | This program is free software; you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation; either version 2 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License along
18 | with this program; if not, write to the Free Software Foundation, Inc.,
19 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 |
21 | @licend The above is the entire license notice
22 | for the JavaScript code in this file
23 | */
24 | function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
25 | function makeTree(data,relPath) {
26 | var result='';
27 | if ('children' in data) {
28 | result+='
';
29 | for (var i in data.children) {
30 | result+='
75 |
76 |
77 | Generated by
78 |
79 | 1.8.14
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/optlist/optlist.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************
2 | * Command Line Option Parser
3 | *
4 | * File : optlist.h
5 | * Purpose : Header for getopt style command line option parsing
6 | * Author : Michael Dipperstein
7 | * Date : August 1, 2007
8 | *
9 | ****************************************************************************
10 | *
11 | * OptList: A command line option parsing library
12 | * Copyright (C) 2007, 20014, 2018 by
13 | * Michael Dipperstein (mdipperstein@gmail.com)
14 | *
15 | * This file is part of the OptList library.
16 | *
17 | * OptList is free software; you can redistribute it and/or modify it
18 | * under the terms of the GNU Lesser General Public License as published by
19 | * the Free Software Foundation; either version 3 of the License, or (at
20 | * your option) any later version.
21 | *
22 | * OptList is distributed in the hope that it will be useful, but
23 | * WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
25 | * General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU Lesser General Public License
28 | * along with this program. If not, see .
29 | *
30 | ***************************************************************************/
31 | #ifndef OPTLIST_H
32 | #define OPTLIST_H
33 |
34 | /***************************************************************************
35 | * INCLUDED FILES
36 | ***************************************************************************/
37 |
38 | /***************************************************************************
39 | * MACROS
40 | ***************************************************************************/
41 |
42 | /***************************************************************************
43 | * CONSTANTS
44 | ***************************************************************************/
45 | #define OL_NOINDEX -1 /* this option has no arguement */
46 |
47 | /***************************************************************************
48 | * TYPE DEFINITIONS
49 | ***************************************************************************/
50 | typedef struct option_t
51 | {
52 | char option; /* the current character option character */
53 | char *argument; /* pointer to arguments for this option */
54 | int argIndex; /* index into argv[] containing the argument */
55 | struct option_t *next; /* the next option in the linked list */
56 | } option_t;
57 |
58 | /***************************************************************************
59 | * PROTOTYPES
60 | ***************************************************************************/
61 |
62 | #if defined __cplusplus
63 | extern "C"
64 | {
65 | #endif
66 |
67 | /* returns a linked list of options and arguments similar to getopt() */
68 | option_t *GetOptList(const int argc, char *const argv[],
69 | const char *const options);
70 |
71 | /* frees the linked list of option_t returned by GetOptList */
72 | void FreeOptList(option_t *list);
73 |
74 | /* return a pointer to file name in a full path. useful for argv[0] */
75 | char *FindFileName(const char *const fullPath);
76 |
77 | #if defined __cplusplus
78 | }
79 | #endif
80 |
81 | #endif /* ndef OPTLIST_H */
82 |
--------------------------------------------------------------------------------
/optlist/README:
--------------------------------------------------------------------------------
1 | DESCRIPTION
2 | -----------
3 | This archive contains the source code and supporting documentation for OptList,
4 | an ANSI C command line option parser library.
5 |
6 | OptList is released under the GNU LGPL version 3.0.
7 |
8 | The latest revision of this program may be found at:
9 | https://michaeldipperstein.github.io/optlist.html
10 |
11 | FILES
12 | -----
13 | COPYING - Rules for copying and distributing GNU GPL software
14 | COPYING.LESSER - Rules for copying and distributing GNU LGPL software
15 | optlist.c - Source code for the Optlist function and supporting
16 | function.
17 | optlist.h - Header file to be included by code using OptList
18 | Makefile - Makefile for this project (assumes gcc compiler and GNU make)
19 | README - This file
20 | sample.c - A small program demonstrating how to use OptList
21 | sample.cpp - A small c++ program demonstrating how to use OptList
22 |
23 | BUILDING
24 | --------
25 | To build these files with GNU make and gcc:
26 | 1. Windows users should define the environment variable OS to be Windows or
27 | Windows_NT. This is often already done.
28 | 2. Enter the command "make" from the command line.
29 |
30 | USAGE
31 | -----
32 | The file sample.c demonstrates the usage of OptList.
33 |
34 | SYNOPSIS
35 | typedef struct option_t
36 | {
37 | char option;
38 | char *argument;
39 | int argIndex;
40 | struct option_t *next;
41 | } option_t;
42 |
43 | option_t *GetOptList(int argc, char *const argv[], char *const options);
44 |
45 |
46 | DESCRIPTION
47 | The GetOptList() function is similar to getopt(). Its most notable differences
48 | are that it returns a linked list to the command line arguments and their
49 | parameters. One call to GetOptList() will return all of the command line
50 | options and their arguments. GetOptList() will not modify argc or argv.
51 |
52 | GetOptList()'s parameters "argc" and "argv" are the argument count and array as
53 | passed to the main() function on program invocation. An element of argv that
54 | starts with "-" is an option element. The character following the "-" is option
55 | an character.
56 |
57 | The parameter "options" is a string containing the legitimate option characters.
58 | If such a character is followed by a colon, the option requires an argument.
59 | (e.g. "a:bc?" a, b ,c, and, ? are all options. a should be followed by an
60 | argument.)
61 |
62 | GetOptList() returns a linked list of type option_t. The "*next" field of the
63 | element at the end of the list will be set to NULL. The "option" field will
64 | contain the option character. A pointer to the following text in the same
65 | argv-element, or the text of the following argv-element will be stored in the
66 | "arguement" field, otherwise the "arguement" field is set to NULL. The index
67 | of the argv-element containing the argument will be stored in the "argIndex".
68 | If there is no argument, the field will contain OL_NOINDEX.
69 |
70 | HISTORY
71 | -------
72 | 08/01/07 - Initial release
73 | 09/13/14 - Added FindFileName function, because I always use it with GetOptList
74 | Tighter adherence to Michael Barr's "Top 10 Bug-Killing Coding
75 | Standard Rules" (http://www.barrgroup.com/webinars/10rules).
76 | 10/18/18 - Made header compatible with c++ and added c++ example
77 | 09/19/19 - change e-mail address from ucsb to gmail
78 |
79 | TODO
80 | ----
81 | - Add support for --option_name
82 |
83 | AUTHOR
84 | ------
85 | Michael Dipperstein (mdipperstein@gmail.com)
86 |
--------------------------------------------------------------------------------
/bitfile/docs/modules.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Bitfile: Modules
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
The bitfile library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
73 |
The bitfile library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
74 |
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.
75 |
76 |
77 |
78 | Generated by
79 |
80 | 1.8.14
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/optlist/sample.cpp:
--------------------------------------------------------------------------------
1 | /***************************************************************************
2 | * OptList Usage Sample
3 | *
4 | * File : sample.cpp
5 | * Purpose : Demonstrates usage of optlist library.
6 | * Author : Michael Dipperstein
7 | * Date : October 18, 2018
8 | *
9 | ****************************************************************************
10 | *
11 | * Sample: A optlist library sample usage program
12 | * Copyright (C) 2018 by
13 | * Michael Dipperstein (mdipperstein@gmail.com)
14 | *
15 | * This file is part of the optlist library.
16 | *
17 | * The optlist library is free software; you can redistribute it and/or
18 | * modify it under the terms of the GNU Lesser General Public License as
19 | * published by the Free Software Foundation; either version 3 of the
20 | * License, or (at your option) any later version.
21 | *
22 | * The optlist library is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
25 | * General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU Lesser General Public License
28 | * along with this program. If not, see .
29 | *
30 | ***************************************************************************/
31 |
32 | /***************************************************************************
33 | * INCLUDED FILES
34 | ***************************************************************************/
35 | #include
36 | #include "optlist.h"
37 |
38 | /***************************************************************************
39 | * PROTOTYPES
40 | ***************************************************************************/
41 |
42 | /***************************************************************************
43 | * FUNCTIONS
44 | ***************************************************************************/
45 |
46 | /****************************************************************************
47 | * Function : main
48 | * Description: This is the main function for this program, it calls
49 | * optlist to parse the command line input displays the
50 | * results of the parsing.
51 | * Parameters : argc - number of parameters
52 | * argv - parameter list
53 | * Effects : parses command line parameters
54 | * Returned : EXIT_SUCCESS for success, otherwise EXIT_FAILURE.
55 | ****************************************************************************/
56 | int main(int argc, char *argv[])
57 | {
58 | option_t *optList, *thisOpt;
59 |
60 | /* get list of command line options and their arguments */
61 | optList = NULL;
62 | optList = GetOptList(argc, argv, "a:bcd:ef?");
63 |
64 | /* display results of parsing */
65 | while (optList != NULL)
66 | {
67 | thisOpt = optList;
68 | optList = optList->next;
69 |
70 | if ('?' == thisOpt->option)
71 | {
72 | std::cout << "Usage: " << FindFileName(argv[0]) << " " <<
73 | std::endl << std::endl;
74 | std::cout << "options:" << std::endl;
75 | std::cout << " -a : option excepting argument." << std::endl;
76 | std::cout << " -b : option without arguments." << std::endl;
77 | std::cout << " -c : option without arguments." << std::endl;
78 | std::cout << " -d : option excepting argument." << std::endl;
79 | std::cout << " -e : option without arguments." << std::endl;
80 | std::cout << " -f : option without arguments." << std::endl;
81 | std::cout << " -? : print out command line options.\n" <<
82 | std::endl;
83 |
84 | FreeOptList(thisOpt); /* free the rest of the list */
85 | return EXIT_SUCCESS;
86 | }
87 |
88 | std::cout << "found option " << thisOpt->option << std::endl;
89 |
90 | if (thisOpt->argument != NULL)
91 | {
92 | std::cout << "\tfound argument " << thisOpt->argument <<
93 | " at index " << thisOpt->argIndex << std::endl;
94 | }
95 | else
96 | {
97 | std::cout << "\tno argument for this option" << std::endl;
98 | }
99 |
100 | free(thisOpt); /* done with this item, free it */
101 | }
102 |
103 | return EXIT_SUCCESS;
104 | }
105 |
--------------------------------------------------------------------------------
/bitfile/docs/dynsections.js:
--------------------------------------------------------------------------------
1 | /*
2 | @licstart The following is the entire license notice for the
3 | JavaScript code in this file.
4 |
5 | Copyright (C) 1997-2017 by Dimitri van Heesch
6 |
7 | This program is free software; you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation; either version 2 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License along
18 | with this program; if not, write to the Free Software Foundation, Inc.,
19 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 |
21 | @licend The above is the entire license notice
22 | for the JavaScript code in this file
23 | */
24 | function toggleVisibility(linkObj)
25 | {
26 | var base = $(linkObj).attr('id');
27 | var summary = $('#'+base+'-summary');
28 | var content = $('#'+base+'-content');
29 | var trigger = $('#'+base+'-trigger');
30 | var src=$(trigger).attr('src');
31 | if (content.is(':visible')===true) {
32 | content.hide();
33 | summary.show();
34 | $(linkObj).addClass('closed').removeClass('opened');
35 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
36 | } else {
37 | content.show();
38 | summary.hide();
39 | $(linkObj).removeClass('closed').addClass('opened');
40 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
41 | }
42 | return false;
43 | }
44 |
45 | function updateStripes()
46 | {
47 | $('table.directory tr').
48 | removeClass('even').filter(':visible:even').addClass('even');
49 | }
50 |
51 | function toggleLevel(level)
52 | {
53 | $('table.directory tr').each(function() {
54 | var l = this.id.split('_').length-1;
55 | var i = $('#img'+this.id.substring(3));
56 | var a = $('#arr'+this.id.substring(3));
57 | if (l.
31 | *
32 | ***************************************************************************/
33 | #ifndef _LZSS_LOCAL_H
34 | #define _LZSS_LOCAL_H
35 |
36 | /***************************************************************************
37 | * INCLUDED FILES
38 | ***************************************************************************/
39 | #include
40 |
41 | /***************************************************************************
42 | * CONSTANTS
43 | ***************************************************************************/
44 |
45 | #define OFFSET_BITS 12
46 | #define LENGTH_BITS 4
47 |
48 | #if (((1 << (OFFSET_BITS + LENGTH_BITS)) - 1) > UINT_MAX)
49 | #error "Size of encoded data must not exceed the size of an unsigned int"
50 | #endif
51 |
52 | /* We want a sliding window*/
53 | #define WINDOW_SIZE (1 << OFFSET_BITS)
54 |
55 | /* maximum match length not encoded and maximum length encoded (4 bits) */
56 | #define MAX_UNCODED 2
57 | #define MAX_CODED ((1 << LENGTH_BITS) + MAX_UNCODED)
58 |
59 | #define ENCODED 0 /* encoded string */
60 | #define UNCODED 1 /* unencoded character */
61 |
62 | /***************************************************************************
63 | * TYPE DEFINITIONS
64 | ***************************************************************************/
65 |
66 | /***************************************************************************
67 | * This data structure stores an encoded string in (offset, length) format.
68 | * The actual encoded string is stored using OFFSET_BITS for the offset and
69 | * LENGTH_BITS for the length.
70 | ***************************************************************************/
71 | typedef struct encoded_string_t
72 | {
73 | unsigned int offset; /* offset to start of longest match */
74 | unsigned int length; /* length of longest match */
75 | } encoded_string_t;
76 |
77 | /* struct for sliding window buffer and the uncoded lookahead */
78 | typedef struct buffers_t
79 | {
80 | unsigned char slidingWindow[WINDOW_SIZE];
81 | unsigned char uncodedLookahead[MAX_CODED];
82 | } buffers_t;
83 |
84 |
85 | /***************************************************************************
86 | * MACROS
87 | ***************************************************************************/
88 | /* wraps array index within array bounds (assumes value < 2 * limit) */
89 | #define Wrap(value, limit) \
90 | (((value) < (limit)) ? (value) : ((value) - (limit)))
91 |
92 | /* increments cyclic array index */
93 | #define CyclicInc(var, limit) \
94 | ((var + 1) < (limit)) ? ((var) = ((var) + 1)) : ((var) = 0)
95 |
96 |
97 | /***************************************************************************
98 | * PROTOTYPES
99 | ***************************************************************************/
100 |
101 | /***************************************************************************
102 | * These are the prototypes for functions that must be provided by any
103 | * methods for maintaining and searching the sliding window dictionary.
104 | *
105 | * InitializeSearchStructures and ReplaceChar return 0 for success and -1
106 | * for a failure. errno will be set in the event of a failure.
107 | *
108 | * FindMatch will return the encoded_string_t value referencing the match
109 | * in the sliding window dictionary. the length field will be 0 if no
110 | * match is found.
111 | ***************************************************************************/
112 | int InitializeSearchStructures(buffers_t *buffers);
113 |
114 | int ReplaceChar(unsigned char *slidingWindow,
115 | const unsigned int charIndex,
116 | const unsigned char replacement);
117 |
118 | encoded_string_t FindMatch(buffers_t *buffers,
119 | const unsigned int windowHead,
120 | const unsigned int uncodedHead,
121 | const unsigned int uncodedLen);
122 |
123 | #endif /* ndef _LZSS_LOCAL_H */
124 |
--------------------------------------------------------------------------------
/bitfile/docs/search/search.css:
--------------------------------------------------------------------------------
1 | /*---------------- Search Box */
2 |
3 | #FSearchBox {
4 | float: left;
5 | }
6 |
7 | #MSearchBox {
8 | white-space : nowrap;
9 | float: none;
10 | margin-top: 8px;
11 | right: 0px;
12 | width: 170px;
13 | height: 24px;
14 | z-index: 102;
15 | }
16 |
17 | #MSearchBox .left
18 | {
19 | display:block;
20 | position:absolute;
21 | left:10px;
22 | width:20px;
23 | height:19px;
24 | background:url('search_l.png') no-repeat;
25 | background-position:right;
26 | }
27 |
28 | #MSearchSelect {
29 | display:block;
30 | position:absolute;
31 | width:20px;
32 | height:19px;
33 | }
34 |
35 | .left #MSearchSelect {
36 | left:4px;
37 | }
38 |
39 | .right #MSearchSelect {
40 | right:5px;
41 | }
42 |
43 | #MSearchField {
44 | display:block;
45 | position:absolute;
46 | height:19px;
47 | background:url('search_m.png') repeat-x;
48 | border:none;
49 | width:115px;
50 | margin-left:20px;
51 | padding-left:4px;
52 | color: #909090;
53 | outline: none;
54 | font: 9pt Arial, Verdana, sans-serif;
55 | -webkit-border-radius: 0px;
56 | }
57 |
58 | #FSearchBox #MSearchField {
59 | margin-left:15px;
60 | }
61 |
62 | #MSearchBox .right {
63 | display:block;
64 | position:absolute;
65 | right:10px;
66 | top:8px;
67 | width:20px;
68 | height:19px;
69 | background:url('search_r.png') no-repeat;
70 | background-position:left;
71 | }
72 |
73 | #MSearchClose {
74 | display: none;
75 | position: absolute;
76 | top: 4px;
77 | background : none;
78 | border: none;
79 | margin: 0px 4px 0px 0px;
80 | padding: 0px 0px;
81 | outline: none;
82 | }
83 |
84 | .left #MSearchClose {
85 | left: 6px;
86 | }
87 |
88 | .right #MSearchClose {
89 | right: 2px;
90 | }
91 |
92 | .MSearchBoxActive #MSearchField {
93 | color: #000000;
94 | }
95 |
96 | /*---------------- Search filter selection */
97 |
98 | #MSearchSelectWindow {
99 | display: none;
100 | position: absolute;
101 | left: 0; top: 0;
102 | border: 1px solid #90A5CE;
103 | background-color: #F9FAFC;
104 | z-index: 10001;
105 | padding-top: 4px;
106 | padding-bottom: 4px;
107 | -moz-border-radius: 4px;
108 | -webkit-border-top-left-radius: 4px;
109 | -webkit-border-top-right-radius: 4px;
110 | -webkit-border-bottom-left-radius: 4px;
111 | -webkit-border-bottom-right-radius: 4px;
112 | -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
113 | }
114 |
115 | .SelectItem {
116 | font: 8pt Arial, Verdana, sans-serif;
117 | padding-left: 2px;
118 | padding-right: 12px;
119 | border: 0px;
120 | }
121 |
122 | span.SelectionMark {
123 | margin-right: 4px;
124 | font-family: monospace;
125 | outline-style: none;
126 | text-decoration: none;
127 | }
128 |
129 | a.SelectItem {
130 | display: block;
131 | outline-style: none;
132 | color: #000000;
133 | text-decoration: none;
134 | padding-left: 6px;
135 | padding-right: 12px;
136 | }
137 |
138 | a.SelectItem:focus,
139 | a.SelectItem:active {
140 | color: #000000;
141 | outline-style: none;
142 | text-decoration: none;
143 | }
144 |
145 | a.SelectItem:hover {
146 | color: #FFFFFF;
147 | background-color: #3D578C;
148 | outline-style: none;
149 | text-decoration: none;
150 | cursor: pointer;
151 | display: block;
152 | }
153 |
154 | /*---------------- Search results window */
155 |
156 | iframe#MSearchResults {
157 | width: 60ex;
158 | height: 15em;
159 | }
160 |
161 | #MSearchResultsWindow {
162 | display: none;
163 | position: absolute;
164 | left: 0; top: 0;
165 | border: 1px solid #000;
166 | background-color: #EEF1F7;
167 | z-index:10000;
168 | }
169 |
170 | /* ----------------------------------- */
171 |
172 |
173 | #SRIndex {
174 | clear:both;
175 | padding-bottom: 15px;
176 | }
177 |
178 | .SREntry {
179 | font-size: 10pt;
180 | padding-left: 1ex;
181 | }
182 |
183 | .SRPage .SREntry {
184 | font-size: 8pt;
185 | padding: 1px 5px;
186 | }
187 |
188 | body.SRPage {
189 | margin: 5px 2px;
190 | }
191 |
192 | .SRChildren {
193 | padding-left: 3ex; padding-bottom: .5em
194 | }
195 |
196 | .SRPage .SRChildren {
197 | display: none;
198 | }
199 |
200 | .SRSymbol {
201 | font-weight: bold;
202 | color: #425E97;
203 | font-family: Arial, Verdana, sans-serif;
204 | text-decoration: none;
205 | outline: none;
206 | }
207 |
208 | a.SRScope {
209 | display: block;
210 | color: #425E97;
211 | font-family: Arial, Verdana, sans-serif;
212 | text-decoration: none;
213 | outline: none;
214 | }
215 |
216 | a.SRSymbol:focus, a.SRSymbol:active,
217 | a.SRScope:focus, a.SRScope:active {
218 | text-decoration: underline;
219 | }
220 |
221 | span.SRScope {
222 | padding-left: 4px;
223 | }
224 |
225 | .SRPage .SRStatus {
226 | padding: 2px 5px;
227 | font-size: 8pt;
228 | font-style: italic;
229 | }
230 |
231 | .SRResult {
232 | display: none;
233 | }
234 |
235 | DIV.searchresults {
236 | margin-left: 10px;
237 | margin-right: 10px;
238 | }
239 |
240 | /*---------------- External search page results */
241 |
242 | .searchresult {
243 | background-color: #F0F3F8;
244 | }
245 |
246 | .pages b {
247 | color: white;
248 | padding: 5px 5px 3px 5px;
249 | background-image: url("../tab_a.png");
250 | background-repeat: repeat-x;
251 | text-shadow: 0 1px 1px #000000;
252 | }
253 |
254 | .pages {
255 | line-height: 17px;
256 | margin-left: 4px;
257 | text-decoration: none;
258 | }
259 |
260 | .hl {
261 | font-weight: bold;
262 | }
263 |
264 | #searchresults {
265 | margin-bottom: 20px;
266 | }
267 |
268 | .searchpages {
269 | margin-top: 10px;
270 | }
271 |
272 |
--------------------------------------------------------------------------------
/bitfile/docs/search/all_0.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['bf_5fappend',['BF_APPEND',['../bitfile_8h.html#a75b77cadd483d47efc5d1d9db15be1dca9d7d37657302b4eab04aea5716718e74',1,'bitfile.h']]],
4 | ['bf_5fbig_5fendian',['BF_BIG_ENDIAN',['../group__library.html#gga2beab778f0d495dd51c07e81abd44336ad5cb1f75be16838f9140696f7eaa45b2',1,'bitfile.c']]],
5 | ['bf_5flittle_5fendian',['BF_LITTLE_ENDIAN',['../group__library.html#gga2beab778f0d495dd51c07e81abd44336a66958544a0cdfa4c7d5615a1ef8466fa',1,'bitfile.c']]],
6 | ['bf_5fmodes',['BF_MODES',['../bitfile_8h.html#a75b77cadd483d47efc5d1d9db15be1dc',1,'bitfile.h']]],
7 | ['bf_5fno_5fmode',['BF_NO_MODE',['../bitfile_8h.html#a75b77cadd483d47efc5d1d9db15be1dcaa1319dd357e648d93f1b7d9b8472f86c',1,'bitfile.h']]],
8 | ['bf_5fread',['BF_READ',['../bitfile_8h.html#a75b77cadd483d47efc5d1d9db15be1dcac662af3ac780211d260eba510acdea31',1,'bitfile.h']]],
9 | ['bf_5funknown_5fendian',['BF_UNKNOWN_ENDIAN',['../group__library.html#gga2beab778f0d495dd51c07e81abd44336a4d2d70e46140054c8b3526e93104f5c7',1,'bitfile.c']]],
10 | ['bf_5fwrite',['BF_WRITE',['../bitfile_8h.html#a75b77cadd483d47efc5d1d9db15be1dca3f4128f8fa6e8da86f830eda3323492c',1,'bitfile.h']]],
11 | ['bit_5ffile_5ft',['bit_file_t',['../structbit__file__t.html',1,'bit_file_t'],['../bitfile_8h.html#ae5e32e2c53240268e94849c5dd8711f7',1,'bit_file_t(): bitfile.h']]],
12 | ['bitbuffer',['bitBuffer',['../structbit__file__t.html#a99619727a81f2238c8e07839b51d8d88',1,'bit_file_t']]],
13 | ['bitcount',['bitCount',['../structbit__file__t.html#ad39ae96e8a9b339b2d0f316d1dee4537',1,'bit_file_t']]],
14 | ['bitfile_2ec',['bitfile.c',['../bitfile_8c.html',1,'']]],
15 | ['bitfile_2eh',['bitfile.h',['../bitfile_8h.html',1,'']]],
16 | ['bitfilebytealign',['BitFileByteAlign',['../group__library.html#ga57656c135b2acd2d5ac0d857a59b686a',1,'BitFileByteAlign(bit_file_t *stream): bitfile.c'],['../group__library.html#ga57656c135b2acd2d5ac0d857a59b686a',1,'BitFileByteAlign(bit_file_t *stream): bitfile.c']]],
17 | ['bitfileclose',['BitFileClose',['../group__library.html#ga2d9f3f488a69bee8b59713c9539fbe8e',1,'BitFileClose(bit_file_t *stream): bitfile.c'],['../group__library.html#ga2d9f3f488a69bee8b59713c9539fbe8e',1,'BitFileClose(bit_file_t *stream): bitfile.c']]],
18 | ['bitfileflushoutput',['BitFileFlushOutput',['../group__library.html#ga7203e0c1fb97777f4b5b55541d15ca43',1,'BitFileFlushOutput(bit_file_t *stream, const unsigned char onesFill): bitfile.c'],['../group__library.html#ga7203e0c1fb97777f4b5b55541d15ca43',1,'BitFileFlushOutput(bit_file_t *stream, const unsigned char onesFill): bitfile.c']]],
19 | ['bitfilegetbit',['BitFileGetBit',['../group__library.html#ga740f94d263304d012925f272e817f1dd',1,'BitFileGetBit(bit_file_t *stream): bitfile.c'],['../group__library.html#ga740f94d263304d012925f272e817f1dd',1,'BitFileGetBit(bit_file_t *stream): bitfile.c']]],
20 | ['bitfilegetbits',['BitFileGetBits',['../group__library.html#gafd782318558bc2dc5d9e5be60ed81841',1,'BitFileGetBits(bit_file_t *stream, void *bits, const unsigned int count): bitfile.c'],['../group__library.html#gafd782318558bc2dc5d9e5be60ed81841',1,'BitFileGetBits(bit_file_t *stream, void *bits, const unsigned int count): bitfile.c']]],
21 | ['bitfilegetbitsnum',['BitFileGetBitsNum',['../group__library.html#ga635cd52b94bd31c0c6de59345e8e03f0',1,'BitFileGetBitsNum(bit_file_t *stream, void *bits, const unsigned int count, const size_t size): bitfile.c'],['../group__library.html#ga635cd52b94bd31c0c6de59345e8e03f0',1,'BitFileGetBitsNum(bit_file_t *stream, void *bits, const unsigned int count, const size_t size): bitfile.c']]],
22 | ['bitfilegetchar',['BitFileGetChar',['../group__library.html#ga9842d2b062a215d82904c095ea16c1a9',1,'BitFileGetChar(bit_file_t *stream): bitfile.c'],['../group__library.html#ga9842d2b062a215d82904c095ea16c1a9',1,'BitFileGetChar(bit_file_t *stream): bitfile.c']]],
23 | ['bitfileopen',['BitFileOpen',['../group__library.html#ga96204412063a32bd1aaf28219b4ab52f',1,'BitFileOpen(const char *fileName, const BF_MODES mode): bitfile.c'],['../group__library.html#ga96204412063a32bd1aaf28219b4ab52f',1,'BitFileOpen(const char *fileName, const BF_MODES mode): bitfile.c']]],
24 | ['bitfileputbit',['BitFilePutBit',['../group__library.html#ga12cd076e8c3ef8a34c9cc5cde56b48cc',1,'BitFilePutBit(const int c, bit_file_t *stream): bitfile.c'],['../group__library.html#ga12cd076e8c3ef8a34c9cc5cde56b48cc',1,'BitFilePutBit(const int c, bit_file_t *stream): bitfile.c']]],
25 | ['bitfileputbits',['BitFilePutBits',['../group__library.html#ga5793a6909fac8efafbde384f418522eb',1,'BitFilePutBits(bit_file_t *stream, void *bits, const unsigned int count): bitfile.c'],['../group__library.html#ga5793a6909fac8efafbde384f418522eb',1,'BitFilePutBits(bit_file_t *stream, void *bits, const unsigned int count): bitfile.c']]],
26 | ['bitfileputbitsnum',['BitFilePutBitsNum',['../group__library.html#ga3a1b7ff39c623548d8be081c1c1c9155',1,'BitFilePutBitsNum(bit_file_t *stream, void *bits, const unsigned int count, const size_t size): bitfile.c'],['../group__library.html#ga3a1b7ff39c623548d8be081c1c1c9155',1,'BitFilePutBitsNum(bit_file_t *stream, void *bits, const unsigned int count, const size_t size): bitfile.c']]],
27 | ['bitfileputchar',['BitFilePutChar',['../group__library.html#ga470416ef00ff777cbaa14b2f433962f8',1,'BitFilePutChar(const int c, bit_file_t *stream): bitfile.c'],['../group__library.html#ga470416ef00ff777cbaa14b2f433962f8',1,'BitFilePutChar(const int c, bit_file_t *stream): bitfile.c']]],
28 | ['bitfiletofile',['BitFileToFILE',['../group__library.html#ga6bdd128a82f702dfa0ea7c3b6ce2ece2',1,'BitFileToFILE(bit_file_t *stream): bitfile.c'],['../group__library.html#ga6bdd128a82f702dfa0ea7c3b6ce2ece2',1,'BitFileToFILE(bit_file_t *stream): bitfile.c']]],
29 | ['bytes',['bytes',['../unionendian__test__t.html#a9ffb76a899edade37aeeddc396e7da9a',1,'endian_test_t']]],
30 | ['bitfile_20_2d_20bit_20stream_20library',['Bitfile - Bit stream library',['../index.html',1,'']]]
31 | ];
32 |
--------------------------------------------------------------------------------
/bitfile/bitfile.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \brief Bit file stream library header
3 | * \file bitfile.h
4 | * \author Michael Dipperstein (mdipperstein@gmail.com)
5 | * \date January 9, 2004
6 | *
7 | * This file provides definitions and prototypes for a simple library of
8 | * I/O functions for files that contain data in sizes that aren't integral
9 | * bytes. An attempt was made to make the functions in this library
10 | * analogous to functions provided to manipulate byte streams. The functions
11 | * contained in this library were created with compression algorithms in mind,
12 | * but may be suited to other applications.
13 | *
14 | * \copyright Copyright (C) 2004 - 2019 by Michael Dipperstein
15 | * (mdipperstein@gmail.com)
16 | *
17 | * \par
18 | * This file is part of the bit file library.
19 | *
20 | * \license
21 | * The bitfile library is free software; you can redistribute it
22 | * and/or modify it under the terms of the GNU Lesser General Public
23 | * License as published by the Free Software Foundation; either version 3
24 | * of the License, or (at your option) any later version.
25 | *
26 | * \par
27 | * The bitfile library is distributed in the hope that it will be useful,
28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
30 | * General Public License for more details.
31 | *
32 | * \par
33 | * You should have received a copy of the GNU Lesser General Public License
34 | * along with this program. If not, see .
35 | *
36 | */
37 |
38 | #ifndef _BITFILE_H_
39 | #define _BITFILE_H_
40 |
41 | /**
42 | * \mainpage Bitfile - Bit stream library
43 | *
44 | * These pages provide documentation for Bitfile, a bit stream handling library.
45 | *
46 | * \copyright Copyright (C) 2004 - 2019 by Michael Dipperstein
47 | * (mdipperstein@gmail.com)
48 | *
49 | * \license
50 | * The bitfile library is free software; you can redistribute it
51 | * and/or modify it under the terms of the GNU Lesser General Public
52 | * License as published by the Free Software Foundation; either version 3
53 | * of the License, or (at your option) any later version.
54 | *
55 | * \par
56 | * The bitfile library is distributed in the hope that it will be useful,
57 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
58 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
59 | * General Public License for more details.
60 | *
61 | * \par
62 | * You should have received a copy of the GNU Lesser General Public License
63 | * along with this program. If not, see .
64 | *
65 | */
66 |
67 | /***************************************************************************
68 | * INCLUDED FILES
69 | ***************************************************************************/
70 | #include
71 |
72 | /***************************************************************************
73 | * TYPE DEFINITIONS
74 | ***************************************************************************/
75 |
76 | /**
77 | * \enum BF_MODES
78 | * \brief This is an enumeration of the bit file modes (read, write, and
79 | * append)
80 | */
81 | typedef enum
82 | {
83 | BF_READ = 0, /*!< indicate that the file is for reading */
84 | BF_WRITE = 1, /*!< indicate that the file is for writing */
85 | BF_APPEND= 2, /*!< indicate that writes will be appended to the file */
86 | BF_NO_MODE /*!< end of enum */
87 | } BF_MODES;
88 |
89 | struct bit_file_t;
90 |
91 | /**
92 | * \typedef bit_file_t
93 | * \brief This is shorthand for struct bit_file_t, the of the structure that
94 | * is used to access all bitfiles. It is analogous to FILE.
95 | */
96 | typedef struct bit_file_t bit_file_t;
97 |
98 | /***************************************************************************
99 | * PROTOTYPES
100 | ***************************************************************************/
101 |
102 | /* open/close file */
103 | bit_file_t *BitFileOpen(const char *fileName, const BF_MODES mode);
104 | bit_file_t *MakeBitFile(FILE *stream, const BF_MODES mode);
105 | int BitFileClose(bit_file_t *stream);
106 | FILE *BitFileToFILE(bit_file_t *stream);
107 |
108 | /* toss spare bits and byte align file */
109 | int BitFileByteAlign(bit_file_t *stream);
110 |
111 | /* fill byte with ones or zeros and write out results */
112 | int BitFileFlushOutput(bit_file_t *stream, const unsigned char onesFill);
113 |
114 | /* get/put character */
115 | int BitFileGetChar(bit_file_t *stream);
116 | int BitFilePutChar(const int c, bit_file_t *stream);
117 |
118 | /* get/put single bit */
119 | int BitFileGetBit(bit_file_t *stream);
120 | int BitFilePutBit(const int c, bit_file_t *stream);
121 |
122 | /* get/put number of bits (most significant bit to least significat bit) */
123 | int BitFileGetBits(bit_file_t *stream, void *bits, const unsigned int count);
124 | int BitFilePutBits(bit_file_t *stream, void *bits, const unsigned int count);
125 |
126 | /***************************************************************************
127 | * get/put a number of bits from numerical types (short, int, long, ...)
128 | *
129 | * For these functions, the first bit in/out is the least significant bit of
130 | * the least significant byte, so machine endiness is accounted for. Only
131 | * big endian and little endian architectures are currently supported.
132 | *
133 | * NOTE: size is the sizeof() for the data structure pointed to by bits.
134 | ***************************************************************************/
135 | int BitFileGetBitsNum(bit_file_t *stream, void *bits, const unsigned int count,
136 | const size_t size);
137 | int BitFilePutBitsNum(bit_file_t *stream, void *bits, const unsigned int count,
138 | const size_t size);
139 |
140 | #endif /* _BITFILE_H_ */
141 |
--------------------------------------------------------------------------------
/bitfile/docs/unionendian__test__t.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Bitfile: endian_test_t Struct Reference
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
This page explains how to interpret the graphs that are generated by doxygen.
71 |
Consider the following example:
/*! Invisible class because of truncation */
class Invisible { };
/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };
/* Class not documented with doxygen comments */
class Undocumented { };
/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };
/*! A template class */
template<class T> class Templ { };
/*! Class that is inherited using protected inheritance */
class ProtectedBase { };
/*! Class that is inherited using private inheritance */
class PrivateBase { };
/*! Class that is used by the Inherited class */
class Used { };
/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
protected ProtectedBase,
private PrivateBase,
public Undocumented,
public Templ<int>
{
private:
Used *m_usedClass;
};
This will result in the following graph:
72 |
73 |
74 |
75 |
The boxes in the above graph have the following meaning:
76 |
77 |
78 | A filled gray box represents the struct or class for which the graph is generated.
79 |
80 | A box with a black border denotes a documented struct or class.
81 |
82 | A box with a gray border denotes an undocumented struct or class.
83 |
84 | A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
85 |
86 |
The arrows have the following meaning:
87 |
88 |
89 | A dark blue arrow is used to visualize a public inheritance relation between two classes.
90 |
91 | A dark green arrow is used for protected inheritance.
92 |
93 | A dark red arrow is used for private inheritance.
94 |
95 | A purple dashed arrow is used if a class is contained or used by another class. The arrow is labelled with the variable(s) through which the pointed class or struct is accessible.
96 |
97 | A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labelled with the template parameters of the instance.
98 |
99 |
100 |
101 |
102 | Generated by
103 |
104 | 1.8.14
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/brute.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************
2 | * Lempel, Ziv, Storer, and Szymanski Encoding and Decoding
3 | *
4 | * File : brute.c
5 | * Purpose : Implement brute force matching of uncoded strings for LZSS
6 | * algorithm.
7 | * Author : Michael Dipperstein
8 | * Date : February 18, 2004
9 | *
10 | ****************************************************************************
11 | *
12 | * Brute: Brute force matching routines used by LZSS Encoding/Decoding
13 | * Routine
14 | * Copyright (C) 2004 - 2007, 2014, 2020 by
15 | * Michael Dipperstein (mdipperstein@gmail.com)
16 | *
17 | * This file is part of the lzss library.
18 | *
19 | * The lzss library is free software; you can redistribute it and/or
20 | * modify it under the terms of the GNU Lesser General Public License as
21 | * published by the Free Software Foundation; either version 3 of the
22 | * License, or (at your option) any later version.
23 | *
24 | * The lzss library is distributed in the hope that it will be useful, but
25 | * WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
27 | * General Public License for more details.
28 | *
29 | * You should have received a copy of the GNU Lesser General Public License
30 | * along with this program. If not, see .
31 | *
32 | ***************************************************************************/
33 |
34 | /***************************************************************************
35 | * INCLUDED FILES
36 | ***************************************************************************/
37 | #include "lzlocal.h"
38 |
39 | /***************************************************************************
40 | * GLOBAL VARIABLES
41 | ***************************************************************************/
42 |
43 | /***************************************************************************
44 | * FUNCTIONS
45 | ***************************************************************************/
46 |
47 | /****************************************************************************
48 | * Function : InitializeSearchStructures
49 | * Description: This function initializes structures used to speed up the
50 | * process of mathcing uncoded strings to strings in the
51 | * sliding window. The brute force search doesn't use any
52 | * special structures, so this function doesn't do anything.
53 | * Parameters : buffers - pointer to structure with sliding window and
54 | * uncoded lookahead buffers
55 | * Effects : None
56 | * Returned : 0 for success, -1 for failure. errno will be set in the
57 | * event of a failure.
58 | ****************************************************************************/
59 | int InitializeSearchStructures(buffers_t *buffers)
60 | {
61 | (void)buffers; /* not used */
62 | return 0;
63 | }
64 |
65 | /****************************************************************************
66 | * Function : FindMatch
67 | * Description: This function will search through the slidingWindow
68 | * dictionary for the longest sequence matching the MAX_CODED
69 | * long string stored in uncodedLookahed.
70 | * Parameters : buffers - pointer to structure with sliding window and
71 | * uncoded lookahead buffers
72 | * windowHead - head of sliding window
73 | * uncodedHead - head of uncoded lookahead buffer
74 | * uncodedLen - length of uncoded lookahead buffer
75 | * Effects : None
76 | * Returned : The sliding window index where the match starts and the
77 | * length of the match. If there is no match a length of
78 | * zero will be returned.
79 | ****************************************************************************/
80 | encoded_string_t FindMatch(buffers_t *buffers,
81 | const unsigned int windowHead,
82 | const unsigned int uncodedHead,
83 | const unsigned int uncodedLen)
84 | {
85 | encoded_string_t matchData;
86 | unsigned int i; /* current search start offset */
87 | unsigned int j; /* current match length */
88 |
89 | /* unwrapped copy of uncoded lookahead */
90 | unsigned char uncoded[MAX_CODED];
91 |
92 | matchData.length = 0;
93 | matchData.offset = 0;
94 |
95 | if (uncodedLen <= MAX_UNCODED)
96 | {
97 | /* don't even bother, there aren't enough symbols to encode */
98 | return matchData;
99 | }
100 |
101 | for (i = 0; i < uncodedLen; i++)
102 | {
103 | uncoded[i] =
104 | buffers->uncodedLookahead[Wrap((uncodedHead + i), MAX_CODED)];
105 | }
106 |
107 | i = windowHead; /* start at the beginning of the sliding window */
108 | j = 0;
109 |
110 | while (1)
111 | {
112 | if (buffers->slidingWindow[i] == uncoded[0])
113 | {
114 | /* we matched one. how many more match? */
115 | j = 1;
116 |
117 | while(uncoded[j] ==
118 | buffers->slidingWindow[Wrap((i + j), WINDOW_SIZE)])
119 | {
120 | j++;
121 |
122 | if (j == uncodedLen)
123 | {
124 | break;
125 | }
126 | }
127 |
128 | /* end of current match */
129 | if (j > matchData.length)
130 | {
131 | matchData.length = j;
132 | matchData.offset = i;
133 | }
134 | }
135 |
136 | if (j == uncodedLen)
137 | {
138 | break;
139 | }
140 |
141 | CyclicInc(i, WINDOW_SIZE);
142 | if (i == windowHead)
143 | {
144 | /* we're where we started */
145 | break;
146 | }
147 | }
148 |
149 | return matchData;
150 | }
151 |
152 | /****************************************************************************
153 | * Function : ReplaceChar
154 | * Description: This function replaces the character stored in
155 | * slidingWindow[charIndex] with the one specified by
156 | * replacement.
157 | * Parameters : slidingWindow - pointer to the head of the sliding window.
158 | * charIndex - sliding window index of the character to be
159 | * removed from the linked list.
160 | * replacement - new character
161 | * Effects : slidingWindow[charIndex] is replaced by replacement.
162 | * Returned : 0 for success, -1 for failure. errno will be set in the
163 | * event of a failure.
164 | ****************************************************************************/
165 | int ReplaceChar(unsigned char *slidingWindow,
166 | const unsigned int charIndex,
167 | const unsigned char replacement)
168 | {
169 | slidingWindow[charIndex] = replacement;
170 | return 0;
171 | }
172 |
--------------------------------------------------------------------------------
/bitfile/docs/sample_8c.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Bitfile: sample.c File Reference
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
The bit file library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
107 |
The bit file library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
108 |
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.