Add open() and close() skeletons that only recognize the image as a correct one.

This commit is contained in:
2019-03-17 20:39:40 +00:00
parent 5bd7a5664c
commit 28145013c4
7 changed files with 200 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
//
// Created by claunia on 17/03/19.
//
#ifndef LIBDICFORMAT_CONTEXT_H
#define LIBDICFORMAT_CONTEXT_H
#include <stdint.h>
#include <stdio.h>
typedef struct dicformatContext
{
uint64_t magic;
uint8_t libraryMajorVersion;
uint8_t libraryMinorVersion;
FILE *imageStream;
DicHeader header;
} dicformatContext;
#endif //LIBDICFORMAT_CONTEXT_H

View File

@@ -37,4 +37,9 @@ int identify(const char *filename);
int identifyStream(FILE *imageStream);
void *open(const char *filepath);
int close(void *context)
#endif //LIBDICFORMAT_DECLS_H

View File

@@ -0,0 +1,12 @@
//
// Created by claunia on 17/03/19.
//
#ifndef LIBDICFORMAT_ERRORS_H
#define LIBDICFORMAT_ERRORS_H
#define DICF_ERROR_NOT_DICFORMAT -1
#define DICF_ERROR_FILE_TOO_SMALL -2
#define DICF_ERROR_INCOMPATIBLE_VERSION -2
#endif //LIBDICFORMAT_ERRORS_H