FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Rebol-SQLite/src/sqlite-command.c at main · Siskin-framework/Rebol-SQLite · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
Siskin-framework
/
Rebol-SQLite
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
4
Code
Issues
3
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Rebol-SQLite
/
src
/
sqlite-command.c
Copy path
More file actions
More file actions
Latest commit
History
History
History
54 lines (46 loc) · 1.64 KB
Breadcrumbs
Rebol-SQLite
/
src
/
sqlite-command.c
Copy path
File metadata and controls
54 lines (46 loc) · 1.64 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// ____ __ __ ______ __
// / __ \/ /__/ /__ ___ /_ __/__ ____/ /
// / /_/ / / _ / -_|_-<_ / / / -_) __/ _ \
// \____/_/\_,_/\__/___(@)_/ \__/\__/_// /
// ~~~ oldes.huhuman at gmail.com ~~~ /_/
//
// SPDX-License-Identifier: MIT
// =============================================================================
// Rebol/SQLite extension
// =============================================================================
// Use on your own risc!
#include
"sqlite-command.h"
REBSER
*
utf8_string
(
RXIARG
arg
) {
REBSER
*
ser
=
arg
.
series
;
REBCNT
idx
=
arg
.
index
;
return
RL_ENCODE_UTF8_STRING
(
SERIES_SKIP
(
ser
,
idx
),
SERIES_TAIL
(
ser
)
-
idx
,
SERIES_WIDE
(
ser
)
>
1
, FALSE);
}
REBOOL
fetch_word
(
REBSER
*
cmds
,
REBCNT
index
,
u32
*
words
,
REBCNT
*
cmd
) {
RXIARG
arg
;
REBCNT
type
=
RL_GET_VALUE
(
cmds
,
index
,
&
arg
);
//debug_print("fetch_word: %u type: %u\n", index, type);
return
(
RXT_WORD
==
type
&&
(
cmd
[
0
]
=
RL_FIND_WORD
(
words
,
arg
.
int32a
)));
}
REBOOL
fetch_mode
(
REBSER
*
cmds
,
REBCNT
index
,
REBCNT
*
result
,
REBCNT
start
,
REBCNT
max
) {
RXIARG
arg
;
REBCNT
wrd
=
max
;
REBCNT
type
=
RL_GET_VALUE
(
cmds
,
index
,
&
arg
);
if
(
RXT_WORD
==
type
||
RXT_LIT_WORD
==
type
) {
wrd
=
RL_FIND_WORD
(
words_sqlite_arg
,
arg
.
int32a
)
-
start
;
}
else
if
(
RXT_INTEGER
==
type
)
wrd
=
arg
.
int64
;
if
(
wrd
>=
0
&&
wrd
<
max
) {
result
[
0
]
=
wrd
;
return
TRUE;
}
return
FALSE;
}
REBOOL
fetch_color
(
REBSER
*
cmds
,
REBCNT
index
,
REBCNT
*
cmd
) {
RXIARG
arg
;
REBCNT
type
=
RL_GET_VALUE
(
cmds
,
index
,
&
arg
);
//debug_print("fetch_command: %u type: %u\n", index, type);
if
(
RXT_WORD
==
type
) {
cmd
[
0
]
=
RL_FIND_WORD
(
words_sqlite_arg
,
arg
.
int32a
);
return
TRUE;
}
return
FALSE;
}
Back
|
FazBrowse Home
|
New Git URL