mastrust-ls-lib 0.1.0

mastrust language server library for rust
Documentation
/**
 * @file mastrust.h
 * @author Kevin Alexander Krefting
 * @date 2024-02-20
 * @version 0.1
 * @brief Token Struct
 * @brief BufferFile Struct
 * @brief Tokenizer
*/
#ifndef TOKEN_H
#define TOKEN_H

/**
 * Header Files,
 * very Important
 * for many Actions
 * in this header File
*/
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

/**
 * @brief Token struct
 * @param type The type of the token
 * @param value value The value of the token
 * @param string the Token as String.
 * @param length The length of the token
*/
typedef struct CToken {
    char* type;
    uint8_t *value;
    char *string;
    uint8_t *length;
} CToken;

/**
 * @brief BufferFile struct
 * @param path The File Path
 * @param buffer The Buffer
 * @param mode The File mode
 * @param size The File Size
 * @param bytes The String as Byte
 * @param string The String
*/
typedef struct CBufferFile {
    char* path;
    uint8_t *buffer;
    char *mode;
    uint32_t size;
    uint16_t *bytes;
    char *string;
} CBufferFile;

// Now we define The Functions, but not an Implementation, this follow the mastrust.c file
void ctoken_init(CToken *token, char *string); // For initial the Class
void ctoken_tokenize(CToken *token); // For tokenize the String
uint8_t* ctoken_get_token(CToken *token); // For get the TOken, (The Value Variable is the Token)
char* ctoken_get_string(CToken *token); // Get the Input String
char* ctoken_get_type(CToken *token); // Get the Type
uint8_t ctoken_get_size(CToken *token); // Get the size


#endif