micropython/extmod
Alexander Steffen 299bc62586 all: Unify header guard usage.
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.

This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.

The rules are as follows.

Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _

In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.

py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
2017-07-18 11:57:39 +10:00
..
crypto-algorithms extmod/crypto-algorithms/sha256: Remove non-standard memory.h header. 2017-04-27 15:01:01 +03:00
lwip-include all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
re1.5 extmod/re1.5: Workaround issue with mingw32-gcc 4.2.1. 2015-11-01 02:39:01 +03:00
uzlib extmod/uzlib: Update to upstream v2.1. 2016-10-11 07:13:23 +03:00
machine_i2c.c extmod/machine_i2c: Add hook to constructor to call port-specific code. 2016-11-24 00:12:51 +11:00
machine_i2c.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_mem.c extmod/machine_mem: Typo fix in comment. 2016-11-21 01:09:17 +03:00
machine_mem.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_pinbase.c extmod/machine_pinbase: Fix nanbox build. 2016-06-19 00:26:57 +03:00
machine_pinbase.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_pulse.c extmod/machine_pulse: Make time_pulse_us() not throw exceptions. 2017-02-05 14:20:17 +03:00
machine_pulse.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_signal.c extmod/machine_signal: Rename "inverted" arg to "invert", it's shorter. 2017-04-15 21:01:47 +03:00
machine_signal.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_spi.c extmod/machine_spi: Remove EVENT_POLL_HOOK from soft-SPI transfer func. 2017-02-06 14:38:33 +11:00
machine_spi.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
misc.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
modbtree.c extmod: Update for changes to mp_obj_str_get_data. 2017-03-29 12:56:45 +11:00
modframebuf.c all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers. 2017-06-15 11:54:41 +10:00
modlwip.c extmod/modlwip: accept: Fix error code for non-blocking mode. 2017-06-04 13:45:37 +03:00
modonewire.c extmmod/modonewire: Rename public module to mp_module_onewire. 2017-06-22 16:17:46 +10:00
modubinascii.c extmod/modubinascii: Add check for empty buffer passed to hexlify. 2017-07-03 14:52:00 +10:00
modubinascii.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
moductypes.c extmod/moductypes: Fix bigint handling for 32-bit ports. 2017-04-21 16:43:21 +03:00
moduhashlib.c all: Remove 'name' member from mp_obj_module_t struct. 2016-09-22 00:23:16 +10:00
moduheapq.c extmod/moduheapq: Revert change for adhoc relative-time queue support. 2016-12-22 06:37:49 +03:00
modujson.c extmod/modujson: Properly initialise temporary StringIO object. 2017-07-05 10:38:20 +10:00
modurandom.c extmod/modurandom: Use mp_raise_ValueError(). 2017-02-24 10:04:23 -05:00
modure.c extmod/modure: If input string is bytes, return bytes results too. 2017-07-01 01:25:45 +03:00
moduselect.c extmod/moduselect: Implement ipoll() method for alloc-free polling. 2017-04-29 13:05:44 +03:00
modussl_axtls.c extmod/modussl_axtls: Implement server_hostname arg to wrap_socket(). 2017-06-14 01:01:12 +03:00
modussl_mbedtls.c extmod: Update for changes to mp_obj_str_get_data. 2017-03-29 12:56:45 +11:00
modutimeq.c modutimeq: Add peektime() function (provisional). 2017-03-29 18:18:35 +03:00
moduzlib.c extmod/moduzlib: decompress: Remove stale "(void)n_args". 2017-06-24 16:36:05 +03:00
modwebrepl.c extmod: Update for changes to mp_obj_str_get_data. 2017-03-29 12:56:45 +11:00
modwebsocket.c various: Spelling fixes 2017-05-29 11:36:05 +03:00
modwebsocket.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
uos_dupterm.c extmod/moduos_dupterm: Renamed to uos_dupterm. 2016-10-26 02:08:37 +03:00
utime_mphal.c py,extmod: Some casts and minor refactors to quiet compiler warnings. 2017-07-07 11:32:22 +10:00
utime_mphal.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
vfs.c extmod/vfs: Allow "buffering" and "encoding" args to VFS's open(). 2017-06-07 15:29:53 +10:00
vfs.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
vfs_fat.c extmod/vfs: Use MP_S_IFDIR, MP_S_IFREG consts instead of magic numbers. 2017-05-10 12:30:34 +10:00
vfs_fat.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
vfs_fat_diskio.c extmod/vfs_fat: Allow to compile with MICROPY_VFS_FAT disabled. 2017-03-13 21:23:31 +11:00
vfs_fat_file.c extmod/vfs_fat: Allow to compile with MICROPY_VFS_FAT disabled. 2017-03-13 21:23:31 +11:00
vfs_fat_misc.c extmod/vfs_fat_misc: Remove dot-dirs filter since FatFS already does it. 2017-05-13 18:58:46 +10:00
vfs_reader.c py: Allow lexer to raise exceptions during construction. 2017-03-14 11:52:05 +11:00
virtpin.c all: Rename mp_obj_type_t::stream_p to protocol. 2016-06-18 18:44:57 +03:00
virtpin.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00