Convert-Binary-C

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
tests/include/pdclib/functions/_tzcode/_PDCLIB_gmtcheck.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_gmtsub.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_increment_overflow.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_init_ttinfo.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_localsub.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_localtime_tzset.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_mktime_tzname.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_timesub.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_tzload.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_tzparse.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_tzset_unlocked.c
tests/include/pdclib/functions/_tzcode/_PDCLIB_update_tzname_etc.c
tests/include/pdclib/functions/_tzcode/Readme.txt
tests/include/pdclib/functions/ctype/isalnum.c
tests/include/pdclib/functions/ctype/isalpha.c
tests/include/pdclib/functions/ctype/isblank.c
tests/include/pdclib/functions/ctype/iscntrl.c
tests/include/pdclib/functions/ctype/isdigit.c
tests/include/pdclib/functions/ctype/isgraph.c
tests/include/pdclib/functions/ctype/islower.c
tests/include/pdclib/functions/ctype/isprint.c

ppport.h  view on Meta::CPAN

2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
get_and_check_backslash_N_name_wrapper|5.029009||Viu
get_ANYOF_cp_list_for_ssc|5.019005||Viu
get_ANYOFM_contents|5.027009||Viu
GETATARGET|5.003007||Viu
get_aux_mg|5.011000||Viu
get_av|5.006000|5.003007|p
getc|5.003007||Viu
get_c_backtrace|5.021001||Vi
get_c_backtrace_dump|5.021001||V
get_context|5.006000|5.006000|nu
getc_unlocked|5.003007||Viu
get_cv|5.006000|5.003007|p
get_cvn_flags|5.009005|5.003007|p
get_cvs|5.011000|5.003007|p
getcwd_sv|5.007002|5.007002|
get_db_sub|||iu
get_debug_opts|5.008001||Viu
get_deprecated_property_msg|5.031011||cVniu
getegid|5.005000||Viu
getenv|5.005000||Viu
getenv_len|5.006000||Viu

ppport.h  view on Meta::CPAN

6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
PERL_MAGIC_vec|5.007002|5.003007|p
PERL_MAGIC_vstring|5.008001|5.003007|p
PERL_MAGIC_VTABLE_MASK|5.015000||Viu
PERL_MALLOC_CTL_H|5.027001||Viu
Perl_malloc_good_size|5.010001||Viu
PERL_MALLOC_WRAP|5.009002|5.009002|Vn
PerlMem_calloc|5.006000||Viu
PerlMem_free|5.005000||Viu
PerlMem_free_lock|5.006000||Viu
PerlMem_get_lock|5.006000||Viu
PerlMem_is_locked|5.006000||Viu
PerlMem_malloc|5.005000||Viu
PERL_MEMORY_DEBUG_HEADER_SIZE|5.019009||Viu
PerlMemParse_calloc|5.006000||Viu
PerlMemParse_free|5.006000||Viu
PerlMemParse_free_lock|5.006000||Viu
PerlMemParse_get_lock|5.006000||Viu
PerlMemParse_is_locked|5.006000||Viu
PerlMemParse_malloc|5.006000||Viu
PerlMemParse_realloc|5.006000||Viu
PerlMem_realloc|5.005000||Viu
PerlMemShared_calloc|5.006000||Viu
PerlMemShared_free|5.006000||Viu
PerlMemShared_free_lock|5.006000||Viu
PerlMemShared_get_lock|5.006000||Viu
PerlMemShared_is_locked|5.006000||Viu
PerlMemShared_malloc|5.006000||Viu
PerlMemShared_realloc|5.006000||Viu
PERL_MG_UFUNC|5.007001||Viu
Perl_modf|5.006000|5.006000|n
PERL_MULTICONCAT_HEADER_SIZE|5.027006||Viu
PERL_MULTICONCAT_IX_LENGTHS|5.027006||Viu
PERL_MULTICONCAT_IX_NARGS|5.027006||Viu
PERL_MULTICONCAT_IX_PLAIN_LEN|5.027006||Viu
PERL_MULTICONCAT_IX_PLAIN_PV|5.027006||Viu
PERL_MULTICONCAT_IX_UTF8_LEN|5.027006||Viu

