Naming convention for header includes

pull/1318/head
nightwalker-87 2023-05-03 14:02:26 +02:00
rodzic 5621d541d9
commit b1c4de647c
29 zmienionych plików z 87 dodań i 87 usunięć

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef BACKEND_H_
#define BACKEND_H_
#ifndef BACKEND_H
#define BACKEND_H
typedef struct _stlink_backend {
void (*close) (stlink_t * sl);
@ -34,4 +34,4 @@
int (*trace_read) (stlink_t * sl, uint8_t* buf, size_t size);
} stlink_backend_t;
#endif // BACKEND_H_
#endif // BACKEND_H

Wyświetl plik

@ -6,8 +6,8 @@
* regardless of how the backend does the work....
*/
#ifndef STLINK_H_
#define STLINK_H_
#ifndef STLINK_H
#define STLINK_H
#include <stdint.h>
#include <stddef.h>
@ -311,4 +311,4 @@ int stlink_target_connect(stlink_t *sl, enum connect_type connect);
}
#endif
#endif // STLINK_H_
#endif // STLINK_H

Wyświetl plik

@ -4,8 +4,8 @@
* STM32-specific defines & identification parametres
*/
#ifndef STM32_H_
#define STM32_H_
#ifndef STM32_H
#define STM32_H
/* STM32 Cortex-M core ids (CPUTAPID) */
enum stm32_core_id {
@ -217,4 +217,4 @@ enum stm32_chipids {
#define STM32L5_PWR_CR1 0x40007000 // RM0438, p. 93,324
#define STM32L5_PWR_CR1_VOS 9
#endif // STM32_H_
#endif // STM32_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef STM32FLASH_H_
#define STM32FLASH_H_
#ifndef STM32FLASH_H
#define STM32FLASH_H
/* STM32Fx FPEC flash controller interface, PM0063 manual */
// STM32F05x is identical, based on RM0091 (DM00031936, Doc ID 018940 Rev.2, Aug 2012)
@ -408,4 +408,4 @@
#define FLASH_WB_SR_PGAERR (5) /* Programming error */
#define FLASH_WB_SR_BSY (16) /* Busy */
#endif // STM32FLASH_H_
#endif // STM32FLASH_H

Wyświetl plik

@ -1,9 +1,9 @@
#ifndef VERSION_H_
#define VERSION_H_
#ifndef VERSION_H
#define VERSION_H
#define STLINK_VERSION "@PROJECT_VERSION@"
#define STLINK_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define STLINK_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define STLINK_VERSION_PATCH @PROJECT_VERSION_PATCH@
#endif // VERSION_H_
#endif // VERSION_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef FLASH_H_
#define FLASH_H_
#ifndef FLASH_H
#define FLASH_H
#include <stdint.h>
@ -33,4 +33,4 @@ struct flash_opts {
int flash_get_opts(struct flash_opts* o, int ac, char** av);
#endif // FLASH_H_
#endif // FLASH_H

Wyświetl plik

@ -1,8 +1,8 @@
#ifndef GDB_REMOTE_H_
#define GDB_REMOTE_H_
#ifndef GDB_REMOTE_H
#define GDB_REMOTE_H
int gdb_send_packet(int fd, char* data);
int gdb_recv_packet(int fd, char** buffer);
int gdb_check_for_interrupt(int fd);
#endif // GDB_REMOTE_H_
#endif // GDB_REMOTE_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef GDB_SERVER_H_
#define GDB_SERVER_H_
#ifndef GDB_SERVER_H
#define GDB_SERVER_H
#define STRINGIFY_inner(name) #name
#define STRINGIFY(name) STRINGIFY_inner(name)
@ -8,4 +8,4 @@
#define DEBUG_LOGGING_LEVEL 100
#define DEFAULT_GDB_LISTEN_PORT 4242
#endif // GDB_SERVER_H_
#endif // GDB_SERVER_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef SEMIHOSTING_H_
#define SEMIHOSTING_H_
#ifndef SEMIHOSTING_H
#define SEMIHOSTING_H
#include <stlink.h>
@ -31,4 +31,4 @@
int do_semihosting(stlink_t *sl, uint32_t r0, uint32_t r1, uint32_t *ret);
#endif // SEMIHOSTING_H_
#endif // SEMIHOSTING_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef GUI_H_
#define GUI_H_
#ifndef GUI_H
#define GUI_H
#include <glib-object.h>
@ -89,4 +89,4 @@ struct _STlinkGUIClass {
GType stlink_gui_get_type(void);
int export_to_file(const char*filename, const struct mem_t flash_mem);
#endif // GUI_H_
#endif // GUI_H

Wyświetl plik

@ -4,12 +4,12 @@
* Calculation of sector numbers and pages
*/
#ifndef CALCULATE_H_
#define CALCULATE_H_
#ifndef CALCULATE_H
#define CALCULATE_H
uint32_t calculate_F4_sectornum(uint32_t);
uint32_t calculate_F7_sectornum(uint32_t);
uint32_t calculate_H7_sectornum(stlink_t *, uint32_t, unsigned);
uint32_t calculate_L4_page(stlink_t *, uint32_t);
#endif // CALCULATE_H_
#endif // CALCULATE_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef CHIPID_H_
#define CHIPID_H_
#ifndef CHIPID_H
#define CHIPID_H
#include <stm32.h>
#include <stlink.h>
@ -24,4 +24,4 @@ struct stlink_chipid_params {
struct stlink_chipid_params *stlink_chipid_get_params(uint32_t chipid);
void init_chipids(char *dir_to_scan);
#endif // CHIPID_H_
#endif // CHIPID_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef COMMANDS_H_
#define COMMANDS_H_
#ifndef COMMANDS_H
#define COMMANDS_H
enum stlink_commands {
STLINK_GET_VERSION = 0xF1,
@ -54,4 +54,4 @@ enum stlink_dfu_commands {
STLINK_DFU_EXIT = 0x07
};
#endif // COMMANDS_H_
#endif // COMMANDS_H

Wyświetl plik

@ -4,12 +4,12 @@
* General helper functions
*/
#ifndef COMMON_H_
#define COMMON_H_
#ifndef COMMON_H
#define COMMON_H
int check_file(stlink_t *, mapped_file_t *, stm32_addr_t);
void md5_calculate(mapped_file_t *);
void stlink_checksum(mapped_file_t *);
void stlink_fwrite_finalize(stlink_t *, stm32_addr_t);
#endif // COMMON_H_
#endif // COMMON_H

Wyświetl plik

@ -4,8 +4,8 @@
* Flash operations
*/
#ifndef COMMON_FLASH_H_
#define COMMON_FLASH_H_
#ifndef COMMON_FLASH_H
#define COMMON_FLASH_H
void lock_flash(stlink_t *);
void clear_flash_error(stlink_t *);
@ -25,4 +25,4 @@ void clear_flash_cr_pg(stlink_t *, unsigned);
uint32_t read_flash_cr(stlink_t *, unsigned);
uint32_t get_stm32l0_flash_base(stlink_t *);
#endif // COMMON_FLASH_H_
#endif // COMMON_FLASH_H

Wyświetl plik

@ -4,8 +4,8 @@
* Flash loader
*/
#ifndef FLASH_LOADER_H_
#define FLASH_LOADER_H_
#ifndef FLASH_LOADER_H
#define FLASH_LOADER_H
#include <stdio.h>
#include <stdint.h>
@ -21,4 +21,4 @@ int stlink_flashloader_start(stlink_t *sl, flash_loader_t *fl);
int stlink_flashloader_write(stlink_t *sl, flash_loader_t *fl, stm32_addr_t addr, uint8_t* base, uint32_t len);
int stlink_flashloader_stop(stlink_t *sl, flash_loader_t *fl);
#endif // FLASH_LOADER_H_
#endif // FLASH_LOADER_H

Wyświetl plik

@ -1,8 +1,8 @@
#ifndef HELPER_H_
#define HELPER_H_
#ifndef HELPER_H
#define HELPER_H
unsigned time_ms();
int arg_parse_freq(const char *str);
#endif // HELPER_H_
#endif // HELPER_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef LIBUSB_SETTINGS_H_
#define LIBUSB_SETTINGS_H_
#ifndef LIBUSB_SETTINGS_H
#define LIBUSB_SETTINGS_H
#include <libusb.h>
@ -44,4 +44,4 @@
#error unsupported libusb version
#endif
#endif // LIBUSB_SETTINGS_H_
#endif // LIBUSB_SETTINGS_H

Wyświetl plik

@ -2,8 +2,8 @@
* Ugly, low performance, configurable level, logging "framework"
*/
#ifndef LOGGING_H_
#define LOGGING_H_
#ifndef LOGGING_H
#define LOGGING_H
#ifdef __cplusplus
extern "C" {
@ -45,4 +45,4 @@ int ugly_libusb_log_level(enum ugly_loglevel v);
}
#endif
#endif // LOGGING_H_
#endif // LOGGING_H

Wyświetl plik

@ -4,8 +4,8 @@
* File mapping
*/
#ifndef MAP_FILE_H_
#define MAP_FILE_H_
#ifndef MAP_FILE_H
#define MAP_FILE_H
#ifndef O_BINARY
#define O_BINARY 0
@ -29,4 +29,4 @@ typedef struct mapped_file {
int map_file(mapped_file_t *, const char *);
void unmap_file(mapped_file_t *);
#endif // MAP_FILE_H_
#endif // MAP_FILE_H

Wyświetl plik

@ -11,8 +11,8 @@
* MD5 hash function
*/
#ifndef MD5_H_
#define MD5_H_
#ifndef MD5_H
#define MD5_H
#pragma once
@ -71,4 +71,4 @@ void Md5Finalise(Md5Context* Context /* [in out] */, MD5_HASH* Digest /* [in] */
*/
void Md5Calculate(void const* Buffer /* [in] */, uint32_t BufferSize /* [in] */, MD5_HASH* Digest /* [in] */);
#endif // MD5_H_
#endif // MD5_H

Wyświetl plik

@ -4,8 +4,8 @@
* Read and write option bytes and option control registers
*/
#ifndef OPTION_BYTES_H_
#define OPTION_BYTES_H_
#ifndef OPTION_BYTES_H
#define OPTION_BYTES_H
#include <stdio.h>
#include <stlink.h>
@ -23,4 +23,4 @@ int stlink_write_option_control_register1_32(stlink_t *sl, uint32_t option_cr1);
int stlink_write_option_bytes(stlink_t *sl, stm32_addr_t addr, uint8_t* base, uint32_t len);
int stlink_fwrite_option_bytes(stlink_t *sl, const char* path, stm32_addr_t addr);
#endif // OPTION_BYTES_H_
#endif // OPTION_BYTES_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef REG_H_
#define REG_H_
#ifndef REG_H
#define REG_H
#define STLINK_REG_CM3_CPUID 0xE000ED00
@ -123,4 +123,4 @@
#define STLINK_REG_CM7_ICIALLU 0xE000EF50
#define STLINK_REG_CM7_CCSIDR 0xE000ED80
#endif // REG_H_
#endif // REG_H

Wyświetl plik

@ -3,8 +3,8 @@
* Author: karl
*/
#ifndef SG_H_
#define SG_H_
#ifndef SG_H
#define SG_H
#include <stlink.h>
#include <libusb_settings.h>
@ -56,4 +56,4 @@ struct stlink_libsg {
stlink_t* stlink_v1_open(const int verbose, int reset);
#endif // SG_H_
#endif // SG_H

Wyświetl plik

@ -3,8 +3,8 @@
* Author: karl
*/
#ifndef USB_H_
#define USB_H_
#ifndef USB_H
#define USB_H
#include <stdbool.h>
@ -70,4 +70,4 @@ stlink_t *stlink_open_usb(enum ugly_loglevel verbose, enum connect_type connect,
size_t stlink_probe_usb(stlink_t **stdevs[], enum connect_type connect, int freq);
void stlink_probe_usb_free(stlink_t **stdevs[], size_t size);
#endif // USB_H_
#endif // USB_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef GETOPT_H_
#define GETOPT_H_
#ifndef GETOPT_H
#define GETOPT_H
#if defined(__cplusplus)
extern "C" {
@ -38,4 +38,4 @@ int getopt_long(int argc,
}
#endif
#endif // GETOPT_H_
#endif // GETOPT_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef MMAP_H_
#define MMAP_H_
#ifndef MMAP_H
#define MMAP_H
#ifdef STLINK_HAVE_SYS_MMAN_H
#include <sys/mman.h>
@ -18,4 +18,4 @@ int munmap(void *addr, size_t len);
#endif // STLINK_HAVE_SYS_MMAN_H
#endif // MMAP_H_
#endif // MMAP_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef SYS_TIME_H_
#define SYS_TIME_H_
#ifndef SYS_TIME_H
#define SYS_TIME_H
#ifdef STLINK_HAVE_SYS_TIME_H
@ -18,4 +18,4 @@ int gettimeofday(struct timeval *tv, struct timezone *tz);
#endif // STLINK_HAVE_SYS_TIME_H
#endif // SYS_TIME_H_
#endif // SYS_TIME_H

Wyświetl plik

@ -1,5 +1,5 @@
#ifndef UNISTD_H_
#define UNISTD_H_
#ifndef UNISTD_H
#define UNISTD_H
/*
* This file intended to serve as a drop-in replacement for unistd.h on Windows
@ -72,4 +72,4 @@ typedef unsigned __int64 uint64_t;
int usleep(unsigned int waitTime);
#endif
#endif // UNISTD_H_
#endif // UNISTD_H