forked from cory/tildefriends
Some progress on .h docs, and add a preliminary CONTRIBUTING.md.
This commit is contained in:
@ -7,8 +7,13 @@
|
||||
** @{
|
||||
*/
|
||||
|
||||
/** A JS context. */
|
||||
typedef struct JSContext JSContext;
|
||||
|
||||
/**
|
||||
** Register the bcrypt script interface.
|
||||
** @param context The JS context.
|
||||
*/
|
||||
void tf_bcrypt_register(JSContext* context);
|
||||
|
||||
/** @} */
|
||||
|
16
src/bip39.h
16
src/bip39.h
@ -11,7 +11,23 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
** Convert a key from bytes to words.
|
||||
** @param bytes A raw binary representation of a key.
|
||||
** @param bytes_size The size of bytes.
|
||||
** @param[out] out_words A human-readable English word representation of a key.
|
||||
** @param words_size The size of the out_words buffer.
|
||||
** @return True if the key was successfully converted.
|
||||
*/
|
||||
bool tf_bip39_bytes_to_words(const uint8_t* bytes, size_t bytes_size, char* out_words, size_t words_size);
|
||||
|
||||
/**
|
||||
** Convert a key from words to bytes.
|
||||
** @param words A space-separated list of English words forming a key.
|
||||
** @param[out] out_bytes A buffer to receive the raw binary form of the key.
|
||||
** @param bytes_size The size of the out_bytes buffer.
|
||||
** @return True if the key was successfully converted.
|
||||
*/
|
||||
bool tf_bip39_words_to_bytes(const char* words, uint8_t* out_bytes, size_t bytes_size);
|
||||
|
||||
/** @} */
|
||||
|
@ -10,6 +10,8 @@ enum
|
||||
{
|
||||
k_bip39_words_count = 2048
|
||||
};
|
||||
|
||||
/** An array of words used for BIP39-encoding a key. */
|
||||
extern const char* k_bip39_words[k_bip39_words_count];
|
||||
|
||||
/** @} */
|
||||
|
@ -6,8 +6,13 @@
|
||||
** @{
|
||||
*/
|
||||
|
||||
/** A JS context. */
|
||||
typedef struct JSContext JSContext;
|
||||
|
||||
/**
|
||||
** Register the database script interface.
|
||||
** @param context The JS context.
|
||||
*/
|
||||
void tf_database_register(JSContext* context);
|
||||
|
||||
/** @} */
|
||||
|
@ -8,12 +8,33 @@
|
||||
|
||||
#include <uv.h>
|
||||
|
||||
/** A JS context. */
|
||||
typedef struct JSContext JSContext;
|
||||
/** A task. */
|
||||
typedef struct _tf_task_t tf_task_t;
|
||||
|
||||
/**
|
||||
** Register the file script interface.
|
||||
** @param context The JS context.
|
||||
*/
|
||||
void tf_file_register(JSContext* context);
|
||||
|
||||
/**
|
||||
** Asynchronously stat() a file.
|
||||
** @param task The running task.
|
||||
** @param path The path to the file to stat().
|
||||
** @param callback A function that will be called with the stat result.
|
||||
** @param user_data User data that will be passed to the callback.
|
||||
*/
|
||||
void tf_file_stat(tf_task_t* task, const char* path, void (*callback)(tf_task_t* task, const char* path, int result, const uv_stat_t* stat, void* user_data), void* user_data);
|
||||
|
||||
/**
|
||||
** Asynchronously read a file's contents.
|
||||
** @param task The running task.
|
||||
** @param path The path to the file.
|
||||
** @param callback A callback that will be called with the file contents.
|
||||
** @param user_data User data that will be provided to the callback.
|
||||
*/
|
||||
void tf_file_read(tf_task_t* task, const char* path, void (*callback)(tf_task_t* task, const char* path, int result, const void* data, void* user_data), void* user_data);
|
||||
|
||||
/** @} */
|
||||
|
Reference in New Issue
Block a user