Changeset 8338a81 in mainline for uspace/lib/c/include/stdlib.h


Ignore:
Timestamp:
2018-06-16T22:20:39Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
379db9ef
Parents:
55092672
Message:

div, ldiv, lldiv should go to libc's stdio.h Add MB_CUR_MAX. Adjust MB_LEN_MAX. Add tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/stdlib.h

    r55092672 r8338a81  
    3636#define LIBC_STDLIB_H_
    3737
     38#include <_bits/size_t.h>
     39#include <_bits/wchar_t.h>
    3840#include <malloc.h>
    3941#include <qsort.h>
    4042
    41 #define RAND_MAX  714025
     43/** Type returned by the div function */
     44typedef struct {
     45        /** Quotient */
     46        int quot;
     47        /** Remainder */
     48        int rem;
     49} div_t;
     50
     51/** Type returned by the ldiv function */
     52typedef struct {
     53        /** Quotient */
     54        long quot;
     55        /** Remainder */
     56        long rem;
     57} ldiv_t;
     58
     59/** Type returned by the lldiv function */
     60typedef struct {
     61        /** Quotient */
     62        long long quot;
     63        /** Remainder */
     64        long long rem;
     65} lldiv_t;
     66
    4267
    4368#define EXIT_FAILURE 1
    4469#define EXIT_SUCCESS 0
     70
     71#define RAND_MAX  714025
     72
     73#define MB_CUR_MAX 4
    4574
    4675extern int rand(void);
     
    5988extern unsigned long long strtoull(const char *__restrict__, char **__restrict__, int);
    6089
     90extern div_t div(int, int);
     91extern ldiv_t ldiv(long, long);
     92extern lldiv_t lldiv(long long, long long);
     93
    6194#endif
    6295
Note: See TracChangeset for help on using the changeset viewer.