ppport.h  view on Meta::CPAN

7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
PUSHSTACKi|5.005000||Viu
PUSHSTACK_INIT_HWM|5.027002||Viu
PUSHTARG|5.003007||Viu
PUSHu|5.004000|5.003007|p
PUTBACK|5.003007|5.003007|
putc|5.003007||Viu
put_charclass_bitmap_innards|5.021004||Viu
put_charclass_bitmap_innards_common|5.023008||Viu
put_charclass_bitmap_innards_invlist|5.023008||Viu
put_code_point|5.021004||Viu
putc_unlocked|5.003007||Viu
putenv|5.005000||Viu
put_range|5.019009||Viu
putw|5.003007||Viu
pv_display|5.006000|5.003007|p
pv_escape|5.009004|5.003007|p
pv_pretty|5.009004|5.003007|p
pv_uni_display|5.007003|5.007003|
pWARN_ALL|5.006000||Viu
pWARN_NONE|5.006000||Viu
pWARN_STD|5.006000||Viu

tests/include/pdclib/CMakeLists.txt  view on Meta::CPAN

239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
functions/_tzcode/_PDCLIB_gmtcheck.c
functions/_tzcode/_PDCLIB_gmtsub.c
functions/_tzcode/_PDCLIB_increment_overflow.c
functions/_tzcode/_PDCLIB_init_ttinfo.c
functions/_tzcode/_PDCLIB_localsub.c
functions/_tzcode/_PDCLIB_localtime_tzset.c
functions/_tzcode/_PDCLIB_mktime_tzname.c
functions/_tzcode/_PDCLIB_timesub.c
functions/_tzcode/_PDCLIB_tzload.c
functions/_tzcode/_PDCLIB_tzparse.c
functions/_tzcode/_PDCLIB_tzset_unlocked.c
functions/_tzcode/_PDCLIB_update_tzname_etc.c
 
functions/_PDCLIB/assert.c
functions/_PDCLIB/errno.c
functions/_PDCLIB/_PDCLIB_atomax.c
functions/_PDCLIB/_PDCLIB_bigint.c
functions/_PDCLIB/_PDCLIB_bigint2.c
functions/_PDCLIB/_PDCLIB_bigint10.c
functions/_PDCLIB/_PDCLIB_bigint32.c
functions/_PDCLIB/_PDCLIB_bigint64.c

tests/include/pdclib/functions/_dlmalloc/malloc.c  view on Meta::CPAN

