summaryrefslogblamecommitdiffstats
path: root/H64E-2/h64e-model.h
blob: 3692a26d4426e963d120c2fd929e819d5ff7e604 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                   
                   
                   
                   



                               

                     



                            



                                                                      

                                

                     



                                       







                                                                        
 

 
                         
//
//  h64e-model.h
//  H64E-2
//
//  Created by dianshi on 3/13/20.
//  Copyright © 2020 dianshi. All rights reserved.
//

#ifndef h64e_model_h
#define h64e_model_h

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>

typedef int (*trnf_clb)(char*);

typedef struct H64E_stream_in {
    int32_t cur_size;
    int32_t size;
    uint8_t *buf;
} H64E_stream_in;

//used to get collected data
int h64e_si_init(H64E_stream_in *in, int32_t size);
int h64e_si_data_in(H64E_stream_in *in, uint8_t *data, int32_t size);
int h64e_si_data_out(H64E_stream_in *in, uint8_t *data, int32_t size);
int h64e_si_len(H64E_stream_in *in);

typedef struct H64E_stream_out {
    int32_t cur_size;
    int32_t size;
    uint8_t *buf;
} H64E_stream_out;

//using to collect output formated data
int h64e_so_init(H64E_stream_out *out, int32_t size);
int h64e_so_data_in(H64E_stream_out *out, uint8_t *data, int32_t size);
int h64e_so_data_out(H64E_stream_out *out, uint8_t *data, int32_t size);
/*
 * Trigger that buffer is full, or trigger new line in buffer
 */
int h64e_so_ready(H64E_stream_out *out);
int h64e_so_len(H64E_stream_out *out);



#endif /* h64e_model_h */