-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Typedef dictentry array to Dict to reduce coupling * Choose better function names * Split utils into multiple files to make code more readable * Clang format Sorry for huge commit, lol
- Loading branch information
Showing
50 changed files
with
1,105 additions
and
803 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
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
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
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,7 @@ | ||
#include "utils/util.h" | ||
|
||
#include <utils/str.h> | ||
|
||
/* | ||
* @word: The japanese word to be deinflected | ||
* | ||
|
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
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
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,32 @@ | ||
#ifndef DICT_H | ||
#define DICT_H | ||
#include "utils/str.h" | ||
#include "utils/util.h" | ||
|
||
typedef struct { | ||
s8 dictname; | ||
s8 kanji; | ||
s8 reading; | ||
s8 definition; | ||
u32 frequency; | ||
bool is_deinflection; | ||
} dictentry; | ||
|
||
dictentry dictentry_dup(dictentry de); | ||
void _nonnull_ dictentry_free(dictentry de); | ||
void dictentry_print(dictentry de); | ||
|
||
typedef dictentry *Dict; | ||
Dict newDict(void); | ||
bool isEmpty(Dict dict); | ||
void _nonnull_ dictionary_add(Dict *dict, dictentry de); | ||
isize dictLen(Dict dict); | ||
|
||
// Sorts @dict in place | ||
void dictSort(Dict dict, int (*dictentryComparer)(const dictentry *a, const dictentry *b)); | ||
|
||
void _nonnull_ dictionary_free(Dict *dict); | ||
dictentry dictentry_at_index(Dict dict, isize index); | ||
dictentry *pointer_to_entry_at(Dict dict, isize index); | ||
|
||
#endif // DICT_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef FREQENTRY_H | ||
#define FREQENTRY_H | ||
#include <utils/str.h> | ||
|
||
typedef struct { | ||
s8 word; | ||
s8 reading; | ||
u32 frequency; | ||
} freqentry; | ||
|
||
freqentry freqentry_dup(freqentry fe); | ||
void freqentry_free(freqentry *fe); | ||
|
||
#endif // FREQENTRY_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#ifndef AUDIO_H | ||
#define AUDIO_H | ||
|
||
#include "utils/util.h" | ||
#include <utils/str.h> | ||
|
||
void play_audio(s8 filepath); | ||
|
||
#endif //AUDIO_H | ||
#endif // AUDIO_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#ifndef CLIPBOARD_H | ||
#define CLIPBOARD_H | ||
|
||
#include "utils/util.h" | ||
#include <utils/str.h> | ||
|
||
s8 get_selection(void); | ||
s8 get_clipboard(void); | ||
s8 get_next_clipboard(void); | ||
char *get_clipboard(void); | ||
char *get_next_clipboard(void); | ||
|
||
#endif //CLIPBOARD_H | ||
#endif // CLIPBOARD_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
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
void notify(_Bool urgent, char const *fmt, ...); | ||
|
||
#endif //NOTIFICATIONS_H | ||
#endif // NOTIFICATIONS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#ifndef WINDOWTITLE_H | ||
#define WINDOWTITLE_H | ||
|
||
#include "utils/util.h" | ||
#include <utils/str.h> | ||
|
||
s8 get_windowname(void); | ||
|
||
#endif //WINDOWTITLE_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
File renamed without changes.
Oops, something went wrong.