548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
  using already-existing space will be serviced via mmap.  (If enough
  normal freed space already exists it is used instead.)  Using mmap
  segregates relatively large chunks of memory so that they can be
  individually obtained and released from the host system. A request
  serviced through mmap is never reused by any other request (at least
  not directly; the system may just so happen to remap successive
  requests to the same locations).  Segregating space in this way has
  the benefits that: Mmapped space can always be individually released
  back to the system, which helps keep the system level memory demands
  of a long-lived program low.  Also, mapped memory doesn't become
  `locked' between other chunks, as can happen with normally allocated
  chunks, which means that even trimming via malloc_trim would not
  release them.  However, it has the disadvantage that the space
  cannot be reclaimed, consolidated, and then used to service later
  requests, as happens with normal chunks.  The advantages of mmap
  nearly always outweigh disadvantages for "large" chunks, but the
  value of "large" may vary across systems.  The default is an
  empirically derived value that works well in most systems. You can
  disable mmap by setting to MAX_SIZE_T.
 
MAX_RELEASE_CHECK_RATE   default: 4095 unless not HAVE_MMAP

tests/include/pdclib/functions/_dlmalloc/malloc.c  view on Meta::CPAN

1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
/*
  malloc_trim(size_t pad);
 
  If possible, gives memory back to the system (via negative arguments
  to sbrk) if there is unused memory at the `high' end of the malloc
  pool or in unused MMAP segments. You can call this after freeing
  large blocks of memory to potentially reduce the system-level memory
  requirements of a program. However, it cannot guarantee to reduce
  memory. Under some allocation patterns, some large free blocks of
  memory will be locked between two used chunks, so they cannot be
  given back to the system.
 
  The `pad' argument to malloc_trim represents the amount of free
  trailing space to leave untrimmed. If this argument is zero, only
  the minimum amount of memory to maintain internal data structures
  will be left. Non-zero arguments can be supplied to maintain enough
  trailing space to service future expected allocations without having
  to re-obtain memory from the system.
 
  Malloc_trim returns 1 if it actually released any memory, else 0.

tests/include/pdclib/functions/_dlmalloc/malloc.c  view on Meta::CPAN

1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
/*
  mspace is an opaque type representing an independent
  region of space that supports mspace_malloc, etc.
*/
typedef void* mspace;
 
/*
  create_mspace creates and returns a new independent space with the
  given initial capacity, or, if 0, the default granularity size.  It
  returns null if there is no system memory available to create the
  space.  If argument locked is non-zero, the space uses a separate
  lock to control access. The capacity of the space will grow
  dynamically as needed to service mspace_malloc requests.  You can
  control the sizes of incremental increases of this space by
  compiling with a different DEFAULT_GRANULARITY or dynamically
  setting with mallopt(M_GRANULARITY, value).
*/
DLMALLOC_EXPORT mspace create_mspace(size_t capacity, int locked);
 
/*
  destroy_mspace destroys the given space, and attempts to return all
  of its memory back to the system, returning the total number of
  bytes freed. After destruction, the results of access to all memory
  used by the space become undefined.
*/
DLMALLOC_EXPORT size_t destroy_mspace(mspace msp);
 
/*
  create_mspace_with_base uses the memory supplied as the initial base
  of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this
  space is used for bookkeeping, so the capacity must be at least this
  large. (Otherwise 0 is returned.) When this initial space is
  exhausted, additional memory will be obtained from the system.
  Destroying this space will deallocate all additionally allocated
  space (if possible) but not the initial base.
*/
DLMALLOC_EXPORT mspace create_mspace_with_base(void* base, size_t capacity, int locked);
 
/*
  mspace_track_large_chunks controls whether requests for large chunks
  are allocated in their own untracked mmapped regions, separate from
  others in this mspace. By default large chunks are not tracked,
  which reduces fragmentation. However, such chunks are not
  necessarily released to the system upon destroy_mspace.  Enabling
  tracking by setting to true may increase fragmentation, but avoids
  leakage when relying on destroy_mspace to release all memory
  allocated using this space.  The function returns the previous

tests/include/pdclib/functions/_dlmalloc/malloc.c  view on Meta::CPAN

1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
#endif /* solaris or LACKS_SCHED_H */
#if (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0) || !USE_SPIN_LOCKS
#include <pthread.h>
#endif /* USE_RECURSIVE_LOCKS ... */
#elif defined(_MSC_VER)
#ifndef _M_AMD64
/* These are already defined on AMD64 builds */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
LONG __cdecl _InterlockedCompareExchange(LONG volatile *Dest, LONG Exchange, LONG Comp);
LONG __cdecl _InterlockedExchange(LONG volatile *Target, LONG Value);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _M_AMD64 */
#pragma intrinsic (_InterlockedCompareExchange)
#pragma intrinsic (_InterlockedExchange)
#define interlockedcompareexchange _InterlockedCompareExchange
#define interlockedexchange _InterlockedExchange
#elif defined(WIN32) && defined(__GNUC__)
#define interlockedcompareexchange(a, b, c) __sync_val_compare_and_swap(a, c, b)
#define interlockedexchange __sync_lock_test_and_set
#endif /* Win32 */
#else /* USE_LOCKS */
#endif /* USE_LOCKS */
 
#ifndef LOCK_AT_FORK
#define LOCK_AT_FORK 0
#endif
 
/* Declarations for bit scanning on win32 */
#if defined(_MSC_VER) && _MSC_VER>=1300

tests/include/pdclib/functions/_dlmalloc/malloc.c  view on Meta::CPAN

1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
  __asm__ __volatile__ ("lock; xchgl %0, %1"
                        : "=r" (ret)
                        : "m" (*(sl)), "0"(prev)
                        : "memory");
}
 
#define CAS_LOCK(sl)     x86_cas_lock(sl)
#define CLEAR_LOCK(sl)   x86_clear_lock(sl)
 
#else /* Win32 MSC */
#define CAS_LOCK(sl)     interlockedexchange(sl, (LONG)1)
#define CLEAR_LOCK(sl)   interlockedexchange (sl, (LONG)0)
 
#endif /* ... gcc spins locks ... */
 
/* How to yield for a spin lock */
#define SPINS_PER_YIELD       63
#if defined(_MSC_VER)
#define SLEEP_EX_DURATION     50 /* delay for yield/sleep */
#define SPIN_LOCK_YIELD  SleepEx(SLEEP_EX_DURATION, FALSE)
#elif defined (__SVR4) && defined (__sun) /* solaris */
#define SPIN_LOCK_YIELD   thr_yield();

tests/include/pdclib/functions/_dlmalloc/malloc.c  view on Meta::CPAN

2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
static volatile LONG malloc_global_mutex_status;
 
/* Use spin loop to initialize global lock */
static void init_malloc_global_mutex() {
  for (;;) {
    long stat = malloc_global_mutex_status;
    if (stat > 0)
      return;
    /* transition to < 0 while initializing, then to > 0) */
    if (stat == 0 &&
        interlockedcompareexchange(&malloc_global_mutex_status, (LONG)-1, (LONG)0) == 0) {
      InitializeCriticalSection(&malloc_global_mutex);
      interlockedexchange(&malloc_global_mutex_status, (LONG)1);
      return;
    }
    SleepEx(0, FALSE);
  }
}
 
#else /* pthreads-based locks */
#define MLOCK_T               pthread_mutex_t
#define ACQUIRE_LOCK(lk)      pthread_mutex_lock(lk)
#define RELEASE_LOCK(lk)      pthread_mutex_unlock(lk)

tests/include/pdclib/functions/_dlmalloc/malloc.c  view on Meta::CPAN

5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
  m->extp = 0;
  m->exts = 0;
  disable_contiguous(m);
  init_bins(m);
  mn = next_chunk(mem2chunk(m));
  init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE);
  check_top_chunk(m, m->top);
  return m;
}
 
mspace create_mspace(size_t capacity, int locked) {
  mstate m = 0;
  size_t msize;
  ensure_initialization();
  msize = pad_request(sizeof(struct malloc_state));
  if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
    size_t rs = ((capacity == 0)? mparams.granularity :
                 (capacity + TOP_FOOT_SIZE + msize));
    size_t tsize = granularity_align(rs);
    char* tbase = (char*)(CALL_MMAP(tsize));
    if (tbase != CMFAIL) {
      m = init_user_mstate(tbase, tsize);
      m->seg.sflags = USE_MMAP_BIT;
      set_lock(m, locked);
    }
  }
  return (mspace)m;
}
 
mspace create_mspace_with_base(void* base, size_t capacity, int locked) {
  mstate m = 0;
  size_t msize;
  ensure_initialization();
  msize = pad_request(sizeof(struct malloc_state));
  if (capacity > msize + TOP_FOOT_SIZE &&
      capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
    m = init_user_mstate((char*)base, capacity);
    m->seg.sflags = EXTERN_BIT;
    set_lock(m, locked);
  }
  return (mspace)m;
}
 
int mspace_track_large_chunks(mspace msp, int enable) {
  int ret = 0;
  mstate ms = (mstate)msp;
  if (!PREACTION(ms)) {
    if (!use_mmap(ms)) {
      ret = 1;

tests/include/pdclib/functions/_dlmalloc/malloc.c  view on Meta::CPAN

6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
    regions in those cases where they do happen to be contiguous.
* MORECORE need not handle negative arguments -- it may instead
    just return MFAIL when given negative arguments.
    Negative arguments are always multiples of pagesize. MORECORE
    must not misinterpret negative args as large positive unsigned
    args. You can suppress all such calls from even occurring by defining
    MORECORE_CANNOT_TRIM,
 
As an example alternative MORECORE, here is a custom allocator
kindly contributed for pre-OSX macOS.  It uses virtually but not
necessarily physically contiguous non-paged memory (locked in,
present and won't get swapped out).  You can use it by uncommenting
this section, adding some #includes, and setting up the appropriate
defines above:
 
    #define MORECORE osMoreCore
 
There is also a shutdown routine that should somehow be called for
cleanup upon program exit.
 
#define MAX_POOL_ENTRIES 100

tests/include/pdclib/functions/_tzcode/_PDCLIB_localtime_tzset.c  view on Meta::CPAN

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#endif
 
#include <string.h>
 
struct tm * _PDCLIB_localtime_tzset( time_t const * timep, struct tm * tmp, bool setname )
{
    _PDCLIB_LOCK( _PDCLIB_time_mtx );
 
    if ( setname || ! lcl_is_set )
    {
        _PDCLIB_tzset_unlocked();
    }
 
    tmp = _PDCLIB_localsub( &_PDCLIB_lclmem, timep, setname, tmp );
    _PDCLIB_UNLOCK( _PDCLIB_time_mtx );
    return tmp;
}
 
#endif
 
#ifdef TEST

tests/include/pdclib/functions/_tzcode/_PDCLIB_tzset_unlocked.c  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
/* _PDCLIB_tzset_unlocked( void )
 
   This file is part of the Public Domain C Library (PDCLib).
   Permission is granted to use, modify, and / or redistribute at will.
*/
 
#ifndef REGTEST
 
#include "pdclib/_PDCLIB_tzcode.h"
 
#include <stdlib.h>

tests/include/pdclib/functions/_tzcode/_PDCLIB_tzset_unlocked.c  view on Meta::CPAN

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
        if ( 0 < lcl )
        {
            strcpy( lcl_TZname, name );
        }
    }
 
    settzname();
    lcl_is_set = lcl;
}
 
void _PDCLIB_tzset_unlocked( void )
{
    tzsetlcl( getenv( "TZ" ) );
}
 
#endif
 
#ifdef TEST
 
#include "_PDCLIB_test.h"

tests/include/pdclib/functions/stdio/freopen.c  view on Meta::CPAN

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#ifndef __STDC_NO_THREADS__
        if ( mtx_init( &stream->mtx, mtx_plain | mtx_recursive ) != thrd_success )
        {
            /* Could not initialize stream mutex */
            _PDCLIB_UNLOCK( _PDCLIB_filelist_mtx );
            return NULL;
        }
 
#endif
 
        /* Locking the mutex, so we come out of the if-else with a locked
           mutex either way.
        */
        _PDCLIB_LOCK( stream->mtx );
    }
 
    /* Stream is closed, or never was open (even though its mutex exists
       and is locked) at this point.
       Now we check if we have the whereabouts to open it.
    */
 
    if ( filemode == 0 )
    {
        /* Mode invalid */
        _PDCLIB_UNLOCK( stream->mtx );
#ifndef __STDC_NO_THREADS__
        mtx_destroy( &stream->mtx );
#endif

tests/include/pdclib/functions/time/mktime.c  view on Meta::CPAN

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef __STDC_NO_THREADS__
#include <threads.h>
extern mtx_t _PDCLIB_time_mtx;
#endif
 
time_t mktime( struct tm * timeptr )
{
    time_t t;
    _PDCLIB_LOCK( _PDCLIB_time_mtx );
    _PDCLIB_tzset_unlocked();
    t = _PDCLIB_mktime_tzname( &_PDCLIB_lclmem, timeptr, true );
    _PDCLIB_UNLOCK( _PDCLIB_time_mtx );
    return t;
}
 
#endif
 
#ifdef TEST
 
#include "_PDCLIB_test.h"

tests/include/pdclib/include/pdclib/_PDCLIB_tzcode.h  view on Meta::CPAN

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
void        _PDCLIB_gmtcheck(void);
struct tm * _PDCLIB_gmtsub( struct state const * sp, time_t const * timep, int_fast32_t offset, struct tm * tmp );
bool        _PDCLIB_increment_overflow( int * ip, int j );
void        _PDCLIB_init_ttinfo( struct ttinfo * s, int_fast32_t utoff, bool isdst, int desigidx );
struct tm * _PDCLIB_localsub( struct state const * sp, time_t const * timep, int_fast32_t setname, struct tm * const tmp );
struct tm * _PDCLIB_localtime_tzset( time_t const * timep, struct tm * tmp, bool setname );
time_t      _PDCLIB_mktime_tzname( struct state * sp, struct tm * tmp, bool setname );
struct tm * _PDCLIB_timesub( const time_t * timep, int_fast32_t offset, const struct state * sp, struct tm * tmp );
int         _PDCLIB_tzload( char const * name, struct state * sp, bool doextend );
bool        _PDCLIB_tzparse(char const *, struct state *, bool);
void        _PDCLIB_tzset_unlocked( void );
void        _PDCLIB_update_tzname_etc( struct state const * sp, struct ttinfo const * ttisp );
 
#ifdef __cplusplus
}
#endif
 
#endif

tests/include/pdclib/platform/example/include/signal.h  view on Meta::CPAN

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
   arrangements, it is not possible to turn them into a useful tool.
 
   This example implementation chose to "not generate any of these signals,
   except as a result of explicit calls to the raise function", which is
   allowed by the standard but of course does nothing for the usefulness of
   <signal.h>.
 
   A useful signal handling would:
   1) make signal() a system call that registers the signal handler with the OS
   2) make raise() a system call triggering an OS signal to the running process
   3) make provisions that further signals of the same type are blocked until
      the signal handler returns (optional for SIGILL)
*/
 
/* These are the values used by Linux. */
 
/* Abnormal termination / abort() */
#define SIGABRT 6
/* Arithmetic exception / division by zero / overflow */
#define SIGFPE  8
/* Illegal instruction */

tests/include/pdclib/platform/example/include/threads.h  view on Meta::CPAN

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
   mtx_plain                 -- non-recursive mutex
   mtx_timed                 -- non-recursive mutex supporting timeout
   mtx_plain | mtx_recursive -- recursive mutex
   mtx_timed | mtx_recursive -- recursive mutex supporting timeout
*/
_PDCLIB_PUBLIC int mtx_init( mtx_t * mtx, int type );
 
/* Try to lock the given mutex (blocking).
   Returns thrd_success if successful, thrd_error if the request could not
   be honored.
   If the given mutex is non-recursive, it must not be already locked by
   the calling thread.
*/
_PDCLIB_PUBLIC int mtx_lock( mtx_t * mtx );
 
/* TODO: Documentation.
   Returns thrd_success if successful, thrd_timedout if the specified time
   is reached without acquiring the resource, or thrd_error if the request
   could not be honored.
*/
_PDCLIB_PUBLIC int mtx_timedlock( mtx_t * _PDCLIB_restrict mtx, const struct timespec * _PDCLIB_restrict ts );
 
/* Try to lock the given mutex (non-blocking).
   Returns thrd_success if successful, thrd_busy if the resource is already
   locked, or thrd_error if the request could not be honored.
*/
_PDCLIB_PUBLIC int mtx_trylock( mtx_t * mtx );
 
/* Unlock the given mutex.
   Returns thrd_success if successful, thrd_error if the request could not
   be honored.
   The given mutex must be locked by the calling thread.
*/
_PDCLIB_PUBLIC int mtx_unlock( mtx_t * mtx );
 
/* Thread functions */
 
/* Create a new thread.
   Returns thrd_success if successful, thrd_nomem if out of memory, and
   thrd_error if the request could not be honored.
   Create a new thread executing func( arg ), and sets thr to identify
   the created thread. (Identifiers may be reused afer a thread exited



( run in 0.503 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )