#pragma once

// if wait_timeout_ms < MIN_TIMEOUT, then use DEFAULT_TIMEOUT
#define MIN_TIMEOUT 1000
#define DEFAULT_TIMEOUT 10000
// if wait_timeout_ms == INFINITY_TIMEOUT, then use infinite timeout
#define INFINITE_TIMEOUT 0

#define ADAPTERS_FOLDER "adapters"

#include <stdbool.h>
#include <stddef.h>

#include "FSSMApi.h"

typedef struct FSSMScanner {
    char type[MAX_TYPENAME_LENGTH];
    int ID;
} FSSMScanner;

#ifdef __cplusplus
extern "C" {
#endif

FSSM_API FSSMResult listScanners(FSSMScanner* scanners, size_t* count);
FSSM_API FSSMResult getFingerprint(FSSMScanner scanner, unsigned char* buf, size_t* width, size_t* height,
                                   unsigned int wait_timeout_ms);
FSSM_API FSSMResult getFirstFingerprint(unsigned char* buf, size_t* width, size_t* height,
                                        unsigned int wait_timeout_ms);
FSSM_API FSSMResult cancelScan();
FSSM_API FSSMResult listAdapters(bool all, const char** adapter_names, size_t* count);
FSSM_API FSSMResult isFingerOnScanner(const FSSMScanner* scanner, bool* result);

#ifdef __cplusplus
}
#endif
