Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
0651fff2
Commit
0651fff2
authored
Jun 18, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11 from groleo/for-upstream
sqlite3 fixes
parents
5108504d
c6ff8b13
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
39 deletions
+40
-39
configure
configure
+3
-2
sqlite3gen.cpp
src/sqlite3gen.cpp
+37
-37
No files found.
configure
View file @
0651fff2
...
@@ -421,7 +421,7 @@ fi
...
@@ -421,7 +421,7 @@ fi
if
test
"
$f_sqlite3
"
=
YES
;
then
if
test
"
$f_sqlite3
"
=
YES
;
then
printf
" Checking for sqlite3 ... "
printf
" Checking for sqlite3 ... "
sqlite3_hdr_dir
=
"/usr/include /usr/local/include /opt/local/include"
sqlite3_hdr_dir
=
"/usr/include /usr/local/include /opt/local/include"
sqlite3_lib_dir
=
"/usr/lib /usr/local/lib /opt/local/lib"
sqlite3_lib_dir
=
"/usr/lib /usr/local/lib /opt/local/lib
/usr/lib/x86_64-linux-gnu
"
sqlite3_lib_name
=
"libsqlite3.so libsqlite3.dylib libsqlite3.a"
sqlite3_lib_name
=
"libsqlite3.so libsqlite3.dylib libsqlite3.a"
sqlite3_hdr
=
NO
sqlite3_hdr
=
NO
sqlite3_lib
=
NO
sqlite3_lib
=
NO
...
@@ -435,7 +435,7 @@ if test "$f_sqlite3" = YES; then
...
@@ -435,7 +435,7 @@ if test "$f_sqlite3" = YES; then
for
i
in
$sqlite3_lib_dir
;
do
for
i
in
$sqlite3_lib_dir
;
do
if
test
"
$sqlite3_lib
"
=
NO
;
then
if
test
"
$sqlite3_lib
"
=
NO
;
then
for
j
in
$sqlite3_lib_name
;
do
for
j
in
$sqlite3_lib_name
;
do
if
test
-
f
"
$i
/
$j
"
;
then
if
test
-
e
"
$i
/
$j
"
;
then
sqlite3_lib
=
"
$i
/
$j
"
sqlite3_lib
=
"
$i
/
$j
"
sqlite3_link
=
"-L
$i
-lsqlite3"
sqlite3_link
=
"-L
$i
-lsqlite3"
break
break
...
@@ -445,6 +445,7 @@ if test "$f_sqlite3" = YES; then
...
@@ -445,6 +445,7 @@ if test "$f_sqlite3" = YES; then
done
done
if
test
"
$sqlite3_hdr
"
=
NO
-o
"
$sqlite3_lib
"
=
NO
;
then
if
test
"
$sqlite3_hdr
"
=
NO
-o
"
$sqlite3_lib
"
=
NO
;
then
echo
"not found!"
;
echo
"not found!"
;
exit
1
else
else
echo
"using header
$sqlite3_hdr
and library
$sqlite3_lib
..."
;
echo
"using header
$sqlite3_hdr
and library
$sqlite3_lib
..."
;
fi
fi
...
...
src/sqlite3gen.cpp
View file @
0651fff2
...
@@ -240,7 +240,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def);
...
@@ -240,7 +240,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def);
static
void
bindTextParameter
(
sqlite3_stmt
*
stmt
,
const
char
*
name
,
const
char
*
value
)
static
void
bindTextParameter
(
sqlite3_stmt
*
stmt
,
const
char
*
name
,
const
char
*
value
)
{
{
int
idx
=
sqlite3_bind_parameter_index
(
stmt
,
name
);
int
idx
=
sqlite3_bind_parameter_index
(
stmt
,
name
);
sqlite3_bind_text
(
id_s_files
,
idx
,
value
,
-
1
,
SQLITE_STATIC
);
sqlite3_bind_text
(
stmt
,
idx
,
value
,
-
1
,
SQLITE_STATIC
);
}
}
static
void
bindIntParameter
(
sqlite3_stmt
*
stmt
,
const
char
*
name
,
int
value
)
static
void
bindIntParameter
(
sqlite3_stmt
*
stmt
,
const
char
*
name
,
int
value
)
...
@@ -255,7 +255,7 @@ static int step(sqlite3 *db, sqlite3_stmt *stmt,bool getRowId=FALSE)
...
@@ -255,7 +255,7 @@ static int step(sqlite3 *db, sqlite3_stmt *stmt,bool getRowId=FALSE)
int
rc
=
sqlite3_step
(
stmt
);
int
rc
=
sqlite3_step
(
stmt
);
if
(
rc
!=
SQLITE_DONE
&&
rc
!=
SQLITE_ROW
)
if
(
rc
!=
SQLITE_DONE
&&
rc
!=
SQLITE_ROW
)
{
{
msg
(
"
failed count files
: %s
\n
"
,
sqlite3_errmsg
(
db
));
msg
(
"
sqlite3_step failed
: %s
\n
"
,
sqlite3_errmsg
(
db
));
}
}
if
(
getRowId
)
id
=
sqlite3_column_int
(
stmt
,
0
);
if
(
getRowId
)
id
=
sqlite3_column_int
(
stmt
,
0
);
sqlite3_reset
(
stmt
);
sqlite3_reset
(
stmt
);
...
@@ -278,10 +278,10 @@ static int insertFile(sqlite3 *db, const char* name)
...
@@ -278,10 +278,10 @@ static int insertFile(sqlite3 *db, const char* name)
{
{
int
id
=-
1
;
int
id
=-
1
;
if
(
name
==
0
)
return
-
1
;
if
(
name
==
0
)
return
-
1
;
// see if it's already in DB
// see if it's already in DB
bindTextParameter
(
id_s_files
,
":name"
,
name
);
bindTextParameter
(
id_s_files
,
":name"
,
name
);
id
=
step
(
db
,
i_s_files
,
TRUE
);
id
=
step
(
db
,
i
d
_s_files
,
TRUE
);
if
(
id
==
0
)
if
(
id
==
0
)
{
{
// insert it
// insert it
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment