text
stringlengths 0
14.1k
|
|---|
return json_dict_put(dict, key, v);
|
}
|
bool json_dict_put_int(struct JsonValue *dict, const char *key, int64_t val)
|
{
|
struct JsonValue *v;
|
v = json_new_int(get_context(dict), val);
|
return json_dict_put(dict, key, v);
|
}
|
bool json_dict_put_float(struct JsonValue *dict, const char *key, double val)
|
{
|
struct JsonValue *v;
|
v = json_new_float(get_context(dict), val);
|
return json_dict_put(dict, key, v);
|
}
|
bool json_dict_put_string(struct JsonValue *dict, const char *key, const char *val)
|
{
|
struct JsonValue *v;
|
v = json_new_string(get_context(dict), val);
|
return json_dict_put(dict, key, v);
|
}
|
/*
|
* Main context management
|
*/
|
struct JsonContext *json_new_context(const void *cx, size_t initial_mem)
|
{
|
struct JsonContext *ctx;
|
CxMem *pool;
|
pool = cx_new_pool(cx, initial_mem, 8);
|
if (!pool)
|
return NULL;
|
ctx = cx_alloc0(pool, sizeof(*ctx));
|
if (!ctx) {
|
cx_destroy(pool);
|
return NULL;
|
}
|
ctx->pool = pool;
|
return ctx;
|
}
|
void json_free_context(struct JsonContext *ctx)
|
{
|
if (ctx) {
|
CxMem *pool = ctx->pool;
|
memset(ctx, 0, sizeof(*ctx));
|
cx_destroy(pool);
|
}
|
}
|
const char *json_strerror(struct JsonContext *ctx)
|
{
|
return ctx->lasterr;
|
}
|
void json_set_options(struct JsonContext *ctx, unsigned int options)
|
{
|
ctx->options = options;
|
}
|
" isc
|
pikachumetal/cursoangular05 app/loginModule/services/localstorage.js 515 "angular.module('appTesting').service(""LoginLocalStorage"", function () {
|
""use strict"";
|
var STORE_NAME = ""login"";
|
var setUser = function setUser(user) {
|
localStorage.setItem(STORE_NAME, JSON.stringify(user));
|
}
|
var getUser = function getUser() {
|
var storedTasks = localStorage.getItem(STORE_NAME);
|
if (storedTasks) {
|
return JSON.parse(storedTasks);
|
}
|
return {};
|
}
|
return {
|
setUser: setUser,
|
getUser: getUser
|
}
|
});" isc
|
arssivka/naomech xmlrpc-c/src/xmlrpc_build.c 12744 "/* Copyright information is at end of file */
|
#include ""xmlrpc_config.h""
|
#include <stddef.h>
|
#include <stdlib.h>
|
#include <stdarg.h>
|
#include <string.h>
|
#include ""stdargx.h""
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.