LTP GCOV extension - code coverage report
Current view: directory - work/ustr - ustr-parse.h
Test: Ustr coverage
Date: 2008-02-26 Instrumented lines: 10
Code covered: 100.0 % Executed lines: 10

       1                 : /* Copyright (c) 2007 James Antill -- See LICENSE file for terms. */
       2                 : #ifndef USTR_PARSE_H
       3                 : #define USTR_PARSE_H 1
       4                 : 
       5                 : #ifndef USTR_MAIN_H
       6                 : #error " You should have already included ustr-main.h, or just include ustr.h."
       7                 : #endif
       8                 : 
       9                 : #define USTR_TYPE_PARSE_NUM_ERR_NONE 0
      10                 : #define USTR_TYPE_PARSE_NUM_ERR_ONLY_S 1
      11                 : #define USTR_TYPE_PARSE_NUM_ERR_ONLY_SPM 2
      12                 : #define USTR_TYPE_PARSE_NUM_ERR_ONLY_SPMX 3
      13                 : #define USTR_TYPE_PARSE_NUM_ERR_OOB 4
      14                 : #define USTR_TYPE_PARSE_NUM_ERR_OVERFLOW 5
      15                 : #define USTR_TYPE_PARSE_NUM_ERR_NEGATIVE 6
      16                 : #define USTR_TYPE_PARSE_NUM_ERR_BEG_ZERO 7
      17                 : 
      18                 : #define USTR_FLAG_PARSE_NUM_DEF          0U
      19                 : #define USTR__MASK_PARSE_NUM_BASE (63) /* (1<<6) - 1 */
      20                 : /* #define USTR_FLAG_PARSE_NUM_LOCAL       (1U<<6) */
      21                 : #define USTR_FLAG_PARSE_NUM_SEP         (1U<<7)
      22                 : #define USTR_FLAG_PARSE_NUM_OVERFLOW    (1U<<8)
      23                 : #define USTR_FLAG_PARSE_NUM_SPACE       (1U<<9)
      24                 : #define USTR_FLAG_PARSE_NUM_NO_BEG_ZERO (1U<<10)
      25                 : #define USTR_FLAG_PARSE_NUM_NO_BEG_PM   (1U<<11)
      26                 : #define USTR_FLAG_PARSE_NUM_NO_NEGATIVE (1U<<12)
      27                 : #define USTR_FLAG_PARSE_NUM_EXACT       (1U<<13)
      28                 : 
      29                 : 
      30                 : #if USTR_CONF_HAVE_STDINT_H
      31                 : USTR_CONF_E_PROTO
      32                 : uintmax_t ustr_parse_uintmaxx(const struct Ustr *, size_t, unsigned int,
      33                 :                               uintmax_t, uintmax_t, const char *,
      34                 :                               size_t *,unsigned int *)
      35                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 6));
      36                 : 
      37                 : USTR_CONF_E_PROTO
      38                 : uintmax_t ustr_parse_uintmax(const struct Ustr *, size_t, unsigned int, size_t *, unsigned int *)
      39                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      40                 : USTR_CONF_E_PROTO
      41                 : intmax_t ustr_parse_intmax(const struct Ustr *, size_t, unsigned int, size_t *, unsigned int *)
      42                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      43                 : #endif
      44                 : 
      45                 : USTR_CONF_E_PROTO
      46                 : unsigned long ustr_parse_ulongx(const struct Ustr *, size_t, unsigned int,
      47                 :                                 unsigned long, unsigned long,
      48                 :                                 const char *, size_t *, unsigned int *)
      49                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 6));
      50                 : 
      51                 : USTR_CONF_E_PROTO
      52                 : unsigned long ustr_parse_ulong(const struct Ustr *, size_t, unsigned int,
      53                 :                                size_t *, unsigned int *)
      54                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      55                 : USTR_CONF_E_PROTO
      56                 : long ustr_parse_long(const struct Ustr *, size_t, unsigned int,
      57                 :                      size_t *, unsigned int *)
      58                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      59                 : 
      60                 : USTR_CONF_E_PROTO
      61                 : unsigned int ustr_parse_uint(const struct Ustr *, size_t, unsigned int,
      62                 :                              size_t *, unsigned int *)
      63                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      64                 : USTR_CONF_E_PROTO
      65                 : int ustr_parse_int(const struct Ustr *, size_t, unsigned int,
      66                 :                    size_t *, unsigned int *)
      67                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      68                 : 
      69                 : USTR_CONF_E_PROTO
      70                 : unsigned short ustr_parse_ushort(const struct Ustr *, size_t, unsigned int,
      71                 :                                  size_t *, unsigned int *)
      72                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      73                 : USTR_CONF_E_PROTO
      74                 : short ustr_parse_short(const struct Ustr *, size_t, unsigned int,
      75                 :                        size_t *, unsigned int *)
      76                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      77                 : 
      78                 : #if USTR_CONF_INCLUDE_CODEONLY_HEADERS
      79                 : # include "ustr-parse-code.h"
      80                 : #endif
      81                 : 
      82                 : 
      83                 : /* ---------------- pool wrapper APIs ---------------- */
      84                 : 
      85                 : #if USTR_CONF_HAVE_STDINT_H
      86                 : USTR_CONF_EI_PROTO
      87                 : uintmax_t ustrp_parse_uintmaxx(const struct Ustrp *, size_t, unsigned int,
      88                 :                                uintmax_t, uintmax_t, const char *,
      89                 :                                size_t *, unsigned int *)
      90                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 6));
      91                 : USTR_CONF_EI_PROTO
      92                 : uintmax_t ustrp_parse_uintmax(const struct Ustrp *, size_t, unsigned int,
      93                 :                               size_t *, unsigned int *)
      94                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      95                 : USTR_CONF_EI_PROTO
      96                 : intmax_t ustrp_parse_intmax(const struct Ustrp *, size_t, unsigned int,
      97                 :                             size_t *, unsigned int *)
      98                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
      99                 : 
     100                 : #endif
     101                 : 
     102                 : USTR_CONF_EI_PROTO
     103                 : unsigned long ustrp_parse_ulongx(const struct Ustrp *, size_t, unsigned int,
     104                 :                                  unsigned long, unsigned long,
     105                 :                                  const char *, size_t *, unsigned int *)
     106                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 6));
     107                 : 
     108                 : USTR_CONF_EI_PROTO
     109                 : unsigned long ustrp_parse_ulong(const struct Ustrp *, size_t, unsigned int,
     110                 :                                 size_t *, unsigned int *)
     111                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
     112                 : USTR_CONF_EI_PROTO
     113                 : long ustrp_parse_long(const struct Ustrp *, size_t, unsigned int,
     114                 :                       size_t *, unsigned int *)
     115                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
     116                 : 
     117                 : USTR_CONF_EI_PROTO
     118                 : unsigned int ustrp_parse_uint(const struct Ustrp *, size_t, unsigned int,
     119                 :                               size_t *, unsigned int *)
     120                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
     121                 : USTR_CONF_EI_PROTO
     122                 : int ustrp_parse_int(const struct Ustrp *, size_t, unsigned int,
     123                 :                     size_t *, unsigned int *)
     124                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
     125                 : 
     126                 : USTR_CONF_EI_PROTO
     127                 : unsigned short ustrp_parse_ushort(const struct Ustrp *, size_t, unsigned int,
     128                 :                                   size_t *, unsigned *)
     129                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
     130                 : USTR_CONF_EI_PROTO
     131                 : short ustrp_parse_short(const struct Ustrp *, size_t, unsigned int,
     132                 :                         size_t *, unsigned int *)
     133                 :     USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1));
     134                 : 
     135                 : #if USTR_CONF_COMPILE_USE_INLINE
     136                 : # if USTR_CONF_HAVE_STDINT_H
     137                 : USTR_CONF_II_PROTO
     138                 : uintmax_t ustrp_parse_uintmaxx(const struct Ustrp *s1, size_t off,
     139                 :                                unsigned int flags,
     140                 :                                uintmax_t nmin, uintmax_t nmax,
     141                 :                                const char *sep, size_t *len, unsigned int *ern)
     142              32 : { return (ustr_parse_uintmaxx(&s1->s, off, flags, nmin, nmax, sep, len, ern)); }
     143                 : 
     144                 : USTR_CONF_II_PROTO
     145                 : uintmax_t ustrp_parse_uintmax(const struct Ustrp *s1, size_t off,
     146                 :                               unsigned int flags,
     147                 :                               size_t *len, unsigned int *ern)
     148              32 : { return (ustr_parse_uintmax(&s1->s, off, flags, len, ern)); }
     149                 : 
     150                 : USTR_CONF_II_PROTO
     151                 : intmax_t ustrp_parse_intmax(const struct Ustrp *s1, size_t off, 
     152                 :                             unsigned int flags, size_t *len, unsigned int *ern)
     153              16 : { return (ustr_parse_intmax(&s1->s, off, flags, len, ern)); }
     154                 : # endif
     155                 : 
     156                 : USTR_CONF_II_PROTO
     157                 : unsigned long ustrp_parse_ulongx(const struct Ustrp *s1, size_t off,
     158                 :                                  unsigned int flags,
     159                 :                                  unsigned long nmin, unsigned long nmax,
     160                 :                                  const char *sep, size_t *len, unsigned *ern)
     161              10 : { return (ustr_parse_ulongx(&s1->s, off, flags, nmin, nmax, sep, len, ern)); }
     162                 : 
     163                 : USTR_CONF_II_PROTO
     164                 : unsigned long ustrp_parse_ulong(const struct Ustrp *s1, size_t off, 
     165                 :                                 unsigned int flags,
     166                 :                                 size_t *len, unsigned int *ern)
     167               8 : { return (ustr_parse_ulong(&s1->s, off, flags, len, ern)); }
     168                 : USTR_CONF_II_PROTO
     169                 : long ustrp_parse_long(const struct Ustrp *s1, size_t off, 
     170                 :                       unsigned int flags, size_t *len, unsigned int *ern)
     171               8 : { return (ustr_parse_long(&s1->s, off, flags, len, ern)); }
     172                 : 
     173                 : USTR_CONF_II_PROTO
     174                 : unsigned int ustrp_parse_uint(const struct Ustrp *s1, size_t off, 
     175                 :                               unsigned int flags,
     176                 :                               size_t *len, unsigned int *ern)
     177               8 : { return (ustr_parse_uint(&s1->s, off, flags, len, ern)); }
     178                 : USTR_CONF_II_PROTO
     179                 : int ustrp_parse_int(const struct Ustrp *s1, size_t off, 
     180                 :                     unsigned int flags, size_t *len, unsigned int *ern)
     181              32 : { return (ustr_parse_int(&s1->s, off, flags, len, ern)); }
     182                 : 
     183                 : USTR_CONF_II_PROTO
     184                 : unsigned short ustrp_parse_ushort(const struct Ustrp *s1, size_t off, 
     185                 :                                   unsigned int flags,
     186                 :                                   size_t *len, unsigned int *ern)
     187               8 : { return (ustr_parse_ushort(&s1->s, off, flags, len, ern)); }
     188                 : USTR_CONF_II_PROTO
     189                 : short ustrp_parse_short(const struct Ustrp *s1, size_t off, 
     190                 :                         unsigned int flags, size_t *len, unsigned int *ern)
     191               8 : { return (ustr_parse_short(&s1->s, off, flags, len, ern)); }
     192                 : #endif
     193                 : 
     194                 : #endif
     195                 : 

Generated by: LTP GCOV extension version 1.4