34 lines
483 B
C
34 lines
483 B
C
|
|
/*
|
||
|
|
* Copyright (c) 2026 Mirocom Laboratories and MSP engineers.
|
||
|
|
* All Rights Reserved.
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include <stdint.h>
|
||
|
|
#include <stddef.h>
|
||
|
|
#include <errno.h>
|
||
|
|
#include "mvm/rom.h"
|
||
|
|
|
||
|
|
int
|
||
|
|
mvm_rom_init(struct mvm_rom *rom, size_t cap)
|
||
|
|
{
|
||
|
|
if (rom == NULL) {
|
||
|
|
return -1;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (balloon_init(&rom->data, cap) < 0) {
|
||
|
|
return -1;
|
||
|
|
}
|
||
|
|
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
void
|
||
|
|
mvm_rom_free(struct mvm_rom *rom)
|
||
|
|
{
|
||
|
|
if (rom == NULL) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
balloon_free(&rom->data);
|
||
|
|
}
|