Fossil SCM

Merge the import/export changes into trunk. Even though they are incomplete, they do not threaten the correctness of other commands and can be developed in trunk.

drh 2010-11-09 11:05 trunk merge
Commit 0f024d3e30741af3403c1c87ee5d689741e5a63c
--- a/src/export.c
+++ b/src/export.c
@@ -0,0 +1,2 @@
1
+ destroy Git "fast-import" formator wiki
2
+**at is0);1
--- a/src/export.c
+++ b/src/export.c
@@ -0,0 +1,2 @@
 
 
--- a/src/export.c
+++ b/src/export.c
@@ -0,0 +1,2 @@
1 destroy Git "fast-import" formator wiki
2 **at is0);1
--- a/src/import.c
+++ b/src/import.c
@@ -0,0 +1,2 @@
1
+gsvz/* TBD... */char zLine[1000];
2
+mprintf("%s", mprintf("%s", fossil_fatal("no
--- a/src/import.c
+++ b/src/import.c
@@ -0,0 +1,2 @@
 
 
--- a/src/import.c
+++ b/src/import.c
@@ -0,0 +1,2 @@
1 gsvz/* TBD... */char zLine[1000];
2 mprintf("%s", mprintf("%s", fossil_fatal("no
+22 -2
--- src/main.mk
+++ src/main.mk
@@ -36,17 +36,19 @@
3636
$(SRCDIR)/diff.c \
3737
$(SRCDIR)/diffcmd.c \
3838
$(SRCDIR)/doc.c \
3939
$(SRCDIR)/encode.c \
4040
$(SRCDIR)/event.c \
41
+ $(SRCDIR)/export.c \
4142
$(SRCDIR)/file.c \
4243
$(SRCDIR)/finfo.c \
4344
$(SRCDIR)/graph.c \
4445
$(SRCDIR)/http.c \
4546
$(SRCDIR)/http_socket.c \
4647
$(SRCDIR)/http_ssl.c \
4748
$(SRCDIR)/http_transport.c \
49
+ $(SRCDIR)/import.c \
4850
$(SRCDIR)/info.c \
4951
$(SRCDIR)/login.c \
5052
$(SRCDIR)/main.c \
5153
$(SRCDIR)/manifest.c \
5254
$(SRCDIR)/md5.c \
@@ -110,17 +112,19 @@
110112
diff_.c \
111113
diffcmd_.c \
112114
doc_.c \
113115
encode_.c \
114116
event_.c \
117
+ export_.c \
115118
file_.c \
116119
finfo_.c \
117120
graph_.c \
118121
http_.c \
119122
http_socket_.c \
120123
http_ssl_.c \
121124
http_transport_.c \
125
+ import_.c \
122126
info_.c \
123127
login_.c \
124128
main_.c \
125129
manifest_.c \
126130
md5_.c \
@@ -184,17 +188,19 @@
184188
$(OBJDIR)/diff.o \
185189
$(OBJDIR)/diffcmd.o \
186190
$(OBJDIR)/doc.o \
187191
$(OBJDIR)/encode.o \
188192
$(OBJDIR)/event.o \
193
+ $(OBJDIR)/export.o \
189194
$(OBJDIR)/file.o \
190195
$(OBJDIR)/finfo.o \
191196
$(OBJDIR)/graph.o \
192197
$(OBJDIR)/http.o \
193198
$(OBJDIR)/http_socket.o \
194199
$(OBJDIR)/http_ssl.o \
195200
$(OBJDIR)/http_transport.o \
201
+ $(OBJDIR)/import.o \
196202
$(OBJDIR)/info.o \
197203
$(OBJDIR)/login.o \
198204
$(OBJDIR)/main.o \
199205
$(OBJDIR)/manifest.o \
200206
$(OBJDIR)/md5.o \
@@ -278,16 +284,16 @@
278284
# noop
279285
280286
clean:
281287
rm -f $(OBJDIR)/*.o *_.c $(APPNAME) VERSION.h
282288
rm -f translate makeheaders mkindex page_index.h headers
283
- rm -f add.h allrepo.h attach.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h event.h file.h finfo.h graph.h http.h http_socket.h http_ssl.h http_transport.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h popen.h pqueue.h printf.h rebuild.h report.h rss.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h
289
+ rm -f add.h allrepo.h attach.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h event.h export.h file.h finfo.h graph.h http.h http_socket.h http_ssl.h http_transport.h import.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h popen.h pqueue.h printf.h rebuild.h report.h rss.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h
284290
285291
page_index.h: $(TRANS_SRC) mkindex
286292
./mkindex $(TRANS_SRC) >$@
287293
headers: page_index.h makeheaders VERSION.h
288
- ./makeheaders add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h
294
+ ./makeheaders add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h
289295
touch headers
290296
headers: Makefile
291297
Makefile:
292298
add_.c: $(SRCDIR)/add.c translate
293299
./translate $(SRCDIR)/add.c >add_.c
@@ -462,10 +468,17 @@
462468
463469
$(OBJDIR)/event.o: event_.c event.h $(SRCDIR)/config.h
464470
$(XTCC) -o $(OBJDIR)/event.o -c event_.c
465471
466472
event.h: headers
473
+export_.c: $(SRCDIR)/export.c translate
474
+ ./translate $(SRCDIR)/export.c >export_.c
475
+
476
+$(OBJDIR)/export.o: export_.c export.h $(SRCDIR)/config.h
477
+ $(XTCC) -o $(OBJDIR)/export.o -c export_.c
478
+
479
+export.h: headers
467480
file_.c: $(SRCDIR)/file.c translate
468481
./translate $(SRCDIR)/file.c >file_.c
469482
470483
$(OBJDIR)/file.o: file_.c file.h $(SRCDIR)/config.h
471484
$(XTCC) -o $(OBJDIR)/file.o -c file_.c
@@ -511,10 +524,17 @@
511524
512525
$(OBJDIR)/http_transport.o: http_transport_.c http_transport.h $(SRCDIR)/config.h
513526
$(XTCC) -o $(OBJDIR)/http_transport.o -c http_transport_.c
514527
515528
http_transport.h: headers
529
+import_.c: $(SRCDIR)/import.c translate
530
+ ./translate $(SRCDIR)/import.c >import_.c
531
+
532
+$(OBJDIR)/import.o: import_.c import.h $(SRCDIR)/config.h
533
+ $(XTCC) -o $(OBJDIR)/import.o -c import_.c
534
+
535
+import.h: headers
516536
info_.c: $(SRCDIR)/info.c translate
517537
./translate $(SRCDIR)/info.c >info_.c
518538
519539
$(OBJDIR)/info.o: info_.c info.h $(SRCDIR)/config.h
520540
$(XTCC) -o $(OBJDIR)/info.o -c info_.c
521541
--- src/main.mk
+++ src/main.mk
@@ -36,17 +36,19 @@
36 $(SRCDIR)/diff.c \
37 $(SRCDIR)/diffcmd.c \
38 $(SRCDIR)/doc.c \
39 $(SRCDIR)/encode.c \
40 $(SRCDIR)/event.c \
 
41 $(SRCDIR)/file.c \
42 $(SRCDIR)/finfo.c \
43 $(SRCDIR)/graph.c \
44 $(SRCDIR)/http.c \
45 $(SRCDIR)/http_socket.c \
46 $(SRCDIR)/http_ssl.c \
47 $(SRCDIR)/http_transport.c \
 
48 $(SRCDIR)/info.c \
49 $(SRCDIR)/login.c \
50 $(SRCDIR)/main.c \
51 $(SRCDIR)/manifest.c \
52 $(SRCDIR)/md5.c \
@@ -110,17 +112,19 @@
110 diff_.c \
111 diffcmd_.c \
112 doc_.c \
113 encode_.c \
114 event_.c \
 
115 file_.c \
116 finfo_.c \
117 graph_.c \
118 http_.c \
119 http_socket_.c \
120 http_ssl_.c \
121 http_transport_.c \
 
122 info_.c \
123 login_.c \
124 main_.c \
125 manifest_.c \
126 md5_.c \
@@ -184,17 +188,19 @@
184 $(OBJDIR)/diff.o \
185 $(OBJDIR)/diffcmd.o \
186 $(OBJDIR)/doc.o \
187 $(OBJDIR)/encode.o \
188 $(OBJDIR)/event.o \
 
189 $(OBJDIR)/file.o \
190 $(OBJDIR)/finfo.o \
191 $(OBJDIR)/graph.o \
192 $(OBJDIR)/http.o \
193 $(OBJDIR)/http_socket.o \
194 $(OBJDIR)/http_ssl.o \
195 $(OBJDIR)/http_transport.o \
 
196 $(OBJDIR)/info.o \
197 $(OBJDIR)/login.o \
198 $(OBJDIR)/main.o \
199 $(OBJDIR)/manifest.o \
200 $(OBJDIR)/md5.o \
@@ -278,16 +284,16 @@
278 # noop
279
280 clean:
281 rm -f $(OBJDIR)/*.o *_.c $(APPNAME) VERSION.h
282 rm -f translate makeheaders mkindex page_index.h headers
283 rm -f add.h allrepo.h attach.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h event.h file.h finfo.h graph.h http.h http_socket.h http_ssl.h http_transport.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h popen.h pqueue.h printf.h rebuild.h report.h rss.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h
284
285 page_index.h: $(TRANS_SRC) mkindex
286 ./mkindex $(TRANS_SRC) >$@
287 headers: page_index.h makeheaders VERSION.h
288 ./makeheaders add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h
289 touch headers
290 headers: Makefile
291 Makefile:
292 add_.c: $(SRCDIR)/add.c translate
293 ./translate $(SRCDIR)/add.c >add_.c
@@ -462,10 +468,17 @@
462
463 $(OBJDIR)/event.o: event_.c event.h $(SRCDIR)/config.h
464 $(XTCC) -o $(OBJDIR)/event.o -c event_.c
465
466 event.h: headers
 
 
 
 
 
 
 
467 file_.c: $(SRCDIR)/file.c translate
468 ./translate $(SRCDIR)/file.c >file_.c
469
470 $(OBJDIR)/file.o: file_.c file.h $(SRCDIR)/config.h
471 $(XTCC) -o $(OBJDIR)/file.o -c file_.c
@@ -511,10 +524,17 @@
511
512 $(OBJDIR)/http_transport.o: http_transport_.c http_transport.h $(SRCDIR)/config.h
513 $(XTCC) -o $(OBJDIR)/http_transport.o -c http_transport_.c
514
515 http_transport.h: headers
 
 
 
 
 
 
 
516 info_.c: $(SRCDIR)/info.c translate
517 ./translate $(SRCDIR)/info.c >info_.c
518
519 $(OBJDIR)/info.o: info_.c info.h $(SRCDIR)/config.h
520 $(XTCC) -o $(OBJDIR)/info.o -c info_.c
521
--- src/main.mk
+++ src/main.mk
@@ -36,17 +36,19 @@
36 $(SRCDIR)/diff.c \
37 $(SRCDIR)/diffcmd.c \
38 $(SRCDIR)/doc.c \
39 $(SRCDIR)/encode.c \
40 $(SRCDIR)/event.c \
41 $(SRCDIR)/export.c \
42 $(SRCDIR)/file.c \
43 $(SRCDIR)/finfo.c \
44 $(SRCDIR)/graph.c \
45 $(SRCDIR)/http.c \
46 $(SRCDIR)/http_socket.c \
47 $(SRCDIR)/http_ssl.c \
48 $(SRCDIR)/http_transport.c \
49 $(SRCDIR)/import.c \
50 $(SRCDIR)/info.c \
51 $(SRCDIR)/login.c \
52 $(SRCDIR)/main.c \
53 $(SRCDIR)/manifest.c \
54 $(SRCDIR)/md5.c \
@@ -110,17 +112,19 @@
112 diff_.c \
113 diffcmd_.c \
114 doc_.c \
115 encode_.c \
116 event_.c \
117 export_.c \
118 file_.c \
119 finfo_.c \
120 graph_.c \
121 http_.c \
122 http_socket_.c \
123 http_ssl_.c \
124 http_transport_.c \
125 import_.c \
126 info_.c \
127 login_.c \
128 main_.c \
129 manifest_.c \
130 md5_.c \
@@ -184,17 +188,19 @@
188 $(OBJDIR)/diff.o \
189 $(OBJDIR)/diffcmd.o \
190 $(OBJDIR)/doc.o \
191 $(OBJDIR)/encode.o \
192 $(OBJDIR)/event.o \
193 $(OBJDIR)/export.o \
194 $(OBJDIR)/file.o \
195 $(OBJDIR)/finfo.o \
196 $(OBJDIR)/graph.o \
197 $(OBJDIR)/http.o \
198 $(OBJDIR)/http_socket.o \
199 $(OBJDIR)/http_ssl.o \
200 $(OBJDIR)/http_transport.o \
201 $(OBJDIR)/import.o \
202 $(OBJDIR)/info.o \
203 $(OBJDIR)/login.o \
204 $(OBJDIR)/main.o \
205 $(OBJDIR)/manifest.o \
206 $(OBJDIR)/md5.o \
@@ -278,16 +284,16 @@
284 # noop
285
286 clean:
287 rm -f $(OBJDIR)/*.o *_.c $(APPNAME) VERSION.h
288 rm -f translate makeheaders mkindex page_index.h headers
289 rm -f add.h allrepo.h attach.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h event.h export.h file.h finfo.h graph.h http.h http_socket.h http_ssl.h http_transport.h import.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h popen.h pqueue.h printf.h rebuild.h report.h rss.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h
290
291 page_index.h: $(TRANS_SRC) mkindex
292 ./mkindex $(TRANS_SRC) >$@
293 headers: page_index.h makeheaders VERSION.h
294 ./makeheaders add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h
295 touch headers
296 headers: Makefile
297 Makefile:
298 add_.c: $(SRCDIR)/add.c translate
299 ./translate $(SRCDIR)/add.c >add_.c
@@ -462,10 +468,17 @@
468
469 $(OBJDIR)/event.o: event_.c event.h $(SRCDIR)/config.h
470 $(XTCC) -o $(OBJDIR)/event.o -c event_.c
471
472 event.h: headers
473 export_.c: $(SRCDIR)/export.c translate
474 ./translate $(SRCDIR)/export.c >export_.c
475
476 $(OBJDIR)/export.o: export_.c export.h $(SRCDIR)/config.h
477 $(XTCC) -o $(OBJDIR)/export.o -c export_.c
478
479 export.h: headers
480 file_.c: $(SRCDIR)/file.c translate
481 ./translate $(SRCDIR)/file.c >file_.c
482
483 $(OBJDIR)/file.o: file_.c file.h $(SRCDIR)/config.h
484 $(XTCC) -o $(OBJDIR)/file.o -c file_.c
@@ -511,10 +524,17 @@
524
525 $(OBJDIR)/http_transport.o: http_transport_.c http_transport.h $(SRCDIR)/config.h
526 $(XTCC) -o $(OBJDIR)/http_transport.o -c http_transport_.c
527
528 http_transport.h: headers
529 import_.c: $(SRCDIR)/import.c translate
530 ./translate $(SRCDIR)/import.c >import_.c
531
532 $(OBJDIR)/import.o: import_.c import.h $(SRCDIR)/config.h
533 $(XTCC) -o $(OBJDIR)/import.o -c import_.c
534
535 import.h: headers
536 info_.c: $(SRCDIR)/info.c translate
537 ./translate $(SRCDIR)/info.c >info_.c
538
539 $(OBJDIR)/info.o: info_.c info.h $(SRCDIR)/config.h
540 $(XTCC) -o $(OBJDIR)/info.o -c info_.c
541
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -30,16 +30,18 @@
3030
diff
3131
diffcmd
3232
doc
3333
encode
3434
event
35
+ export
3536
file
3637
finfo
3738
graph
3839
http
3940
http_socket
4041
http_transport
42
+ import
4143
info
4244
login
4345
main
4446
manifest
4547
md5
4648
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -30,16 +30,18 @@
30 diff
31 diffcmd
32 doc
33 encode
34 event
 
35 file
36 finfo
37 graph
38 http
39 http_socket
40 http_transport
 
41 info
42 login
43 main
44 manifest
45 md5
46
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -30,16 +30,18 @@
30 diff
31 diffcmd
32 doc
33 encode
34 event
35 export
36 file
37 finfo
38 graph
39 http
40 http_socket
41 http_transport
42 import
43 info
44 login
45 main
46 manifest
47 md5
48
+19 -9
--- src/vfile.c
+++ src/vfile.c
@@ -24,10 +24,28 @@
2424
#if defined(__DMC__)
2525
#include "dirent.h"
2626
#else
2727
#include <dirent.h>
2828
#endif
29
+
30
+/*
31
+** The input is guaranteed to be a 40-character well-formed UUID.
32
+** Find its rid.
33
+*/
34
+int fast_uuid_to_rid(const char *zUuid){
35
+ static Stmt q;
36
+ int rid;
37
+ db_static_prepare(&q, "SELECT rid FROM blob WHERE uuid=:uuid");
38
+ db_bind_text(&q, ":uuid", zUuid);
39
+ if( db_step(&q)==SQLITE_ROW ){
40
+ rid = db_column_int(&q, 0);
41
+ }else{
42
+ rid = 0;
43
+ }
44
+ db_reset(&q);
45
+ return rid;
46
+}
2947
3048
/*
3149
** Given a UUID, return the corresponding record ID. If the UUID
3250
** does not exist, then return 0.
3351
**
@@ -37,27 +55,19 @@
3755
** If the UUID is not found and phantomize is 1, then attempt to
3856
** create a phantom record.
3957
*/
4058
int uuid_to_rid(const char *zUuid, int phantomize){
4159
int rid, sz;
42
- static Stmt q;
4360
char z[UUID_SIZE+1];
4461
4562
sz = strlen(zUuid);
4663
if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){
4764
return 0;
4865
}
4966
strcpy(z, zUuid);
5067
canonical16(z, sz);
51
- db_static_prepare(&q, "SELECT rid FROM blob WHERE uuid=:uuid");
52
- db_bind_text(&q, ":uuid", z);
53
- if( db_step(&q)==SQLITE_ROW ){
54
- rid = db_column_int(&q, 0);
55
- }else{
56
- rid = 0;
57
- }
58
- db_reset(&q);
68
+ rid = fast_uuid_to_rid(z);
5969
if( rid==0 && phantomize ){
6070
rid = content_new(zUuid);
6171
}
6272
return rid;
6373
}
6474
--- src/vfile.c
+++ src/vfile.c
@@ -24,10 +24,28 @@
24 #if defined(__DMC__)
25 #include "dirent.h"
26 #else
27 #include <dirent.h>
28 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
30 /*
31 ** Given a UUID, return the corresponding record ID. If the UUID
32 ** does not exist, then return 0.
33 **
@@ -37,27 +55,19 @@
37 ** If the UUID is not found and phantomize is 1, then attempt to
38 ** create a phantom record.
39 */
40 int uuid_to_rid(const char *zUuid, int phantomize){
41 int rid, sz;
42 static Stmt q;
43 char z[UUID_SIZE+1];
44
45 sz = strlen(zUuid);
46 if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){
47 return 0;
48 }
49 strcpy(z, zUuid);
50 canonical16(z, sz);
51 db_static_prepare(&q, "SELECT rid FROM blob WHERE uuid=:uuid");
52 db_bind_text(&q, ":uuid", z);
53 if( db_step(&q)==SQLITE_ROW ){
54 rid = db_column_int(&q, 0);
55 }else{
56 rid = 0;
57 }
58 db_reset(&q);
59 if( rid==0 && phantomize ){
60 rid = content_new(zUuid);
61 }
62 return rid;
63 }
64
--- src/vfile.c
+++ src/vfile.c
@@ -24,10 +24,28 @@
24 #if defined(__DMC__)
25 #include "dirent.h"
26 #else
27 #include <dirent.h>
28 #endif
29
30 /*
31 ** The input is guaranteed to be a 40-character well-formed UUID.
32 ** Find its rid.
33 */
34 int fast_uuid_to_rid(const char *zUuid){
35 static Stmt q;
36 int rid;
37 db_static_prepare(&q, "SELECT rid FROM blob WHERE uuid=:uuid");
38 db_bind_text(&q, ":uuid", zUuid);
39 if( db_step(&q)==SQLITE_ROW ){
40 rid = db_column_int(&q, 0);
41 }else{
42 rid = 0;
43 }
44 db_reset(&q);
45 return rid;
46 }
47
48 /*
49 ** Given a UUID, return the corresponding record ID. If the UUID
50 ** does not exist, then return 0.
51 **
@@ -37,27 +55,19 @@
55 ** If the UUID is not found and phantomize is 1, then attempt to
56 ** create a phantom record.
57 */
58 int uuid_to_rid(const char *zUuid, int phantomize){
59 int rid, sz;
 
60 char z[UUID_SIZE+1];
61
62 sz = strlen(zUuid);
63 if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){
64 return 0;
65 }
66 strcpy(z, zUuid);
67 canonical16(z, sz);
68 rid = fast_uuid_to_rid(z);
 
 
 
 
 
 
 
69 if( rid==0 && phantomize ){
70 rid = content_new(zUuid);
71 }
72 return rid;
73 }
74

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button