summaryrefslogtreecommitdiff
path: root/libs/cpp-httplib/split.py
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@mailbox.org>2026-01-09 15:28:38 +0100
committerAldrik Ramaekers <aldrik@mailbox.org>2026-01-09 15:28:38 +0100
commit210404a73706993d197c1290d5a411394e176fbe (patch)
tree93c3ea9fc4691ca42f26dd92c6e14627af0b47af /libs/cpp-httplib/split.py
parenta65e876f3277a7d7fca6e5129ac3e200dae2d0dc (diff)
remove unused lib files
Diffstat (limited to 'libs/cpp-httplib/split.py')
-rw-r--r--libs/cpp-httplib/split.py67
1 files changed, 0 insertions, 67 deletions
diff --git a/libs/cpp-httplib/split.py b/libs/cpp-httplib/split.py
deleted file mode 100644
index 4d8b307..0000000
--- a/libs/cpp-httplib/split.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python3
-
-"""This script splits httplib.h into .h and .cc parts."""
-
-import argparse
-import os
-import sys
-
-border = '// ----------------------------------------------------------------------------'
-
-args_parser = argparse.ArgumentParser(description=__doc__)
-args_parser.add_argument(
- "-e", "--extension", help="extension of the implementation file (default: cc)",
- default="cc"
-)
-args_parser.add_argument(
- "-o", "--out", help="where to write the files (default: out)", default="out"
-)
-args = args_parser.parse_args()
-
-cur_dir = os.path.dirname(sys.argv[0])
-lib_name = 'httplib'
-header_name = '/' + lib_name + '.h'
-source_name = '/' + lib_name + '.' + args.extension
-# get the input file
-in_file = cur_dir + header_name
-# get the output file
-h_out = args.out + header_name
-cc_out = args.out + source_name
-
-# if the modification time of the out file is after the in file,
-# don't split (as it is already finished)
-do_split = True
-
-if os.path.exists(h_out):
- in_time = os.path.getmtime(in_file)
- out_time = os.path.getmtime(h_out)
- do_split = in_time > out_time
-
-if do_split:
- with open(in_file) as f:
- lines = f.readlines()
-
- python_version = sys.version_info[0]
- if python_version < 3:
- os.makedirs(args.out)
- else:
- os.makedirs(args.out, exist_ok=True)
-
- in_implementation = False
- cc_out = args.out + source_name
- with open(h_out, 'w') as fh, open(cc_out, 'w') as fc:
- fc.write('#include "httplib.h"\n')
- fc.write('namespace httplib {\n')
- for line in lines:
- is_border_line = border in line
- if is_border_line:
- in_implementation = not in_implementation
- elif in_implementation:
- fc.write(line.replace('inline ', ''))
- else:
- fh.write(line)
- fc.write('} // namespace httplib\n')
-
- print("Wrote {} and {}".format(h_out, cc_out))
-else:
- print("{} and {} are up to date".format(h_out, cc_out))