Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Rudolf
/
huffman
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
151edf82
authored
Nov 22, 2016
by
Rudolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove tree printing support
This simple printing no longer shows the tree properly
parent
8ce552bd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
34 deletions
huffman.c
print_helper.c
print_helper.h
huffman.c
View file @
151edf82
...
...
@@ -93,9 +93,6 @@ int encode_file(FILE *in, FILE *out)
if
(
!
tree
)
return
-
1
;
if
(
DEBUG
)
print_tree
(
tree
);
encode_header
(
&
bitbuf
,
tree
);
fseek
(
in
,
0
,
SEEK_SET
);
...
...
@@ -122,9 +119,6 @@ int decode_file(FILE *in, FILE *out)
decode_tree
(
&
bitbuf
,
out
,
tree
);
if
(
DEBUG
)
print_tree
(
tree
);
free_tree
(
tree
);
return
0
;
...
...
print_helper.c
View file @
151edf82
...
...
@@ -45,30 +45,3 @@ void print_char(unsigned char c)
break
;
}
}
void
print_tree
(
struct
tree
*
parent
)
{
/*int level = 1;
printf("Showing tree\n");
while (parent->left != NULL ) {
if (parent->right) {
for (int i = 0; i < level; i++)
printf(" ");
print_char(parent->right->ch);
}
for (int i = 0; i < level-1; i++) {
printf(" ");
}
printf("o\n");
if (parent->left && !parent->left->left) {
for (int i = 0; i < level; i++)
printf(" ");
print_char(parent->left->ch);
}
level += 1;
parent = parent->left;
}*/
}
print_helper.h
View file @
151edf82
...
...
@@ -21,6 +21,5 @@ void __printb(void *value, size_t size);
})
void
print_char
(
unsigned
char
c
);
void
print_tree
(
struct
tree
*
parent
);
#endif
/* _PRINT_HELPER_H_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment