int sourcesfd;
};
-static int pakfire_stripper_open_sources(struct pakfire_stripper* self) {
+static int pakfire_stripper_open_sources(pakfire_stripper* self) {
// Open the source directory
self->sourcesfd = pakfire_openat(self->pakfire, BUILD_SRC_DIR, O_DIRECTORY|O_PATH);
if (self->sourcesfd < 0) {
return 0;
}
-int pakfire_stripper_create(struct pakfire_stripper** stripper,
+int pakfire_stripper_create(pakfire_stripper** stripper,
struct pakfire* pakfire, pakfire_jail* jail, const char* path) {
- struct pakfire_stripper* self = NULL;
+ pakfire_stripper* self = NULL;
int r;
// Allocate a new object
return r;
}
-static void pakfire_stripper_free(struct pakfire_stripper* self) {
+static void pakfire_stripper_free(pakfire_stripper* self) {
if (self->sources)
pakfire_filelist_unref(self->sources);
if (self->sourcesfd)
free(self);
}
-struct pakfire_stripper* pakfire_stripper_ref(struct pakfire_stripper* self) {
+pakfire_stripper* pakfire_stripper_ref(pakfire_stripper* self) {
++self->nrefs;
return self;
}
-struct pakfire_stripper* pakfire_stripper_unref(struct pakfire_stripper* self) {
+pakfire_stripper* pakfire_stripper_unref(pakfire_stripper* self) {
if (--self->nrefs > 0)
return self;
static int pakfire_stripper_find_elf(
pakfire_ctx* ctx, pakfire_file* file, void* data) {
- struct pakfire_stripper* self = data;
+ pakfire_stripper* self = data;
int r;
// Never try to strip any firmware
/*
Scan all files in path and identify ELF files
*/
-static int pakfire_stripper_scan(struct pakfire_stripper* self) {
+static int pakfire_stripper_scan(pakfire_stripper* self) {
pakfire_filelist* filelist = NULL;
int r;
static int pakfire_stripper_collect_sources(
pakfire_ctx* ctx, pakfire_elf* elf, const char* filename, void* data) {
- struct pakfire_stripper* self = data;
+ pakfire_stripper* self = data;
pakfire_file* file = NULL;
int r;
static int pakfire_stripper_copy_sources(
pakfire_ctx* ctx, pakfire_file* file, void* data) {
- struct pakfire_stripper* self = data;
+ pakfire_stripper* self = data;
struct stat st = {};
char p[PATH_MAX];
FILE* dst = NULL;
#define pakfire_stripper_debug_path(stripper, s, filename, build_id) \
__pakfire_stripper_debug_path(stripper, s, sizeof(s), filename, build_id)
-static int __pakfire_stripper_debug_path(struct pakfire_stripper* self,
+static int __pakfire_stripper_debug_path(pakfire_stripper* self,
char* buffer, size_t length, pakfire_file* file, const char* build_id) {
char debugpath[PATH_MAX];
int r;
return __pakfire_string_format(buffer, length, "%s/%s.debug", debugpath, path);
}
-static int pakfire_stripper_extract_debuginfo(struct pakfire_stripper* self,
+static int pakfire_stripper_extract_debuginfo(pakfire_stripper* self,
pakfire_file* file, pakfire_elf* elf, const char* build_id_path) {
int r;
return 0;
}
-static int pakfire_stripper_strip_debuginfo(struct pakfire_stripper* self,
+static int pakfire_stripper_strip_debuginfo(pakfire_stripper* self,
pakfire_file* file, pakfire_elf* elf) {
char debugpath[PATH_MAX];
char tmppath[PATH_MAX] = "";
static int pakfire_stripper_strip(
pakfire_ctx* ctx, pakfire_file* file, void* data) {
- struct pakfire_stripper* self = data;
+ pakfire_stripper* self = data;
pakfire_elf* elf = NULL;
int r;
return r;
}
-int pakfire_stripper_run(struct pakfire_stripper* self) {
+int pakfire_stripper_run(pakfire_stripper* self) {
int r;
// Scan for all ELF files in path
#define BUILD_SRC_DIR "/build/source"
#define DEBUG_SRC_DIR "/usr/src/debug"
-struct pakfire_stripper;
+typedef struct pakfire_stripper pakfire_stripper;
#include <pakfire/jail.h>
#include <pakfire/pakfire.h>
-int pakfire_stripper_create(struct pakfire_stripper** stripper,
+int pakfire_stripper_create(pakfire_stripper** stripper,
struct pakfire* pakfire, pakfire_jail* jail, const char* path);
-struct pakfire_stripper* pakfire_stripper_ref(struct pakfire_stripper* self);
-struct pakfire_stripper* pakfire_stripper_unref(struct pakfire_stripper* self);
+pakfire_stripper* pakfire_stripper_ref(pakfire_stripper* self);
+pakfire_stripper* pakfire_stripper_unref(pakfire_stripper* self);
-int pakfire_stripper_run(struct pakfire_stripper* self);
+int pakfire_stripper_run(pakfire_stripper* self);
#endif /* PAKFIRE_STRIPPER_H */