Skip to content

Commit

Permalink
Move base64simd into a 3rdparty folder
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Nov 14, 2023
1 parent f36f37b commit 250aa3a
Show file tree
Hide file tree
Showing 61 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ kittens/diff/options/types.py linguist-generated=true
kittens/diff/options/parse.py linguist-generated=true
glfw/*.c linguist-vendored=true
glfw/*.h linguist-vendored=true
3rdparty/** linguist-vendored=true
kittens/unicode_input/names.h linguist-generated=true
tools/wcswidth/std.go linguist-generated=true
tools/unicode_names/names.txt linguist-generated=true
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 7 additions & 6 deletions count-lines-of-code
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import subprocess
ls_files = subprocess.check_output([ 'git', 'ls-files']).decode('utf-8')
all_files = set(ls_files.splitlines())
all_files.discard('')
cp = subprocess.run(['git', 'check-attr', 'linguist-generated', '--stdin'],
check=True, stdout=subprocess.PIPE, input='\n'.join(all_files).encode('utf-8'))
for line in cp.stdout.decode().splitlines():
if line.endswith(' true'):
fname = line.split(':', 1)[0]
all_files.discard(fname)
for attr in ('linguist-generated', 'linguist-vendored'):
cp = subprocess.run(['git', 'check-attr', attr, '--stdin'],
check=True, stdout=subprocess.PIPE, input='\n'.join(all_files).encode('utf-8'))
for line in cp.stdout.decode().splitlines():
if line.endswith(' true'):
fname = line.split(':', 1)[0]
all_files.discard(fname)

all_files -= {'gen/nerd-fonts-glyphs.txt', 'gen/rowcolumn-diacritics.txt'}
cp = subprocess.run(['cloc', '--list-file', '-'], input='\n'.join(all_files).encode())
Expand Down
2 changes: 1 addition & 1 deletion kitty/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "../base64/include/libbase64.h"
#include "../3rdparty/base64/include/libbase64.h"

static inline size_t required_buffer_size_for_base64_decode(size_t src_sz) { return (src_sz / 4 * 3 + 2); }
static inline size_t required_buffer_size_for_base64_encode(size_t src_sz) { return ((src_sz + 2) / 3 * 4); }
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ def get_source_specific_defines(env: Env, src: str) -> Tuple[str, List[str], Opt
if not env.vcs_rev:
env.vcs_rev = get_vcs_rev()
return src, [], [f'KITTY_VCS_REV="{env.vcs_rev}"', f'WRAPPED_KITTENS="{wrapped_kittens()}"']
if src.startswith('base64/'):
return src, ['base64',], base64_defines()
if src.startswith('3rdparty/base64/'):
return src, ['3rdparty/base64',], base64_defines()
try:
return src, [], env.library_paths[src]
except KeyError:
Expand Down Expand Up @@ -793,10 +793,10 @@ def find_c_files() -> Tuple[List[str], List[str]]:
ans.append('kitty/vt-parser-dump.c')

# base64
ans.extend(glob.glob('base64/lib/arch/*/codec.c'))
ans.append('base64/lib/tables/tables.c')
ans.append('base64/lib/codec_choose.c')
ans.append('base64/lib/lib.c')
ans.extend(glob.glob('3rdparty/base64/lib/arch/*/codec.c'))
ans.append('3rdparty/base64/lib/tables/tables.c')
ans.append('3rdparty/base64/lib/codec_choose.c')
ans.append('3rdparty/base64/lib/lib.c')
return ans, headers


Expand Down

0 comments on commit 250aa3a

Please sign in to comment.