| 1 |
/* do not edit automatically generated by mc from TimeString. */ |
| 2 |
/* TimeString.mod provides time related string manipulation procedures. |
| 3 |
|
| 4 |
Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 5 |
Contributed by Gaius Mulley <[email protected]>. |
| 6 |
|
| 7 |
This file is part of GNU Modula-2. |
| 8 |
|
| 9 |
GNU Modula-2 is free software; you can redistribute it and/or modify |
| 10 |
it under the terms of the GNU General Public License as published by |
| 11 |
the Free Software Foundation; either version 3, or (at your option) |
| 12 |
any later version. |
| 13 |
|
| 14 |
GNU Modula-2 is distributed in the hope that it will be useful, but |
| 15 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 |
General Public License for more details. |
| 18 |
|
| 19 |
Under Section 7 of GPL version 3, you are granted additional |
| 20 |
permissions described in the GCC Runtime Library Exception, version |
| 21 |
3.1, as published by the Free Software Foundation. |
| 22 |
|
| 23 |
You should have received a copy of the GNU General Public License and |
| 24 |
a copy of the GCC Runtime Library Exception along with this program; |
| 25 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 26 |
<http://www.gnu.org/licenses/>. */ |
| 27 |
|
| 28 |
#include "config.h" |
| 29 |
#include "system.h" |
| 30 |
#include <stdbool.h> |
| 31 |
# if !defined (PROC_D) |
| 32 |
# define PROC_D |
| 33 |
typedef void (*PROC_t) (void); |
| 34 |
typedef struct { PROC_t proc; } PROC; |
| 35 |
# endif |
| 36 |
|
| 37 |
#if defined(__cplusplus) |
| 38 |
# undef NULL |
| 39 |
# define NULL 0 |
| 40 |
#endif |
| 41 |
#define _TimeString_C |
| 42 |
|
| 43 |
#include "GTimeString.h" |
| 44 |
# include "Gwrapc.h" |
| 45 |
# include "GASCII.h" |
| 46 |
# include "GSYSTEM.h" |
| 47 |
|
| 48 |
|
| 49 |
/* |
| 50 |
GetTimeString - places the time in ascii format into array, a. |
| 51 |
|
| 52 |
*/ |
| 53 |
|
| 54 |
extern "C" void TimeString_GetTimeString (char *a, unsigned int _a_high); |
| 55 |
|
| 56 |
|
| 57 |
/* |
| 58 |
GetTimeString - places the time in ascii format into array, a. |
| 59 |
|
| 60 |
*/ |
| 61 |
|
| 62 |
extern "C" void TimeString_GetTimeString (char *a, unsigned int _a_high) |
| 63 |
{ |
| 64 |
typedef char *GetTimeString__T1; |
| 65 |
|
| 66 |
GetTimeString__T1 Addr; |
| 67 |
unsigned int i; |
| 68 |
|
| 69 |
Addr = static_cast<GetTimeString__T1> (wrapc_strtime ()); |
| 70 |
i = 0; |
| 71 |
if (Addr != NULL) |
| 72 |
{ |
| 73 |
while ((i < _a_high) && ((*Addr) != ASCII_nul)) |
| 74 |
{ |
| 75 |
const_cast<char *>(a)[i] = (*Addr); |
| 76 |
i += 1; |
| 77 |
Addr += 1; |
| 78 |
} |
| 79 |
} |
| 80 |
if (i < _a_high) |
| 81 |
{ |
| 82 |
const_cast<char *>(a)[i] = ASCII_nul; |
| 83 |
} |
| 84 |
} |
| 85 |
|
| 86 |
extern "C" void _M2_TimeString_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[]) |
| 87 |
{ |
| 88 |
} |
| 89 |
|
| 90 |
extern "C" void _M2_TimeString_fini (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[]) |
| 91 |
{ |
| 92 |
} |