Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
e927b4bd
Commit
e927b4bd
authored
Jul 28, 2008
by
gdinesh@csa.iisc.ernet.in
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clearing compilation warning
parent
90125706
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
31 deletions
+8
-31
tools/_infotojson/Makefile
tools/_infotojson/Makefile
+2
-1
tools/_infotojson/infotojson.c
tools/_infotojson/infotojson.c
+0
-1
tools/_infotojson/sqlite3_database.c
tools/_infotojson/sqlite3_database.c
+0
-25
tools/_infotojson/utils.c
tools/_infotojson/utils.c
+5
-3
tools/_infotojson/utils.h
tools/_infotojson/utils.h
+1
-1
No files found.
tools/_infotojson/Makefile
View file @
e927b4bd
tools/_infotojson/infotojson
:
tools/_infotojson/infotojson.o tools/_infotojson/sqlite3_database.o tools/_infotojson/utils.o
tools/_infotojson/infotojson
:
tools/_infotojson/infotojson.o tools/_infotojson/sqlite3_database.o tools/_infotojson/utils.o ccan/string/string.o ccan/talloc/talloc.o
$(CC)
$(LDFLAGS)
-o
$@
$^
-lsqlite3
tools/_infotojson/infotojson.c
View file @
e927b4bd
...
...
@@ -112,7 +112,6 @@ int storejsontodb(struct json *jsonobj, char *db)
{
char
*
cmd
,
*
query
;
sqlite3
*
handle
;
char
*
errstr
;
struct
db_query
*
q
;
handle
=
db_open
(
db
);
...
...
tools/_infotojson/sqlite3_database.c
View file @
e927b4bd
...
...
@@ -70,31 +70,6 @@ void db_command(void *h, const char *command)
printf
(
"Failed sqlite3 command '%s': %s"
,
command
,
err
);
}
/* Starts transaction. Doesn't need to nest. */
/*void db_transaction_start(void *h)
{
char *err;
if (sqlite3_exec(h, "BEGIN EXCLUSIVE TRANSACTION", NULL, NULL, &err)!=SQLITE_OK)
printf("Starting sqlite3 transaction: %s\n", err);
}
/* Finishes transaction, or rolls it back and caller needs to start again. */
/*
bool db_transaction_finish(void *h)
{
switch (sqlite3_exec(h, "COMMIT TRANSACTION;", NULL, NULL, NULL)) {
case SQLITE_OK:
return true;
case SQLITE_BUSY:
if (sqlite3_exec(h, "ROLLBACK TRANSACTION;", NULL, NULL, NULL)
!= SQLITE_OK)
printf("Ending sqlite3 busy rollback failed");
return false;
default:
printf("Strange sqlite3 error return from COMMIT");
}
}*/
/* Closes database (only called when everything OK). */
void
db_close
(
void
*
h
)
{
...
...
tools/_infotojson/utils.c
View file @
e927b4bd
#
include "utils.h"
#
define _GNU_SOURCE
#include <stdio.h>
#include "utils.h"
#include <string.h>
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <err.h>
#include <assert.h>
#include "utils.h"
...
...
@@ -31,7 +33,7 @@ char *aprintf(const char *fmt, ...)
return
ret
;
}
int
strreplace
(
char
*
str
,
char
src
,
char
dest
)
void
strreplace
(
char
*
str
,
char
src
,
char
dest
)
{
int
i
;
for
(
i
=
0
;
str
[
i
];
i
++
)
...
...
@@ -51,5 +53,5 @@ void *realloc_nofail(void *ptr, size_t size)
ptr
=
realloc
(
ptr
,
size
);
if
(
ptr
)
return
ptr
;
printf
(
"realloc of %zu failed"
,
size
);
err
(
1
,
"realloc of %zu failed"
,
size
);
}
tools/_infotojson/utils.h
View file @
e927b4bd
...
...
@@ -14,4 +14,4 @@ void * palloc(int size);
char
*
aprintf
(
const
char
*
fmt
,
...);
int
strreplace
(
char
*
str
,
char
src
,
char
dest
);
void
strreplace
(
char
*
str
,
char
src
,
char
dest
);
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