Skip to content

Commit

Permalink
Remove _t from structure definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Nov 3, 2018
1 parent 7e3ce9c commit 68c9882
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 140 deletions.
154 changes: 77 additions & 77 deletions src/include/esp/esp_mem.h
@@ -1,77 +1,77 @@
/**
* \file esp_mem.h
* \brief Memory manager
*/

/*
* Copyright (c) 2018 Tilen Majerle
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* This file is part of ESP-AT library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
*/
#ifndef __ESP_MEM_H
#define __ESP_MEM_H

/* C++ detection */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include "esp/esp.h"

/**
* \ingroup ESP
* \defgroup ESP_MEM Memory manager
* \brief Dynamic memory manager
* \{
*/

/**
* \brief Single memory region descriptor
*/
typedef struct esp_mem_region {
void* start_addr; /*!< Start address of region */
size_t size; /*!< Size in units of bytes of region */
} esp_mem_region_t;

void* esp_mem_alloc(uint32_t size);
void* esp_mem_realloc(void* ptr, size_t size);
void* esp_mem_calloc(size_t num, size_t size);
void esp_mem_free(void* ptr);
size_t esp_mem_getfree(void);
size_t esp_mem_getfull(void);
size_t esp_mem_getminfree(void);

uint8_t esp_mem_assignmemory(const esp_mem_region_t* regions, size_t size);

/**
* \}
*/

/* C++ detection */
#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __ESP_MEM_H */
/**
* \file esp_mem.h
* \brief Memory manager
*/

/*
* Copyright (c) 2018 Tilen Majerle
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* This file is part of ESP-AT library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
*/
#ifndef __ESP_MEM_H
#define __ESP_MEM_H

/* C++ detection */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include "esp/esp.h"

/**
* \ingroup ESP
* \defgroup ESP_MEM Memory manager
* \brief Dynamic memory manager
* \{
*/

/**
* \brief Single memory region descriptor
*/
typedef struct {
void* start_addr; /*!< Start address of region */
size_t size; /*!< Size in units of bytes of region */
} esp_mem_region_t;

void* esp_mem_alloc(uint32_t size);
void* esp_mem_realloc(void* ptr, size_t size);
void* esp_mem_calloc(size_t num, size_t size);
void esp_mem_free(void* ptr);
size_t esp_mem_getfree(void);
size_t esp_mem_getfull(void);
size_t esp_mem_getminfree(void);

uint8_t esp_mem_assignmemory(const esp_mem_region_t* regions, size_t size);

/**
* \}
*/

/* C++ detection */
#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __ESP_MEM_H */
3 changes: 2 additions & 1 deletion src/include/esp/esp_private.h
Expand Up @@ -464,9 +464,10 @@ typedef struct {
} esp_t;

/**
* \ingroup ESP_UNICODE
* \brief Unicode support structure
*/
typedef struct esp_unicode_t {
typedef struct {
uint8_t ch[4]; /*!< UTF-8 max characters */
uint8_t t; /*!< Total expected length in UTF-8 sequence */
uint8_t r; /*!< Remaining bytes in UTF-8 sequence */
Expand Down
2 changes: 1 addition & 1 deletion src/include/esp/esp_typedefs.h
Expand Up @@ -419,7 +419,7 @@ typedef struct esp_timeout {
* \ingroup ESP_BUFF
* \brief Buffer structure
*/
typedef struct esp_buff {
typedef struct {
size_t size; /*!< Size of buffer in units of bytes */
size_t in; /*!< Input pointer to save next value */
size_t out; /*!< Output pointer to read next value */
Expand Down
122 changes: 61 additions & 61 deletions src/include/esp/esp_unicode.h
@@ -1,61 +1,61 @@
/**
* \file esp_unicode.h
* \brief Unicode support
*/

/*
* Copyright (c) 2018 Tilen Majerle
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* This file is part of ESP-AT library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
*/
#ifndef __ESP_UNICODE_H
#define __ESP_UNICODE_H

/* C++ detection */
#ifdef __cplusplus
extern "C" {
#endif

#include "esp/esp.h"

/**
* \ingroup ESP
* \defgroup ESP_UNICODE Unicode support
* \brief Unicode manager
* \{
*/

espr_t espi_unicode_decode(esp_unicode_t* uni, uint8_t ch);

/**
* \}
*/

/* C++ detection */
#ifdef __cplusplus
}
#endif

#endif /* __ESP_UNICODE_H */
/**
* \file esp_unicode.h
* \brief Unicode support
*/

/*
* Copyright (c) 2018 Tilen Majerle
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* This file is part of ESP-AT library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
*/
#ifndef __ESP_UNICODE_H
#define __ESP_UNICODE_H

/* C++ detection */
#ifdef __cplusplus
extern "C" {
#endif

#include "esp/esp.h"

/**
* \ingroup ESP
* \defgroup ESP_UNICODE Unicode manager
* \brief Unicode support manager
* \{
*/

espr_t espi_unicode_decode(esp_unicode_t* uni, uint8_t ch);

/**
* \}
*/

/* C++ detection */
#ifdef __cplusplus
}
#endif

#endif /* __ESP_UNICODE_H */

0 comments on commit 68c9882

Please sign in to comment.