Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
util.h@1:a4c87bc5b008, 2012-11-29 (annotated)
- Committer:
- greletj
- Date:
- Thu Nov 29 22:45:41 2012 +0000
- Revision:
- 1:a4c87bc5b008
- Parent:
- 0:b3a2e39a13ad
- Child:
- 3:27019c77bf90
add MIT License and date revision
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| greletj | 1:a4c87bc5b008 | 1 | /* Copyright (c) <2012> <copyright J. Grelet>, MIT License |
| greletj | 1:a4c87bc5b008 | 2 | * |
| greletj | 1:a4c87bc5b008 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
| greletj | 1:a4c87bc5b008 | 4 | * and associated documentation files (the "Software"), to deal in the Software without restriction, |
| greletj | 1:a4c87bc5b008 | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
| greletj | 1:a4c87bc5b008 | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
| greletj | 1:a4c87bc5b008 | 7 | * furnished to do so, subject to the following conditions: |
| greletj | 1:a4c87bc5b008 | 8 | * |
| greletj | 1:a4c87bc5b008 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
| greletj | 1:a4c87bc5b008 | 10 | * substantial portions of the Software. |
| greletj | 1:a4c87bc5b008 | 11 | * |
| greletj | 1:a4c87bc5b008 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
| greletj | 1:a4c87bc5b008 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| greletj | 1:a4c87bc5b008 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| greletj | 1:a4c87bc5b008 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| greletj | 1:a4c87bc5b008 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| greletj | 1:a4c87bc5b008 | 17 | */ |
| greletj | 1:a4c87bc5b008 | 18 | |
| greletj | 1:a4c87bc5b008 | 19 | /* anciennement sys.h */ |
| greletj | 0:b3a2e39a13ad | 20 | |
| greletj | 0:b3a2e39a13ad | 21 | // typedef void procedure; |
| greletj | 0:b3a2e39a13ad | 22 | // typedef unsigned char booleen; |
| greletj | 0:b3a2e39a13ad | 23 | typedef void *pointeur; |
| greletj | 0:b3a2e39a13ad | 24 | |
| greletj | 0:b3a2e39a13ad | 25 | #ifndef FALSE |
| greletj | 0:b3a2e39a13ad | 26 | # define FALSE 0 |
| greletj | 0:b3a2e39a13ad | 27 | #endif |
| greletj | 0:b3a2e39a13ad | 28 | #ifndef TRUE |
| greletj | 0:b3a2e39a13ad | 29 | # define TRUE 1 |
| greletj | 0:b3a2e39a13ad | 30 | #endif |
| greletj | 0:b3a2e39a13ad | 31 | |
| greletj | 0:b3a2e39a13ad | 32 | #define ALLOUE( nb,type ) (type *) calloc( nb,sizeof( type ) ) |
| greletj | 0:b3a2e39a13ad | 33 | #define LIBERE( var ) if( var ) free( (void *) var ) |
| greletj | 0:b3a2e39a13ad | 34 | |
| greletj | 0:b3a2e39a13ad | 35 | #define FARALLOUE( nb,type ) (type *) calloc( nb, sizeof( type ) ) |
| greletj | 0:b3a2e39a13ad | 36 | #define FARLIBERE( var ) if( var ) free( (void *) var ) |
| greletj | 0:b3a2e39a13ad | 37 | |
| greletj | 0:b3a2e39a13ad | 38 | /* util.h */ |
| greletj | 0:b3a2e39a13ad | 39 | |
| greletj | 0:b3a2e39a13ad | 40 | typedef char STRING[ 41 ]; |
| greletj | 0:b3a2e39a13ad | 41 | #define MAX_CHAR_POOL 4096 /* 4Ko de chaines */ |
| greletj | 0:b3a2e39a13ad | 42 | |
| greletj | 0:b3a2e39a13ad | 43 | |
| greletj | 0:b3a2e39a13ad | 44 | double convert_position( double data ); |
| greletj | 0:b3a2e39a13ad | 45 | double temps( unsigned jour_julien, double heure ); |
| greletj | 0:b3a2e39a13ad | 46 | |
| greletj | 0:b3a2e39a13ad | 47 | |
| greletj | 0:b3a2e39a13ad | 48 | STRING *gen_str( unsigned taille /*= 80*/ ); |
| greletj | 0:b3a2e39a13ad | 49 |