Sha256: d84a65705214a6cbc9162057c83c30a807e33d106be5bd47dfcfd9a7b3849058

Contents?: true

Size: 1.06 KB

Versions: 24

Compression:

Stored size: 1.06 KB

Contents

/*
** String scanning.
** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
*/

#ifndef _LJ_STRSCAN_H
#define _LJ_STRSCAN_H

#include "lj_obj.h"

/* Options for accepted/returned formats. */
#define STRSCAN_OPT_TOINT	0x01  /* Convert to int32_t, if possible. */
#define STRSCAN_OPT_TONUM	0x02  /* Always convert to double. */
#define STRSCAN_OPT_IMAG	0x04
#define STRSCAN_OPT_LL		0x08
#define STRSCAN_OPT_C		0x10

/* Returned format. */
typedef enum {
  STRSCAN_ERROR,
  STRSCAN_NUM, STRSCAN_IMAG,
  STRSCAN_INT, STRSCAN_U32, STRSCAN_I64, STRSCAN_U64,
} StrScanFmt;

LJ_FUNC StrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt);
LJ_FUNC int LJ_FASTCALL lj_strscan_num(GCstr *str, TValue *o);
#if LJ_DUALNUM
LJ_FUNC int LJ_FASTCALL lj_strscan_number(GCstr *str, TValue *o);
#else
#define lj_strscan_number(s, o)		lj_strscan_num((s), (o))
#endif

/* Check for number or convert string to number/int in-place (!). */
static LJ_AINLINE int lj_strscan_numberobj(TValue *o)
{
  return tvisnumber(o) || (tvisstr(o) && lj_strscan_number(strV(o), o));
}

#endif

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
immunio-1.1.2 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.1.1 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.1.0 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.22 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.19 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.17 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.15 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.14 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.13 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.12 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.11 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.10 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.9 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.8 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.7 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.6 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.5 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.4 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.3 lua-hooks/ext/luajit/src/lj_strscan.h
immunio-1.0.2 lua-hooks/ext/luajit/src/lj_strscan.h