This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void odd (sqlite3_context *ctx, int argc, sqlite3_value **argv){ | |
int *pCounter = (int*)sqlite3_get_auxdata(ctx, 0); | |
if (pCounter == 0) { | |
pCounter = sqlite3_malloc(sizeof(*pCounter)); | |
if (pCounter == 0) | |
return sqlite3_result_error_nomem(ctx); | |
*pCounter = sqlite3_value_type(argv[0]) == SQLITE_NULL ? 0 : sqlite3_value_int(argv[0]); | |
sqlite3_set_auxdata(ctx, 0, pCounter, sqlite3_free); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void square (sqlite3_context *ctx, int argc, sqlite3_value **argv) { | |
int type = sqlite3_value_type(argv[0]); | |
double d = sqlite3_value_double(argv[0]); | |
switch (type) { | |
case SQLITE_NULL: | |
sqlite3_result_null(ctx); | |
break; | |
case SQLITE_INTEGER: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset = "UTF-8"/> | |
<title>Nunjucks example</title> | |
<script type = "module" src = "index.js"></script> | |
</head> | |
<body> | |
<div id = "page-content"></div> | |
</body> |
NewerOlder