mirror of
https://github.com/pine64/blisp.git
synced 2025-03-13 10:28:57 +00:00
Generic bin parser
This commit is contained in:
parent
cf00bedeaf
commit
9893a49376
@ -0,0 +1,15 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "parse_file.h"
|
||||||
|
|
||||||
|
int bin_file_parse(const char* file_path_on_disk,
|
||||||
|
uint8_t** payload,
|
||||||
|
size_t* payload_length,
|
||||||
|
size_t* payload_address) {
|
||||||
|
// Bin files a dumb so we cant do any fancy logic
|
||||||
|
*payload_address = 0; // We cant know otherwise
|
||||||
|
ssize_t len = get_file_contents(file_path_on_disk, payload);
|
||||||
|
if (len > 0) {
|
||||||
|
*payload_length = len;
|
||||||
|
}
|
||||||
|
return len;
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user