ailia  1.5.0.0
Classes | Macros | Typedefs
ailia_call.h File Reference

user-defined callback More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ailiaFileCallback
 

Macros

#define AILIA_USER_API
 
#define AILIA_FSIZE_RETURN_TYPE   long long
 
#define AILIA_USER_API_SUCCESS   (0)
 Successful. More...
 
#define AILIA_USER_API_FAILED   (-1)
 Failed. More...
 
#define AILIA_FILE_CALLBACK_VERSION   (1)
 Struct version. More...
 

Typedefs

typedef void *(AILIA_USER_APIAILIA_USER_API_FOPEN) (const void *)
 Opens a file. More...
 
typedef int(AILIA_USER_APIAILIA_USER_API_FSEEK) (void *, AILIA_FSIZE_RETURN_TYPE)
 It seeks the file specified. More...
 
typedef AILIA_FSIZE_RETURN_TYPE(AILIA_USER_APIAILIA_USER_API_FTELL) (void *)
 Gets the current position in the file. More...
 
typedef AILIA_FSIZE_RETURN_TYPE(AILIA_USER_APIAILIA_USER_API_FSIZE) (void *)
 Gets the size of the file. More...
 
typedef int(AILIA_USER_APIAILIA_USER_API_FREAD) (void *, AILIA_FSIZE_RETURN_TYPE, void *)
 Reads data from the file. More...
 
typedef int(AILIA_USER_APIAILIA_USER_API_FCLOSE) (void *)
 Closes the file. More...
 
typedef struct _ailiaFileCallback ailiaFileCallback
 

Detailed Description

user-defined callback

Date
2021/07/28

The file access callback function is called by a single thread per network instance. If a common callback function is given to multiple instances, the callback function must be thread-safe. Also, do not throw an exception from the callback function, instead use AILIA_USER_API_FAILED to make error notifications.

Macro Definition Documentation

◆ AILIA_FILE_CALLBACK_VERSION

#define AILIA_FILE_CALLBACK_VERSION   (1)

Struct version.

◆ AILIA_FSIZE_RETURN_TYPE

#define AILIA_FSIZE_RETURN_TYPE   long long

◆ AILIA_USER_API

#define AILIA_USER_API

◆ AILIA_USER_API_FAILED

#define AILIA_USER_API_FAILED   (-1)

Failed.

◆ AILIA_USER_API_SUCCESS

#define AILIA_USER_API_SUCCESS   (0)

Successful.

Typedef Documentation

◆ AILIA_USER_API_FCLOSE

typedef int(AILIA_USER_API* AILIA_USER_API_FCLOSE) (void *)

Closes the file.

Parameters
void* A user-defined file pointer
Returns
This function returns AILIA_USER_API_SUCCESS if successful. It returns AILIA_USER_API_FAILED if it fails.

◆ AILIA_USER_API_FOPEN

typedef void*(AILIA_USER_API* AILIA_USER_API_FOPEN) (const void *)

Opens a file.

Parameters
constvoid * fopen_args given to ailiaOpenStreamEx() or ailiaOpenWeightEx
Returns
This function returns a user-defined file pointer if successful. It returns NULL if it fails.

◆ AILIA_USER_API_FREAD

typedef int(AILIA_USER_API* AILIA_USER_API_FREAD) (void *, AILIA_FSIZE_RETURN_TYPE, void *)

Reads data from the file.

Parameters
void* A pointer to the storage location of the data to be read

◆ AILIA_USER_API_FSEEK

typedef int(AILIA_USER_API* AILIA_USER_API_FSEEK) (void *, AILIA_FSIZE_RETURN_TYPE)

It seeks the file specified.

Parameters
void* A user-defined file pointer

◆ AILIA_USER_API_FSIZE

typedef AILIA_FSIZE_RETURN_TYPE(AILIA_USER_API* AILIA_USER_API_FSIZE) (void *)

Gets the size of the file.

Parameters
void* A user-defined file pointer
Returns
This function returns the size of the file in bytes if successful. It returns -1 if it fails.

◆ AILIA_USER_API_FTELL

typedef AILIA_FSIZE_RETURN_TYPE(AILIA_USER_API* AILIA_USER_API_FTELL) (void *)

Gets the current position in the file.

Parameters
void* A user-defined file pointer
Returns
This function returns the position, in bytes, the file pointer points to if successful. It returns -1 if it fails.

◆ ailiaFileCallback