forked from teserakt-io/libe4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Begin adding the public key test vectors for use with tests.
- Loading branch information
Showing
6 changed files
with
436 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/python3 | ||
|
||
import os | ||
import re | ||
|
||
def process_line(line): | ||
r = re.compile(r'.*?//(.*)') | ||
if r.match(line): | ||
newline = line.replace("//", "/*") | ||
newline = newline + " */" | ||
return True, newline | ||
return False, "" | ||
|
||
def c_read_replace(filename): | ||
|
||
print("Processing %s" % filename) | ||
with open(filename, 'rb+') as f: | ||
filetext = "" | ||
line = f.readline().decode("utf-8") | ||
|
||
while line: | ||
line = line.strip("\n") | ||
changed, newline = process_line(line) | ||
if changed: | ||
line = newline | ||
filetext = filetext + line + "\n" | ||
|
||
line = f.readline().decode("utf-8") | ||
|
||
f.seek(0) | ||
f.write(filetext.encode("utf-8")) | ||
print("Done") | ||
|
||
def find_c_h_files(): | ||
|
||
file_list = [] | ||
for root, dirs, files in os.walk("."): | ||
for f in files: | ||
if f.endswith(".c"): | ||
file_list.append(os.path.join(root, f)) | ||
if f.endswith(".h"): | ||
file_list.append(os.path.join(root, f)) | ||
return file_list | ||
|
||
if __name__ == '__main__': | ||
c_files = find_c_h_files() | ||
for f in c_files: | ||
c_read_replace(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
|
||
#include "e4/stdint.h" | ||
#include "ge.h" | ||
#include "precomp_data.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
|
||
|
||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
Oops, something went wrong.