2009-12-08 18:46:35 +00:00
|
|
|
/*
|
|
|
|
** String handling.
|
2013-02-11 11:54:48 +00:00
|
|
|
** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h
|
2009-12-08 18:46:35 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LJ_STR_H
|
|
|
|
#define _LJ_STR_H
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "lj_obj.h"
|
|
|
|
|
2013-05-07 18:44:58 +00:00
|
|
|
/* String helpers. */
|
2009-12-08 19:35:29 +00:00
|
|
|
LJ_FUNC int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b);
|
2013-05-07 18:44:58 +00:00
|
|
|
LJ_FUNC const char *lj_str_find(const char *s, const char *f,
|
|
|
|
MSize slen, MSize flen);
|
|
|
|
LJ_FUNC int lj_str_haspattern(GCstr *s);
|
|
|
|
|
|
|
|
/* String interning. */
|
2009-12-08 18:46:35 +00:00
|
|
|
LJ_FUNC void lj_str_resize(lua_State *L, MSize newmask);
|
|
|
|
LJ_FUNCA GCstr *lj_str_new(lua_State *L, const char *str, size_t len);
|
|
|
|
LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s);
|
|
|
|
|
|
|
|
#define lj_str_newz(L, s) (lj_str_new(L, s, strlen(s)))
|
|
|
|
#define lj_str_newlit(L, s) (lj_str_new(L, "" s, sizeof(s)-1))
|
|
|
|
|
|
|
|
#endif
|