fix: Add extern C wrapping on library headers

This commit is contained in:
Rachel 2024-12-31 19:43:52 -08:00
parent 2109b614e5
commit a54c3bcf02
13 changed files with 104 additions and 0 deletions

View File

@ -16,6 +16,10 @@
#ifndef NARC_API_CHECK_H
#define NARC_API_CHECK_H
#ifdef __cplusplus
extern "C" {
#endif
#include <defs/error.h>
#include <defs/narc.h>
#include <defs/vfs.h>
@ -86,4 +90,8 @@ enum narc_error narc_check_fntb(const unsigned char vfs[], uint32_t *out_size);
*/
enum narc_error narc_check_fimg(const unsigned char vfs[], uint32_t *out_size);
#ifdef __cplusplus
}
#endif
#endif // NARC_API_CHECK_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_API_DUMP_H
#define NARC_API_DUMP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <defs/error.h>
#include <defs/narc.h>
#include <defs/vfs.h>
@ -28,4 +32,8 @@
*/
enum narc_error narc_dump(const struct narc *narc, const struct vfs_ctx *vfs_ctx, const char *dst_dir);
#ifdef __cplusplus
}
#endif
#endif // NARC_API_DUMP_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_API_ERROR_H
#define NARC_API_ERROR_H
#ifdef __cplusplus
extern "C" {
#endif
#include <defs/error.h>
/*
@ -23,4 +27,8 @@
*/
const char *narc_strerror(enum narc_error error);
#ifdef __cplusplus
}
#endif
#endif // NARC_API_ERROR_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_API_FILES_H
#define NARC_API_FILES_H
#ifdef __cplusplus
extern "C" {
#endif
#include <defs/error.h>
#include <defs/narc.h>
#include <defs/vfs.h>
@ -42,4 +46,8 @@ char *narc_files_getext(const char *data);
*/
enum narc_error narc_files_getimg(const struct narc *narc, const struct vfs_ctx *vfs_ctx, const uint16_t file_idx, const unsigned char **out_image, uint32_t *out_size);
#ifdef __cplusplus
}
#endif
#endif // NARC_API_FILES_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_API_LOAD_H
#define NARC_API_LOAD_H
#ifdef __cplusplus
extern "C" {
#endif
#include <defs/error.h>
#include <defs/narc.h>
#include <defs/vfs.h>
@ -31,4 +35,8 @@
*/
enum narc_error narc_load(const char *file_path, struct narc **out_narc, struct vfs_ctx *out_vfs_ctx);
#ifdef __cplusplus
}
#endif
#endif // NARC_API_LOAD_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_API_PACK_H
#define NARC_API_PACK_H
#ifdef __cplusplus
extern "C" {
#endif
#include <defs/error.h>
#include <defs/vfs.h>
@ -46,4 +50,8 @@ void narc_pack_file(struct vfs_pack_ctx *ctx, unsigned char *image, const uint32
*/
struct narc *narc_pack(struct vfs_pack_ctx *ctx);
#ifdef __cplusplus
}
#endif
#endif // NARC_API_PACK_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_DEFS_ERROR_H
#define NARC_DEFS_ERROR_H
#ifdef __cplusplus
extern "C" {
#endif
enum narc_error {
NARCERR_NONE = 0,
@ -41,4 +45,8 @@ enum narc_error {
NARCERR_ERRNO = 0xFF,
};
#ifdef __cplusplus
}
#endif
#endif // NARC_DEFS_ERROR_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_DEFS_FATB_H
#define NARC_DEFS_FATB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define FATB_MAGIC 0x46415442
@ -32,4 +36,8 @@ struct fatb_entry {
uint32_t end;
};
#ifdef __cplusplus
}
#endif
#endif // NARC_DEFS_FATB_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_DEFS_FIMG_H
#define NARC_DEFS_FIMG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define FIMG_MAGIC 0x46494D47
@ -30,4 +34,8 @@ struct fimg {
unsigned char image[];
};
#ifdef __cplusplus
}
#endif
#endif // NARC_DEFS_FIMG_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_DEFS_FNTB_H
#define NARC_DEFS_FNTB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define FNTB_MAGIC 0x464E5442
@ -31,4 +35,8 @@ struct fntb_main_entry {
uint16_t directory;
};
#ifdef __cplusplus
}
#endif
#endif // NARC_DEFS_FNTB_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_DEFS_NARC_H
#define NARC_DEFS_NARC_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define HEADER_MAGIC 0x4352414E
@ -33,4 +37,8 @@ struct narc {
unsigned char vfs[];
};
#ifdef __cplusplus
}
#endif
#endif // NARC_DEFS_NARC_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_DEFS_VFS_H
#define NARC_DEFS_VFS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
struct vfs_ctx {
@ -38,4 +42,8 @@ struct vfs_pack_ctx {
uint32_t size;
};
#ifdef __cplusplus
}
#endif
#endif // NARC_DEFS_VFS_H

View File

@ -16,6 +16,10 @@
#ifndef NARC_H
#define NARC_H
#ifdef __cplusplus
extern "C" {
#endif
#include <api/check.h>
#include <api/dump.h>
#include <api/error.h>
@ -23,4 +27,8 @@
#include <api/load.h>
#include <api/pack.h>
#ifdef __cplusplus
}
#endif
#endif // NARC_H