Bartleby 0.1.0
A symbol renaming toolkit
|
Bartleby C API implementation. More...
#include "Bartleby/Bartleby.h"
#include "Bartleby-c/Bartleby.h"
#include "llvm/Object/Binary.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SmallVectorMemoryBuffer.h"
#include <memory>
#include <errno.h>
#include <stdlib.h>
Classes | |
struct | BartlebyHandle |
Definition of the Bartleby handle. More... | |
Functions | |
struct BartlebyHandle * | saq_bartleby_new (void) |
Allocates a new Bartleby handle. | |
void | saq_bartleby_free (struct BartlebyHandle *bh) |
Frees a Bartleby handle. | |
int | saq_bartleby_set_prefix (struct BartlebyHandle *bh, const char *prefix) |
Applies a prefix to all global and defined symbols. | |
int | saq_bartleby_add_binary (struct BartlebyHandle *bh, const void *s, const size_t n) |
Adds a new binary to Bartleby. | |
int | saq_bartleby_build_archive (struct BartlebyHandle *bh, void **s, size_t *n) |
Builds the final archive and writes its content to a buffer. | |
Bartleby C API implementation.
int saq_bartleby_add_binary | ( | struct BartlebyHandle * | bh, |
const void * | s, | ||
const size_t | n | ||
) |
Adds a new binary to Bartleby.
bh | Bartleby handle. |
s | Buffer containing the binary. |
n | Size of bin_src . |
Buffer s
is going to be copied, thus it can be freed after.
int saq_bartleby_build_archive | ( | struct BartlebyHandle * | bh, |
void ** | s, | ||
size_t * | n | ||
) |
Builds the final archive and writes its content to a buffer.
saq_bartleby_free
after calling saq_bartleby_build_archive
.bh | Bartleby handle. | |
[out] | s | Destination buffer. |
[out] | n | Size of s . |
void saq_bartleby_free | ( | struct BartlebyHandle * | bh | ) |
Frees a Bartleby handle.
bh | Bartleby handle to free. A NULL value here is allowed. |
struct BartlebyHandle * saq_bartleby_new | ( | void | ) |
Allocates a new Bartleby handle.
int saq_bartleby_set_prefix | ( | struct BartlebyHandle * | bh, |
const char * | prefix | ||
) |
Applies a prefix to all global and defined symbols.
bh | Bartleby handle. |
prefix | Prefix to apply. |