From 610d911413759638069af6247a133de0c916e9c0 Mon Sep 17 00:00:00 2001
From: Seungyoung Kim
Date: Wed, 4 Mar 2015 04:59:12 -0800
Subject: [PATCH] Update doc.
---
.../dir_445263fafd9544f9ee19804b2b65121e.html | 6 +-
.../dir_5aa2c741d78642de87e50b40b6f339a9.html | 6 +-
.../dir_5da80c67b0d1e58ff4c3e0614ce822b4.html | 6 +-
.../dir_df38b2a5d584e0f6066b4518b95c638b.html | 6 +-
doc/html/doxygen.css | 212 +-
doc/html/dynsections.js | 52 +-
doc/html/files.html | 54 +-
doc/html/globals.html | 40 +-
.../{globals_0x61.html => globals_a.html} | 42 +-
.../{globals_0x62.html => globals_b.html} | 42 +-
.../{globals_0x63.html => globals_c.html} | 42 +-
.../{globals_0x64.html => globals_d.html} | 42 +-
doc/html/globals_defs.html | 6 +-
doc/html/globals_dup.js | 34 +-
.../{globals_0x65.html => globals_e.html} | 42 +-
.../{globals_0x66.html => globals_f.html} | 42 +-
doc/html/globals_func.html | 40 +-
doc/html/globals_func.js | 34 +-
...als_func_0x61.html => globals_func_a.html} | 42 +-
...als_func_0x62.html => globals_func_b.html} | 42 +-
...als_func_0x63.html => globals_func_c.html} | 42 +-
...als_func_0x64.html => globals_func_d.html} | 42 +-
...als_func_0x65.html => globals_func_e.html} | 42 +-
...als_func_0x66.html => globals_func_f.html} | 42 +-
...als_func_0x67.html => globals_func_g.html} | 42 +-
...als_func_0x68.html => globals_func_h.html} | 42 +-
...als_func_0x6c.html => globals_func_l.html} | 42 +-
...als_func_0x6f.html => globals_func_o.html} | 42 +-
...als_func_0x70.html => globals_func_p.html} | 42 +-
...als_func_0x71.html => globals_func_q.html} | 42 +-
...als_func_0x72.html => globals_func_r.html} | 42 +-
...als_func_0x73.html => globals_func_s.html} | 42 +-
...als_func_0x74.html => globals_func_t.html} | 42 +-
...als_func_0x75.html => globals_func_u.html} | 42 +-
...als_func_0x77.html => globals_func_w.html} | 42 +-
.../{globals_0x67.html => globals_g.html} | 42 +-
.../{globals_0x68.html => globals_h.html} | 42 +-
.../{globals_0x6c.html => globals_l.html} | 42 +-
.../{globals_0x6f.html => globals_o.html} | 42 +-
.../{globals_0x70.html => globals_p.html} | 42 +-
.../{globals_0x71.html => globals_q.html} | 42 +-
.../{globals_0x72.html => globals_r.html} | 42 +-
.../{globals_0x73.html => globals_s.html} | 42 +-
.../{globals_0x74.html => globals_t.html} | 42 +-
.../{globals_0x75.html => globals_u.html} | 42 +-
.../{globals_0x77.html => globals_w.html} | 42 +-
doc/html/index.html | 6 +-
doc/html/jquery.js | 85 +-
doc/html/navtree.css | 2 +-
doc/html/navtree.js | 155 +-
doc/html/navtreeindex0.js | 98 +-
doc/html/navtreeindex1.js | 1 +
doc/html/qaconf_8c.html | 44 +-
doc/html/qaconf_8c_source.html | 71 +-
doc/html/qconfig_8c.html | 20 +-
doc/html/qconfig_8c_source.html | 50 +-
doc/html/qcount_8c.html | 20 +-
doc/html/qcount_8c_source.html | 22 +-
doc/html/qdatabase_8c.html | 78 +-
doc/html/qdatabase_8c_source.html | 184 +-
doc/html/qencode_8c.html | 34 +-
doc/html/qencode_8c_source.html | 40 +-
doc/html/qfile_8c.html | 66 +-
doc/html/qfile_8c_source.html | 82 +-
doc/html/qhash_8c.html | 34 +-
doc/html/qhash_8c_source.html | 27 +-
doc/html/qhasharr_8c.html | 115 +-
doc/html/qhasharr_8c.js | 1 +
doc/html/qhasharr_8c_source.html | 1855 +++++++++--------
doc/html/qhashtbl_8c.html | 104 +-
doc/html/qhashtbl_8c_source.html | 1198 +++++------
doc/html/qhttpclient_8c.html | 110 +-
doc/html/qhttpclient_8c_source.html | 541 ++---
doc/html/qio_8c.html | 22 +-
doc/html/qio_8c_source.html | 44 +-
doc/html/qlist_8c.html | 116 +-
doc/html/qlist_8c_source.html | 269 +--
doc/html/qlisttbl_8c.html | 102 +-
doc/html/qlisttbl_8c_source.html | 262 +--
doc/html/qlog_8c.html | 26 +-
doc/html/qlog_8c_source.html | 55 +-
doc/html/qqueue_8c.html | 92 +-
doc/html/qqueue_8c_source.html | 123 +-
doc/html/qsem_8c.html | 42 +-
doc/html/qsem_8c_source.html | 42 +-
doc/html/qshm_8c.html | 22 +-
doc/html/qshm_8c_source.html | 23 +-
doc/html/qsocket_8c.html | 14 +-
doc/html/qsocket_8c_source.html | 29 +-
doc/html/qstack_8c.html | 96 +-
doc/html/qstack_8c_source.html | 123 +-
doc/html/qstring_8c.html | 68 +-
doc/html/qstring_8c_source.html | 91 +-
doc/html/qsystem_8c.html | 10 +-
doc/html/qsystem_8c_source.html | 16 +-
doc/html/qtime_8c.html | 52 +-
doc/html/qtime_8c_source.html | 43 +-
doc/html/qtokenbucket_8c.html | 18 +-
doc/html/qtokenbucket_8c_source.html | 24 +-
doc/html/qvector_8c.html | 48 +-
doc/html/qvector_8c_source.html | 84 +-
doc/html/resize.js | 28 +-
doc/html/tab_b.png | Bin 170 -> 169 bytes
103 files changed, 4862 insertions(+), 4089 deletions(-)
rename doc/html/{globals_0x61.html => globals_a.html} (73%)
rename doc/html/{globals_0x62.html => globals_b.html} (69%)
rename doc/html/{globals_0x63.html => globals_c.html} (74%)
rename doc/html/{globals_0x64.html => globals_d.html} (74%)
rename doc/html/{globals_0x65.html => globals_e.html} (72%)
rename doc/html/{globals_0x66.html => globals_f.html} (75%)
rename doc/html/{globals_func_0x61.html => globals_func_a.html} (71%)
rename doc/html/{globals_func_0x62.html => globals_func_b.html} (67%)
rename doc/html/{globals_func_0x63.html => globals_func_c.html} (72%)
rename doc/html/{globals_func_0x64.html => globals_func_d.html} (72%)
rename doc/html/{globals_func_0x65.html => globals_func_e.html} (70%)
rename doc/html/{globals_func_0x66.html => globals_func_f.html} (73%)
rename doc/html/{globals_func_0x67.html => globals_func_g.html} (79%)
rename doc/html/{globals_func_0x68.html => globals_func_h.html} (67%)
rename doc/html/{globals_func_0x6c.html => globals_func_l.html} (69%)
rename doc/html/{globals_func_0x6f.html => globals_func_o.html} (67%)
rename doc/html/{globals_func_0x70.html => globals_func_p.html} (80%)
rename doc/html/{globals_func_0x71.html => globals_func_q.html} (90%)
rename doc/html/{globals_func_0x72.html => globals_func_r.html} (76%)
rename doc/html/{globals_func_0x73.html => globals_func_s.html} (77%)
rename doc/html/{globals_func_0x74.html => globals_func_t.html} (69%)
rename doc/html/{globals_func_0x75.html => globals_func_u.html} (68%)
rename doc/html/{globals_func_0x77.html => globals_func_w.html} (68%)
rename doc/html/{globals_0x67.html => globals_g.html} (80%)
rename doc/html/{globals_0x68.html => globals_h.html} (69%)
rename doc/html/{globals_0x6c.html => globals_l.html} (71%)
rename doc/html/{globals_0x6f.html => globals_o.html} (70%)
rename doc/html/{globals_0x70.html => globals_p.html} (81%)
rename doc/html/{globals_0x71.html => globals_q.html} (91%)
rename doc/html/{globals_0x72.html => globals_r.html} (78%)
rename doc/html/{globals_0x73.html => globals_s.html} (79%)
rename doc/html/{globals_0x74.html => globals_t.html} (71%)
rename doc/html/{globals_0x75.html => globals_u.html} (70%)
rename doc/html/{globals_0x77.html => globals_w.html} (70%)
diff --git a/doc/html/dir_445263fafd9544f9ee19804b2b65121e.html b/doc/html/dir_445263fafd9544f9ee19804b2b65121e.html
index bef7050a..e98dc05c 100644
--- a/doc/html/dir_445263fafd9544f9ee19804b2b65121e.html
+++ b/doc/html/dir_445263fafd9544f9ee19804b2b65121e.html
@@ -3,6 +3,7 @@
+
qlibc: extensions Directory Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
diff --git a/doc/html/dir_5aa2c741d78642de87e50b40b6f339a9.html b/doc/html/dir_5aa2c741d78642de87e50b40b6f339a9.html
index 79f9afb6..1b62718f 100644
--- a/doc/html/dir_5aa2c741d78642de87e50b40b6f339a9.html
+++ b/doc/html/dir_5aa2c741d78642de87e50b40b6f339a9.html
@@ -3,6 +3,7 @@
+
qlibc: containers Directory Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
diff --git a/doc/html/dir_5da80c67b0d1e58ff4c3e0614ce822b4.html b/doc/html/dir_5da80c67b0d1e58ff4c3e0614ce822b4.html
index 29e0defc..200d7f7f 100644
--- a/doc/html/dir_5da80c67b0d1e58ff4c3e0614ce822b4.html
+++ b/doc/html/dir_5da80c67b0d1e58ff4c3e0614ce822b4.html
@@ -3,6 +3,7 @@
+
qlibc: ipc Directory Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
diff --git a/doc/html/dir_df38b2a5d584e0f6066b4518b95c638b.html b/doc/html/dir_df38b2a5d584e0f6066b4518b95c638b.html
index 2dc54449..fc16c77a 100644
--- a/doc/html/dir_df38b2a5d584e0f6066b4518b95c638b.html
+++ b/doc/html/dir_df38b2a5d584e0f6066b4518b95c638b.html
@@ -3,6 +3,7 @@
+
qlibc: utilities Directory Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css
index 2642e8f9..f0f36f89 100644
--- a/doc/html/doxygen.css
+++ b/doc/html/doxygen.css
@@ -1,7 +1,7 @@
-/* The standard CSS for doxygen */
+/* The standard CSS for doxygen 1.8.6 */
body, table, div, p, dl {
- font: 400 14px/19px Roboto,sans-serif;
+ font: 400 14px/22px Roboto,sans-serif;
}
/* @group Heading Levels */
@@ -11,6 +11,7 @@ h1.groupheader {
}
.title {
+ font: 400 14px/28px Roboto,sans-serif;
font-size: 150%;
font-weight: bold;
margin: 10px 2px;
@@ -55,10 +56,14 @@ div.multicol {
-webkit-column-count: 3;
}
-p.startli, p.startdd, p.starttd {
+p.startli, p.startdd {
margin-top: 2px;
}
+p.starttd {
+ margin-top: 0px;
+}
+
p.endli {
margin-bottom: 0px;
}
@@ -140,11 +145,11 @@ a.el {
a.elRef {
}
-a.code, a.code:visited {
+a.code, a.code:visited, a.line, a.line:visited {
color: #4665A2;
}
-a.codeRef, a.codeRef:visited {
+a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited {
color: #4665A2;
}
@@ -168,8 +173,8 @@ pre.fragment {
}
div.fragment {
- padding: 4px;
- margin: 4px;
+ padding: 4px 6px;
+ margin: 4px 8px 4px 2px;
background-color: #FBFCFD;
border: 1px solid #C4CFE5;
}
@@ -687,6 +692,7 @@ div.directory {
.directory td.entry {
white-space: nowrap;
padding-right: 6px;
+ padding-top: 3px;
}
.directory td.entry a {
@@ -763,7 +769,7 @@ table.doxtable th {
}
table.fieldtable {
- width: 100%;
+ /*width: 100%;*/
margin-bottom: 10px;
border: 1px solid #A8B8D9;
border-spacing: 0px;
@@ -786,9 +792,21 @@ table.fieldtable {
vertical-align: top;
}
+.fieldtable td.fieldname {
+ padding-top: 3px;
+}
+
.fieldtable td.fielddoc {
border-bottom: 1px solid #A8B8D9;
- width: 100%;
+ /*width: 100%;*/
+}
+
+.fieldtable td.fielddoc p:first-child {
+ margin-top: 0px;
+}
+
+.fieldtable td.fielddoc p:last-child {
+ margin-bottom: 2px;
}
.fieldtable tr:last-child td {
@@ -1051,6 +1069,11 @@ dl.section dd {
text-align: center;
}
+.diagraph
+{
+ text-align: center;
+}
+
.caption
{
font-weight: bold;
@@ -1151,6 +1174,177 @@ tr.heading h2 {
margin-bottom: 4px;
}
+/* tooltip related style info */
+
+.ttc {
+ position: absolute;
+ display: none;
+}
+
+#powerTip {
+ cursor: default;
+ white-space: nowrap;
+ background-color: white;
+ border: 1px solid gray;
+ border-radius: 4px 4px 4px 4px;
+ box-shadow: 1px 1px 7px gray;
+ display: none;
+ font-size: smaller;
+ max-width: 80%;
+ opacity: 0.9;
+ padding: 1ex 1em 1em;
+ position: absolute;
+ z-index: 2147483647;
+}
+
+#powerTip div.ttdoc {
+ color: grey;
+ font-style: italic;
+}
+
+#powerTip div.ttname a {
+ font-weight: bold;
+}
+
+#powerTip div.ttname {
+ font-weight: bold;
+}
+
+#powerTip div.ttdeci {
+ color: #006318;
+}
+
+#powerTip div {
+ margin: 0px;
+ padding: 0px;
+ font: 12px/16px Roboto,sans-serif;
+}
+
+#powerTip:before, #powerTip:after {
+ content: "";
+ position: absolute;
+ margin: 0px;
+}
+
+#powerTip.n:after, #powerTip.n:before,
+#powerTip.s:after, #powerTip.s:before,
+#powerTip.w:after, #powerTip.w:before,
+#powerTip.e:after, #powerTip.e:before,
+#powerTip.ne:after, #powerTip.ne:before,
+#powerTip.se:after, #powerTip.se:before,
+#powerTip.nw:after, #powerTip.nw:before,
+#powerTip.sw:after, #powerTip.sw:before {
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+}
+
+#powerTip.n:after, #powerTip.s:after,
+#powerTip.w:after, #powerTip.e:after,
+#powerTip.nw:after, #powerTip.ne:after,
+#powerTip.sw:after, #powerTip.se:after {
+ border-color: rgba(255, 255, 255, 0);
+}
+
+#powerTip.n:before, #powerTip.s:before,
+#powerTip.w:before, #powerTip.e:before,
+#powerTip.nw:before, #powerTip.ne:before,
+#powerTip.sw:before, #powerTip.se:before {
+ border-color: rgba(128, 128, 128, 0);
+}
+
+#powerTip.n:after, #powerTip.n:before,
+#powerTip.ne:after, #powerTip.ne:before,
+#powerTip.nw:after, #powerTip.nw:before {
+ top: 100%;
+}
+
+#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after {
+ border-top-color: #ffffff;
+ border-width: 10px;
+ margin: 0px -10px;
+}
+#powerTip.n:before {
+ border-top-color: #808080;
+ border-width: 11px;
+ margin: 0px -11px;
+}
+#powerTip.n:after, #powerTip.n:before {
+ left: 50%;
+}
+
+#powerTip.nw:after, #powerTip.nw:before {
+ right: 14px;
+}
+
+#powerTip.ne:after, #powerTip.ne:before {
+ left: 14px;
+}
+
+#powerTip.s:after, #powerTip.s:before,
+#powerTip.se:after, #powerTip.se:before,
+#powerTip.sw:after, #powerTip.sw:before {
+ bottom: 100%;
+}
+
+#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after {
+ border-bottom-color: #ffffff;
+ border-width: 10px;
+ margin: 0px -10px;
+}
+
+#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before {
+ border-bottom-color: #808080;
+ border-width: 11px;
+ margin: 0px -11px;
+}
+
+#powerTip.s:after, #powerTip.s:before {
+ left: 50%;
+}
+
+#powerTip.sw:after, #powerTip.sw:before {
+ right: 14px;
+}
+
+#powerTip.se:after, #powerTip.se:before {
+ left: 14px;
+}
+
+#powerTip.e:after, #powerTip.e:before {
+ left: 100%;
+}
+#powerTip.e:after {
+ border-left-color: #ffffff;
+ border-width: 10px;
+ top: 50%;
+ margin-top: -10px;
+}
+#powerTip.e:before {
+ border-left-color: #808080;
+ border-width: 11px;
+ top: 50%;
+ margin-top: -11px;
+}
+
+#powerTip.w:after, #powerTip.w:before {
+ right: 100%;
+}
+#powerTip.w:after {
+ border-right-color: #ffffff;
+ border-width: 10px;
+ top: 50%;
+ margin-top: -10px;
+}
+#powerTip.w:before {
+ border-right-color: #808080;
+ border-width: 11px;
+ top: 50%;
+ margin-top: -11px;
+}
+
@media print
{
#top { display: none; }
diff --git a/doc/html/dynsections.js b/doc/html/dynsections.js
index 116542f1..2f15470d 100644
--- a/doc/html/dynsections.js
+++ b/doc/html/dynsections.js
@@ -44,24 +44,43 @@ function toggleLevel(level)
});
updateStripes();
}
-function toggleFolder(id)
+
+function toggleFolder(id)
{
- var n = $('[id^=row_'+id+']');
- var i = $('[id^=img_'+id+']');
- var a = $('[id^=arr_'+id+']');
- var c = n.slice(1);
- if (c.filter(':first').is(':visible')===true) {
- i.attr('src','ftv2folderclosed.png');
- a.attr('src','ftv2pnode.png');
- c.hide();
- } else {
- i.attr('src','ftv2folderopen.png');
- a.attr('src','ftv2mnode.png');
- c.show();
+ //The clicked row
+ var currentRow = $('#row_'+id);
+ var currentRowImages = currentRow.find("img");
+
+ //All rows after the clicked row
+ var rows = currentRow.nextAll("tr");
+
+ //Only match elements AFTER this one (can't hide elements before)
+ var childRows = rows.filter(function() {
+ var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
+ return this.id.match(re);
+ });
+
+ //First row is visible we are HIDING
+ if (childRows.filter(':first').is(':visible')===true) {
+ currentRowImages.filter("[id^=arr]").attr('src', 'ftv2pnode.png');
+ currentRowImages.filter("[id^=img]").attr('src', 'ftv2folderclosed.png');
+ rows.filter("[id^=row_"+id+"]").hide();
+ } else { //We are SHOWING
+ //All sub images
+ var childImages = childRows.find("img");
+ var childImg = childImages.filter("[id^=img]");
+ var childArr = childImages.filter("[id^=arr]");
+
+ currentRow.find("[id^=arr]").attr('src', 'ftv2mnode.png'); //open row
+ currentRow.find("[id^=img]").attr('src', 'ftv2folderopen.png'); //open row
+ childImg.attr('src','ftv2folderclosed.png'); //children closed
+ childArr.attr('src','ftv2pnode.png'); //children closed
+ childRows.show(); //show all children
}
updateStripes();
}
+
function toggleInherit(id)
{
var rows = $('tr.inherit.'+id);
@@ -76,3 +95,10 @@ function toggleInherit(id)
}
}
+
+$(document).ready(function() {
+ $('.code,.codeRef').each(function() {
+ $(this).data('powertip',$('#'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html());
+ $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true });
+ });
+});
diff --git a/doc/html/files.html b/doc/html/files.html
index e9f436cb..5ac1dbc0 100644
--- a/doc/html/files.html
+++ b/doc/html/files.html
@@ -3,6 +3,7 @@
+
qlibc: File List
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -102,7 +104,7 @@
diff --git a/doc/html/globals.html b/doc/html/globals.html
index 7962d29f..f3da60bc 100644
--- a/doc/html/globals.html
+++ b/doc/html/globals.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -120,7 +122,7 @@
- _ -
diff --git a/doc/html/globals_0x61.html b/doc/html/globals_a.html
similarity index 73%
rename from doc/html/globals_0x61.html
rename to doc/html/globals_a.html
index 88e35cb7..dd412d84 100644
--- a/doc/html/globals_0x61.html
+++ b/doc/html/globals_a.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -120,7 +122,7 @@
- a -
diff --git a/doc/html/globals_0x62.html b/doc/html/globals_b.html
similarity index 69%
rename from doc/html/globals_0x62.html
rename to doc/html/globals_b.html
index fbea7fea..a9185ac3 100644
--- a/doc/html/globals_0x62.html
+++ b/doc/html/globals_b.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -102,7 +104,7 @@
- b -
diff --git a/doc/html/globals_0x63.html b/doc/html/globals_c.html
similarity index 74%
rename from doc/html/globals_0x63.html
rename to doc/html/globals_c.html
index e29993a5..a653d996 100644
--- a/doc/html/globals_0x63.html
+++ b/doc/html/globals_c.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -117,7 +119,7 @@
- c -
diff --git a/doc/html/globals_0x64.html b/doc/html/globals_d.html
similarity index 74%
rename from doc/html/globals_0x64.html
rename to doc/html/globals_d.html
index 38a7fa7c..e50b752b 100644
--- a/doc/html/globals_0x64.html
+++ b/doc/html/globals_d.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -118,7 +120,7 @@
- d -
diff --git a/doc/html/globals_defs.html b/doc/html/globals_defs.html
index da296926..a34d5801 100644
--- a/doc/html/globals_defs.html
+++ b/doc/html/globals_defs.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
diff --git a/doc/html/globals_dup.js b/doc/html/globals_dup.js
index 5c01c9bc..f0549e54 100644
--- a/doc/html/globals_dup.js
+++ b/doc/html/globals_dup.js
@@ -1,21 +1,21 @@
var globals_dup =
[
[ "_", "globals.html", null ],
- [ "a", "globals_0x61.html", null ],
- [ "b", "globals_0x62.html", null ],
- [ "c", "globals_0x63.html", null ],
- [ "d", "globals_0x64.html", null ],
- [ "e", "globals_0x65.html", null ],
- [ "f", "globals_0x66.html", null ],
- [ "g", "globals_0x67.html", null ],
- [ "h", "globals_0x68.html", null ],
- [ "l", "globals_0x6c.html", null ],
- [ "o", "globals_0x6f.html", null ],
- [ "p", "globals_0x70.html", null ],
- [ "q", "globals_0x71.html", null ],
- [ "r", "globals_0x72.html", null ],
- [ "s", "globals_0x73.html", null ],
- [ "t", "globals_0x74.html", null ],
- [ "u", "globals_0x75.html", null ],
- [ "w", "globals_0x77.html", null ]
+ [ "a", "globals_a.html", null ],
+ [ "b", "globals_b.html", null ],
+ [ "c", "globals_c.html", null ],
+ [ "d", "globals_d.html", null ],
+ [ "e", "globals_e.html", null ],
+ [ "f", "globals_f.html", null ],
+ [ "g", "globals_g.html", null ],
+ [ "h", "globals_h.html", null ],
+ [ "l", "globals_l.html", null ],
+ [ "o", "globals_o.html", null ],
+ [ "p", "globals_p.html", null ],
+ [ "q", "globals_q.html", null ],
+ [ "r", "globals_r.html", null ],
+ [ "s", "globals_s.html", null ],
+ [ "t", "globals_t.html", null ],
+ [ "u", "globals_u.html", null ],
+ [ "w", "globals_w.html", null ]
];
\ No newline at end of file
diff --git a/doc/html/globals_0x65.html b/doc/html/globals_e.html
similarity index 72%
rename from doc/html/globals_0x65.html
rename to doc/html/globals_e.html
index 916cb02e..13d81fb6 100644
--- a/doc/html/globals_0x65.html
+++ b/doc/html/globals_e.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -114,7 +116,7 @@
- e -
diff --git a/doc/html/globals_0x66.html b/doc/html/globals_f.html
similarity index 75%
rename from doc/html/globals_0x66.html
rename to doc/html/globals_f.html
index 069fde35..b2a2d853 100644
--- a/doc/html/globals_0x66.html
+++ b/doc/html/globals_f.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -117,7 +119,7 @@
- f -
diff --git a/doc/html/globals_func.html b/doc/html/globals_func.html
index 5413f3ff..caed9b23 100644
--- a/doc/html/globals_func.html
+++ b/doc/html/globals_func.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -120,7 +122,7 @@ - _ -
diff --git a/doc/html/globals_func.js b/doc/html/globals_func.js
index 30f0735e..69727390 100644
--- a/doc/html/globals_func.js
+++ b/doc/html/globals_func.js
@@ -1,21 +1,21 @@
var globals_func =
[
[ "_", "globals_func.html", null ],
- [ "a", "globals_func_0x61.html", null ],
- [ "b", "globals_func_0x62.html", null ],
- [ "c", "globals_func_0x63.html", null ],
- [ "d", "globals_func_0x64.html", null ],
- [ "e", "globals_func_0x65.html", null ],
- [ "f", "globals_func_0x66.html", null ],
- [ "g", "globals_func_0x67.html", null ],
- [ "h", "globals_func_0x68.html", null ],
- [ "l", "globals_func_0x6c.html", null ],
- [ "o", "globals_func_0x6f.html", null ],
- [ "p", "globals_func_0x70.html", null ],
- [ "q", "globals_func_0x71.html", null ],
- [ "r", "globals_func_0x72.html", null ],
- [ "s", "globals_func_0x73.html", null ],
- [ "t", "globals_func_0x74.html", null ],
- [ "u", "globals_func_0x75.html", null ],
- [ "w", "globals_func_0x77.html", null ]
+ [ "a", "globals_func_a.html", null ],
+ [ "b", "globals_func_b.html", null ],
+ [ "c", "globals_func_c.html", null ],
+ [ "d", "globals_func_d.html", null ],
+ [ "e", "globals_func_e.html", null ],
+ [ "f", "globals_func_f.html", null ],
+ [ "g", "globals_func_g.html", null ],
+ [ "h", "globals_func_h.html", null ],
+ [ "l", "globals_func_l.html", null ],
+ [ "o", "globals_func_o.html", null ],
+ [ "p", "globals_func_p.html", null ],
+ [ "q", "globals_func_q.html", null ],
+ [ "r", "globals_func_r.html", null ],
+ [ "s", "globals_func_s.html", null ],
+ [ "t", "globals_func_t.html", null ],
+ [ "u", "globals_func_u.html", null ],
+ [ "w", "globals_func_w.html", null ]
];
\ No newline at end of file
diff --git a/doc/html/globals_func_0x61.html b/doc/html/globals_func_a.html
similarity index 71%
rename from doc/html/globals_func_0x61.html
rename to doc/html/globals_func_a.html
index e8d3c305..221478f4 100644
--- a/doc/html/globals_func_0x61.html
+++ b/doc/html/globals_func_a.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -120,7 +122,7 @@
- a -
diff --git a/doc/html/globals_func_0x62.html b/doc/html/globals_func_b.html
similarity index 67%
rename from doc/html/globals_func_0x62.html
rename to doc/html/globals_func_b.html
index 22b4c45b..6d378fb5 100644
--- a/doc/html/globals_func_0x62.html
+++ b/doc/html/globals_func_b.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -102,7 +104,7 @@
- b -
diff --git a/doc/html/globals_func_0x63.html b/doc/html/globals_func_c.html
similarity index 72%
rename from doc/html/globals_func_0x63.html
rename to doc/html/globals_func_c.html
index c1e6411d..ea50b3e4 100644
--- a/doc/html/globals_func_0x63.html
+++ b/doc/html/globals_func_c.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -117,7 +119,7 @@
- c -
diff --git a/doc/html/globals_func_0x64.html b/doc/html/globals_func_d.html
similarity index 72%
rename from doc/html/globals_func_0x64.html
rename to doc/html/globals_func_d.html
index b07773bb..fe23cd59 100644
--- a/doc/html/globals_func_0x64.html
+++ b/doc/html/globals_func_d.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -115,7 +117,7 @@
- d -
diff --git a/doc/html/globals_func_0x65.html b/doc/html/globals_func_e.html
similarity index 70%
rename from doc/html/globals_func_0x65.html
rename to doc/html/globals_func_e.html
index 20772444..940bf606 100644
--- a/doc/html/globals_func_0x65.html
+++ b/doc/html/globals_func_e.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -114,7 +116,7 @@
- e -
diff --git a/doc/html/globals_func_0x66.html b/doc/html/globals_func_f.html
similarity index 73%
rename from doc/html/globals_func_0x66.html
rename to doc/html/globals_func_f.html
index f4a614d3..f5907f33 100644
--- a/doc/html/globals_func_0x66.html
+++ b/doc/html/globals_func_f.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -117,7 +119,7 @@
- f -
diff --git a/doc/html/globals_func_0x67.html b/doc/html/globals_func_g.html
similarity index 79%
rename from doc/html/globals_func_0x67.html
rename to doc/html/globals_func_g.html
index 7dac1297..0d0d4ba5 100644
--- a/doc/html/globals_func_0x67.html
+++ b/doc/html/globals_func_g.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -150,7 +152,7 @@
- g -
diff --git a/doc/html/globals_func_0x68.html b/doc/html/globals_func_h.html
similarity index 67%
rename from doc/html/globals_func_0x68.html
rename to doc/html/globals_func_h.html
index d5d01b97..e53209a9 100644
--- a/doc/html/globals_func_0x68.html
+++ b/doc/html/globals_func_h.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -102,7 +104,7 @@
- h -
diff --git a/doc/html/globals_func_0x6c.html b/doc/html/globals_func_l.html
similarity index 69%
rename from doc/html/globals_func_0x6c.html
rename to doc/html/globals_func_l.html
index 1f79a2cb..736e6a0d 100644
--- a/doc/html/globals_func_0x6c.html
+++ b/doc/html/globals_func_l.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -107,7 +109,7 @@
- l -
diff --git a/doc/html/globals_func_0x6f.html b/doc/html/globals_func_o.html
similarity index 67%
rename from doc/html/globals_func_0x6f.html
rename to doc/html/globals_func_o.html
index 378e7545..4c1864e4 100644
--- a/doc/html/globals_func_0x6f.html
+++ b/doc/html/globals_func_o.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -103,7 +105,7 @@
- o -
diff --git a/doc/html/globals_func_0x70.html b/doc/html/globals_func_p.html
similarity index 80%
rename from doc/html/globals_func_0x70.html
rename to doc/html/globals_func_p.html
index 160c4f1d..ee1538e7 100644
--- a/doc/html/globals_func_0x70.html
+++ b/doc/html/globals_func_p.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -161,7 +163,7 @@
- p -
diff --git a/doc/html/globals_func_0x71.html b/doc/html/globals_func_q.html
similarity index 90%
rename from doc/html/globals_func_0x71.html
rename to doc/html/globals_func_q.html
index 51adce4d..d4b3a7a7 100644
--- a/doc/html/globals_func_0x71.html
+++ b/doc/html/globals_func_q.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -408,7 +410,7 @@
- q -
diff --git a/doc/html/globals_func_0x72.html b/doc/html/globals_func_r.html
similarity index 76%
rename from doc/html/globals_func_0x72.html
rename to doc/html/globals_func_r.html
index 05517f3a..f8fbc970 100644
--- a/doc/html/globals_func_0x72.html
+++ b/doc/html/globals_func_r.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -146,7 +148,7 @@
- r -
diff --git a/doc/html/globals_func_0x73.html b/doc/html/globals_func_s.html
similarity index 77%
rename from doc/html/globals_func_0x73.html
rename to doc/html/globals_func_s.html
index c8872b23..cad0e257 100644
--- a/doc/html/globals_func_0x73.html
+++ b/doc/html/globals_func_s.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -146,7 +148,7 @@
- s -
diff --git a/doc/html/globals_func_0x74.html b/doc/html/globals_func_t.html
similarity index 69%
rename from doc/html/globals_func_0x74.html
rename to doc/html/globals_func_t.html
index f4fc6349..42014db7 100644
--- a/doc/html/globals_func_0x74.html
+++ b/doc/html/globals_func_t.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -107,7 +109,7 @@
- t -
diff --git a/doc/html/globals_func_0x75.html b/doc/html/globals_func_u.html
similarity index 68%
rename from doc/html/globals_func_0x75.html
rename to doc/html/globals_func_u.html
index cd78902e..d278e7fb 100644
--- a/doc/html/globals_func_0x75.html
+++ b/doc/html/globals_func_u.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -104,7 +106,7 @@
- u -
diff --git a/doc/html/globals_func_0x77.html b/doc/html/globals_func_w.html
similarity index 68%
rename from doc/html/globals_func_0x77.html
rename to doc/html/globals_func_w.html
index 92941a82..70aa66f8 100644
--- a/doc/html/globals_func_0x77.html
+++ b/doc/html/globals_func_w.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -106,7 +108,7 @@
- w -
diff --git a/doc/html/globals_0x67.html b/doc/html/globals_g.html
similarity index 80%
rename from doc/html/globals_0x67.html
rename to doc/html/globals_g.html
index 15d3810f..427f607c 100644
--- a/doc/html/globals_0x67.html
+++ b/doc/html/globals_g.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -150,7 +152,7 @@
- g -
diff --git a/doc/html/globals_0x68.html b/doc/html/globals_h.html
similarity index 69%
rename from doc/html/globals_0x68.html
rename to doc/html/globals_h.html
index ac181119..c43bd958 100644
--- a/doc/html/globals_0x68.html
+++ b/doc/html/globals_h.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -102,7 +104,7 @@
- h -
diff --git a/doc/html/globals_0x6c.html b/doc/html/globals_l.html
similarity index 71%
rename from doc/html/globals_0x6c.html
rename to doc/html/globals_l.html
index 7c07e2bd..d1fc5be3 100644
--- a/doc/html/globals_0x6c.html
+++ b/doc/html/globals_l.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -107,7 +109,7 @@
- l -
diff --git a/doc/html/globals_0x6f.html b/doc/html/globals_o.html
similarity index 70%
rename from doc/html/globals_0x6f.html
rename to doc/html/globals_o.html
index ccd4741c..b939fd99 100644
--- a/doc/html/globals_0x6f.html
+++ b/doc/html/globals_o.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -103,7 +105,7 @@
- o -
diff --git a/doc/html/globals_0x70.html b/doc/html/globals_p.html
similarity index 81%
rename from doc/html/globals_0x70.html
rename to doc/html/globals_p.html
index 2fced07d..590bc067 100644
--- a/doc/html/globals_0x70.html
+++ b/doc/html/globals_p.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -161,7 +163,7 @@
- p -
diff --git a/doc/html/globals_0x71.html b/doc/html/globals_q.html
similarity index 91%
rename from doc/html/globals_0x71.html
rename to doc/html/globals_q.html
index 13487081..e8ba9601 100644
--- a/doc/html/globals_0x71.html
+++ b/doc/html/globals_q.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -408,7 +410,7 @@
- q -
diff --git a/doc/html/globals_0x72.html b/doc/html/globals_r.html
similarity index 78%
rename from doc/html/globals_0x72.html
rename to doc/html/globals_r.html
index 48081b8f..a80cb37a 100644
--- a/doc/html/globals_0x72.html
+++ b/doc/html/globals_r.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -146,7 +148,7 @@
- r -
diff --git a/doc/html/globals_0x73.html b/doc/html/globals_s.html
similarity index 79%
rename from doc/html/globals_0x73.html
rename to doc/html/globals_s.html
index 02afb1e0..6777403a 100644
--- a/doc/html/globals_0x73.html
+++ b/doc/html/globals_s.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -146,7 +148,7 @@
- s -
diff --git a/doc/html/globals_0x74.html b/doc/html/globals_t.html
similarity index 71%
rename from doc/html/globals_0x74.html
rename to doc/html/globals_t.html
index 40e6eba0..006d576a 100644
--- a/doc/html/globals_0x74.html
+++ b/doc/html/globals_t.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -107,7 +109,7 @@
- t -
diff --git a/doc/html/globals_0x75.html b/doc/html/globals_u.html
similarity index 70%
rename from doc/html/globals_0x75.html
rename to doc/html/globals_u.html
index 26e20033..2606c1d2 100644
--- a/doc/html/globals_0x75.html
+++ b/doc/html/globals_u.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -104,7 +106,7 @@
- u -
diff --git a/doc/html/globals_0x77.html b/doc/html/globals_w.html
similarity index 70%
rename from doc/html/globals_0x77.html
rename to doc/html/globals_w.html
index ed3cb5e9..ea377013 100644
--- a/doc/html/globals_0x77.html
+++ b/doc/html/globals_w.html
@@ -3,6 +3,7 @@
+
qlibc: Globals
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
@@ -84,7 +86,7 @@
@@ -106,7 +108,7 @@
- w -
diff --git a/doc/html/index.html b/doc/html/index.html
index 2e4fe436..c0dc8e00 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -3,6 +3,7 @@
+
qlibc: Main Page
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
diff --git a/doc/html/jquery.js b/doc/html/jquery.js
index 78ad0bdf..d1e7eb9c 100644
--- a/doc/html/jquery.js
+++ b/doc/html/jquery.js
@@ -1,61 +1,66 @@
-/*! jQuery v1.7.1 jquery.com | jquery.org/license */
-(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;ca ",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o=""+"",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
-f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c ",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML=" ",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="
";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),
-f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
-{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>$2>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,28 +76,28 @@
qaconf_t * qaconf (void)
- Create a new configuration object.
+ Create a new configuration object. More...
static int addoptions (qaconf_t *qaconf , const qaconf_option_t *options)
- qaconf_t->addoptions() : Register option directives.
+ qaconf_t->addoptions() : Register option directives. More...
static void setdefhandler (qaconf_t *qaconf , const qaconf_cb_t *callback)
- Set default callback function.
+ Set default callback function. More...
static void setuserdata (qaconf_t *qaconf , const void *userdata)
- qaconf_t->setuserdata() : Set userdata which will be provided on callback.
+ qaconf_t->setuserdata() : Set userdata which will be provided on callback. More...
static int parse (qaconf_t *qaconf , const char *filepath, uint8_t flags)
- qaconf_t->parse() : Run parser.
+ qaconf_t->parse() : Run parser. More...
static const char * errmsg (qaconf_t *qaconf )
- qaconf_t->errmsg() : Get last error message.
+ qaconf_t->errmsg() : Get last error message. More...
static void reseterror (qaconf_t *qaconf )
- qaconf_t->reseterror() : Clear error message.
+ qaconf_t->reseterror() : Clear error message. More...
static void free_ (qaconf_t *qaconf )
- qaconf_t->free(): Release resources.
+ qaconf_t->free(): Release resources. More...
@@ -166,7 +168,7 @@
struct MyConf myconf;
-
+
if (conf == NULL) {
printf("Failed to open '" CONF_PATH "'.\n" );
return -1;
@@ -269,7 +271,7 @@
Create a new configuration object.
Returns a pointer of new qaconf_t object.
-
+
if (conf == NULL) {
}
@@ -310,7 +312,7 @@
-
qaconf_t->addoptions() : Register option directives.
+
qaconf_t->addoptions() : Register option directives.
Parameters
qaconf qaconf_t object.
@@ -334,7 +336,7 @@
};
-
+
conf->addoptions(conf, options);
(...codes goes...)
It takes an array of options as provided in the sample codes. Each option consists of 5 parameters as below
@@ -392,7 +394,7 @@
char *sample_cb(qaconf_cbdata_t *data, void *userdata) {
(...codes...)
}
-Callback function will be called with 2 arguments. One is callback data and the other one is userdata. Userdata is the data pointer set by setuserdata() .
+Callback function will be called with 2 arguments. One is callback data and the other one is userdata. Userdata is the data pointer set by setuserdata() .
Here is data structure. Arguments belong to the option can be accessed via argv variables like data->argv[1]. argv[0] is for the option name.
struct qaconf_cbdata_s {
enum qaconf_otype otype;
@@ -501,7 +503,7 @@
-
qaconf_t->setuserdata() : Set userdata which will be provided on callback.
+
qaconf_t->setuserdata() : Set userdata which will be provided on callback.
Parameters
qaconf qaconf_t object.
@@ -520,7 +522,7 @@
(...codes...)
-
+
(...codes...)
}
@@ -575,7 +577,7 @@
-
qaconf_t->parse() : Run parser.
+
qaconf_t->parse() : Run parser.
Parameters
qaconf qaconf_t object.
@@ -587,7 +589,7 @@
Returns A number of option directives parsed. -1 will be returned in case of error.
Here is a list of flags. Multiple flags can be ORed.
QAC_CASEINSENSITIVE: Option name is case-insensitive.
-QAC_IGNOREUNKNOWN : Ignore unknown option directives. This flag will be ignored if setdefhandler() has set.
+QAC_IGNOREUNKNOWN : Ignore unknown option directives. This flag will be ignored if setdefhandler() has set.
int c;
c = conf->parse(conf, "sm1.conf" , 0);
c = conf->parse(conf, "sm2.conf" , QAC_CASEINSENSITIVE);
@@ -619,7 +621,7 @@
-
qaconf_t->errmsg() : Get last error message.
+
qaconf_t->errmsg() : Get last error message.
Parameters
qaconf qaconf_t object.
@@ -659,7 +661,7 @@
diff --git a/doc/html/qaconf_8c_source.html b/doc/html/qaconf_8c_source.html
index b5955060..7af456b7 100644
--- a/doc/html/qaconf_8c_source.html
+++ b/doc/html/qaconf_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qaconf.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -274,18 +276,18 @@
209 #define MAX_LINESIZE (1024*4)
-
-
-
- 215 static int parse (qaconf_t *
qaconf ,
const char *filepath, uint8_t flags);
-
-
-
+
+
+
+ 215 static int parse (qaconf_t *
qaconf ,
const char *filepath, uint8_t flags);
+
+
+
- 220 static int _parse_inline(qaconf_t *
qaconf , FILE *fp, uint8_t flags,
+ 220 static int _parse_inline(qaconf_t *
qaconf , FILE *fp, uint8_t flags,
221 enum qaconf_section sectionid,
222 qaconf_cbdata_t *cbdata_parent);
- 223 static void _seterrmsg(qaconf_t *
qaconf ,
const char *format, ...);
+ 223 static void _seterrmsg(qaconf_t *
qaconf ,
const char *format, ...);
224 static void _free_cbdata(qaconf_cbdata_t *cbdata);
225 static int _is_str_number(
const char *s);
226 static int _is_str_bool(
const char *s);
@@ -303,9 +305,9 @@
-
+
- 243 qaconf_t *
qaconf = (qaconf_t *) malloc(
sizeof (qaconf_t));
+ 243 qaconf_t *
qaconf = (qaconf_t *) malloc(
sizeof (qaconf_t));
@@ -313,15 +315,15 @@
248 memset((
void *) (qaconf),
'\0' ,
sizeof (qaconf_t));
-
-
-
- 254 qaconf->parse =
parse ;
-
-
- 257 qaconf->free =
free_ ;
+
+
+
+ 254 qaconf->parse =
parse ;
+
+
+ 257 qaconf->free =
free_ ;
-
+
@@ -496,7 +498,7 @@
-
+
435 if (qaconf == NULL || options == NULL) {
436 _seterrmsg(qaconf,
"Invalid parameters." );
@@ -528,7 +530,7 @@
-
+
467 qaconf->defcb = callback;
@@ -564,7 +566,7 @@
-
+
503 qaconf->userdata = (
void *) userdata;
@@ -592,7 +594,7 @@
- 530 static int parse (qaconf_t *
qaconf ,
const char *filepath, uint8_t flags) {
+ 530 static int parse (qaconf_t *
qaconf ,
const char *filepath, uint8_t flags) {
532 FILE *fp = fopen(filepath,
"r" );
@@ -630,7 +632,7 @@
-
+
569 return (
const char *) qaconf->errstr;
@@ -647,7 +649,7 @@
-
+
586 if (qaconf->errstr != NULL) {
587 free(qaconf->errstr);
588 qaconf->errstr = NULL;
@@ -663,7 +665,7 @@
-
+
602 if (qaconf->filepath != NULL)
603 free(qaconf->filepath);
604 if (qaconf->errstr != NULL)
@@ -678,7 +680,7 @@
613 #define ARGV_INIT_SIZE (4)
614 #define ARGV_INCR_STEP (8)
615 #define MAX_TYPECHECK (5)
- 616 static int _parse_inline(qaconf_t *
qaconf , FILE *fp, uint8_t flags,
+ 616 static int _parse_inline(qaconf_t *
qaconf , FILE *fp, uint8_t flags,
617 enum qaconf_section sectionid,
618 qaconf_cbdata_t *cbdata_parent) {
@@ -713,7 +715,7 @@
-
+
654 if (IS_EMPTY_STR(buf) || *buf ==
'#' ) {
@@ -1087,6 +1089,15 @@
+static int parse(qaconf_t *qaconf, const char *filepath, uint8_t flags)
qaconf_t->parse(): Run parser.
+static void setuserdata(qaconf_t *qaconf, const void *userdata)
qaconf_t->setuserdata(): Set userdata which will be provided on callback.
+static int addoptions(qaconf_t *qaconf, const qaconf_option_t *options)
qaconf_t->addoptions(): Register option directives.
+static void setdefhandler(qaconf_t *qaconf, const qaconf_cb_t *callback)
Set default callback function.
+char * qstrtrim(char *str)
Remove white spaces(including CR, LF) from head and tail of the string.
+static void free_(qaconf_t *qaconf)
qaconf_t->free(): Release resources.
+qaconf_t * qaconf(void)
Create a new configuration object.
+static const char * errmsg(qaconf_t *qaconf)
qaconf_t->errmsg(): Get last error message.
+static void reseterror(qaconf_t *qaconf)
qaconf_t->reseterror(): Clear error message.
@@ -1095,7 +1106,7 @@
extensions qaconf.c
+ 1.8.6
diff --git a/doc/html/qconfig_8c.html b/doc/html/qconfig_8c.html
index 07392e20..c0a92ae7 100644
--- a/doc/html/qconfig_8c.html
+++ b/doc/html/qconfig_8c.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qconfig.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -81,10 +83,10 @@
qlisttbl_t * qconfig_parse_file (qlisttbl_t *tbl, const char *filepath, char sepchar)
- Load & parse configuration file.
+ Load & parse configuration file. More...
qlisttbl_t * qconfig_parse_str (qlisttbl_t *tbl, const char *str, char sepchar)
- Parse string.
+ Parse string. More...
@@ -137,10 +139,10 @@
@INCLUDE config.def => include 'config.def' file.
-prefix=/tmp => set static value. 'prefix' is the key for this entry.
+prefix=/tmp => set static value. 'prefix' is the key for this entry.
log=${prefix}/log => get the value from previously defined key 'prefix' .
user=${%USER} => get environment variable.
-host=${!/bin/hostname -s} => run external command and
put it
's output.
+host=${!/bin/hostname -s} => run external command and
put it
's output.
id=${user}@${host}
# now entering into ' system' section.
@@ -162,7 +164,7 @@
log = ${prefix}/log
user = unknown
host = unknown
-
diff --git a/doc/html/qconfig_8c_source.html b/doc/html/qconfig_8c_source.html
index 2826e7fa..0cbd0123 100644
--- a/doc/html/qconfig_8c_source.html
+++ b/doc/html/qconfig_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qconfig.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -188,9 +190,9 @@
-
+
-
+
@@ -215,12 +217,12 @@
151 strncpy(buf, strp + CONST_STRLEN(_INCLUDE_DIRECTIVE), len);
-
+
156 if (!(buf[0] ==
'/' || buf[0] ==
'\\' )) {
-
+
159 if (strlen(dir) + 1 + strlen(buf) >=
sizeof (buf)) {
160 DEBUG(
"Can't process %s directive." , _INCLUDE_DIRECTIVE);
@@ -235,7 +237,7 @@
- 173 if (strlen(buf) == 0 || (incdata =
qfile_load (buf, NULL)) == NULL) {
+ 173 if (strlen(buf) == 0 || (incdata =
qfile_load (buf, NULL)) == NULL) {
174 DEBUG(
"Can't process '%s%s' directive." , _INCLUDE_DIRECTIVE,
@@ -245,7 +247,7 @@
181 strncpy(buf, strp, CONST_STRLEN(_INCLUDE_DIRECTIVE) + len);
182 buf[CONST_STRLEN(_INCLUDE_DIRECTIVE) + len] =
'\0' ;
-
+
@@ -255,7 +257,7 @@
-
+
@@ -278,12 +280,12 @@
-
+
-
+
@@ -298,7 +300,7 @@
-
+
239 if ((buf[0] ==
'#' ) || (buf[0] ==
'\0' ))
@@ -311,7 +313,7 @@
247 section = strdup(buf + 1);
248 section[strlen(section) - 1] =
'\0' ;
-
+
252 if (section[0] ==
'\0' ) {
@@ -327,12 +329,12 @@
263 char *value = strdup(buf);
264 char *name = _q_makeword(value, sepchar);
-
-
+
+
269 if (section != NULL) {
- 270 char *newname =
qstrdupf (
"%s.%s" , section, name);
+ 270 char *newname =
qstrdupf (
"%s.%s" , section, name);
@@ -440,13 +442,13 @@
-
+
- 384 newstr = strdup(
qgetenv (varstr + 1,
"" ));
+ 384 newstr = strdup(
qgetenv (varstr + 1,
"" ));
@@ -462,7 +464,7 @@
397 strncpy(varstr, s, varlen + 3);
398 varstr[varlen + 3] =
'\0' ;
-
+
@@ -480,6 +482,16 @@
+qlisttbl_t * qconfig_parse_file(qlisttbl_t *tbl, const char *filepath, char sepchar)
Load & parse configuration file.
+char * qstrdupf(const char *format,...)
Duplicate a formatted string.
+qlisttbl_t * qlisttbl(int options)
Create a new Q_LIST linked-list container.
+const char * qgetenv(const char *envname, const char *defstr)
Get system environment variable.
+char * qfile_get_dir(const char *filepath)
Get directory suffix from filepath.
+char * qstrtrim(char *str)
Remove white spaces(including CR, LF) from head and tail of the string.
+qlisttbl_t * qconfig_parse_str(qlisttbl_t *tbl, const char *str, char sepchar)
Parse string.
+void * qfile_load(const char *filepath, size_t *nbytes)
Load file into memory.
+char * qstrreplace(const char *mode, char *srcstr, const char *tokstr, const char *word)
Replace string or tokens as word from source string with given mode.
+char * qsyscmd(const char *cmd)
Get the result string of external command execution.
@@ -488,7 +500,7 @@
extensions qconfig.c
+ 1.8.6
diff --git a/doc/html/qcount_8c.html b/doc/html/qcount_8c.html
index 9ea5ea8a..02fc34bf 100644
--- a/doc/html/qcount_8c.html
+++ b/doc/html/qcount_8c.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qcount.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,13 +76,13 @@
int64_t qcount_read (const char *filepath)
- Read counter(integer) from file with advisory file locking.
+ Read counter(integer) from file with advisory file locking. More...
bool qcount_save (const char *filepath, int64_t number)
- Save counter(integer) to file with advisory file locking.
+ Save counter(integer) to file with advisory file locking. More...
int64_t qcount_update (const char *filepath, int64_t number)
- Increases(or decrease) the counter value as much as specified number with advisory file locking.
+ Increases(or decrease) the counter value as much as specified number with advisory file locking. More...
@@ -110,8 +112,8 @@
Returns counter value readed from file. in case of failure, returns 0.
-
-
+
---- number.dat ----
75
--------------------
@@ -153,7 +155,7 @@
Returns true if successful, otherwise returns false.
-
+
Definition at line 95 of file qcount.c .
@@ -193,7 +195,7 @@
Returns updated counter value. in case of failure, returns 0.
Definition at line 124 of file qcount.c .
@@ -207,7 +209,7 @@
utilities qcount.c
+ 1.8.6
diff --git a/doc/html/qcount_8c_source.html b/doc/html/qcount_8c_source.html
index cbc822d4..41c093dd 100644
--- a/doc/html/qcount_8c_source.html
+++ b/doc/html/qcount_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qcount.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -127,7 +129,7 @@
-
+
66 int fd = open(filepath, O_RDONLY, 0);
@@ -157,13 +159,13 @@
-
+
96 int fd = open(filepath, O_CREAT | O_WRONLY | O_TRUNC,
97 (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH));
- 101 char *str =
qstrdupf (
"%" PRId64, number);
+ 101 char *str =
qstrdupf (
"%" PRId64, number);
102 ssize_t updated = write(fd, str, strlen(str));
@@ -186,14 +188,18 @@
-
-
+
+
-
+
+bool qcount_save(const char *filepath, int64_t number)
Save counter(integer) to file with advisory file locking.
+int64_t qcount_update(const char *filepath, int64_t number)
Increases(or decrease) the counter value as much as specified number with advisory file locking...
+char * qstrdupf(const char *format,...)
Duplicate a formatted string.
+int64_t qcount_read(const char *filepath)
Read counter(integer) from file with advisory file locking.
@@ -202,7 +208,7 @@
utilities qcount.c
+ 1.8.6
diff --git a/doc/html/qdatabase_8c.html b/doc/html/qdatabase_8c.html
index d92b4eb9..6acbe892 100644
--- a/doc/html/qdatabase_8c.html
+++ b/doc/html/qdatabase_8c.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qdatabase.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,76 +76,76 @@
qdb_t * qdb (const char *dbtype, const char *addr, int port, const char *username, const char *password, const char *database, bool autocommit)
- Initialize internal connector structure.
+ Initialize internal connector structure. More...
static bool open_ (qdb_t *db)
- qdb->open(): Connect to database server
+ qdb->open(): Connect to database server More...
static bool close_ (qdb_t *db)
- qdb->close(): Disconnect from database server
+ qdb->close(): Disconnect from database server More...
static int execute_update (qdb_t *db, const char *query)
- qdb->execute_update() : Executes the update DML
+ qdb->execute_update() : Executes the update DML More...
static int execute_updatef (qdb_t *db, const char *format,...)
- qdb->execute_updatef() : Executes the formatted update DML
+ qdb->execute_updatef() : Executes the formatted update DML More...
static qdbresult_t * execute_query (qdb_t *db, const char *query)
- qdb->execute_query() : Executes the query
+ qdb->execute_query() : Executes the query More...
static qdbresult_t * execute_queryf (qdb_t *db, const char *format,...)
- qdb->execute_queryf() : Executes the formatted query
+ qdb->execute_queryf() : Executes the formatted query More...
static bool begin_tran (qdb_t *db)
- qdb->begin_tran() : Start transaction
+ qdb->begin_tran() : Start transaction More...
static bool commit (qdb_t *db)
- qdb->commit() : Commit transaction
+ qdb->commit() : Commit transaction More...
static bool rollback (qdb_t *db)
- qdb->rellback(): Roll-back and abort transaction
+ qdb->rellback(): Roll-back and abort transaction More...
static bool set_fetchtype (qdb_t *db, bool fromdb)
- qdb->set_fetchtype() : Set result fetching type
+ qdb->set_fetchtype() : Set result fetching type More...
static bool get_conn_status (qdb_t *db)
- qdb->get_conn_status() : Get last connection status
+ qdb->get_conn_status() : Get last connection status More...
static bool ping (qdb_t *db)
- qdb->ping() : Checks whether the connection to the server is working.
+ qdb->ping() : Checks whether the connection to the server is working. More...
static const char * get_error (qdb_t *db, unsigned int *errorno)
- qdb->get_error() : Get error number and message
+ qdb->get_error() : Get error number and message More...
static void free_ (qdb_t *db)
- qdb->free(): De-allocate qdb_t structure
+ qdb->free(): De-allocate qdb_t structure More...
static const char * _resultGetStr (qdbresult_t *result, const char *field)
- qdbresult->get_str(): Get the result as string by field name
+ qdbresult->get_str(): Get the result as string by field name More...
static const char * _resultGetStrAt (qdbresult_t *result, int idx)
- qdbresult->get_str_at(): Get the result as string by column number
+ qdbresult->get_str_at(): Get the result as string by column number More...
static int _resultGetInt (qdbresult_t *result, const char *field)
- qdbresult->get_int(): Get the result as integer by field name
+ qdbresult->get_int(): Get the result as integer by field name More...
static int _resultGetIntAt (qdbresult_t *result, int idx)
- qdbresult->get_int_at(): Get the result as integer by column number
+ qdbresult->get_int_at(): Get the result as integer by column number More...
static bool _resultGetNext (qdbresult_t *result)
- qdbresult->get_next(): Retrieves the next row of a result set
+ qdbresult->get_next(): Retrieves the next row of a result set More...
static int result_get_cols (qdbresult_t *result)
- qdbresult->get_cols(): Get the number of columns in the result set
+ qdbresult->get_cols(): Get the number of columns in the result set More...
static int result_get_rows (qdbresult_t *result)
- qdbresult->get_rows(): Get the number of rows in the result set
+ qdbresult->get_rows(): Get the number of rows in the result set More...
static int result_get_row (qdbresult_t *result)
- qdbresult->get_row(): Get the current row number
+ qdbresult->get_row(): Get the current row number More...
static void result_free (qdbresult_t *result)
- qdbresult->free(): De-allocate the result
+ qdbresult->free(): De-allocate the result More...
@@ -154,7 +156,7 @@
qdb_t *db = NULL;
qdbresult_t *result = NULL;
-
db =
qdb (
"MYSQL" ,
"dbhost.qdecoder.org" , 3306,
+
db =
qdb (
"MYSQL" ,
"dbhost.qdecoder.org" , 3306,
"test" , "secret" , "sampledb" , true );
if (db == NULL) {
printf("ERROR: Not supported database type.\n" );
@@ -256,7 +258,7 @@
Returns a pointer of qdb_t object in case of successful, otherwise returns NULL.
-
+
"dbhost.qdecoder.org" , 3306, "test" , "secret" ,
"sampledb" , true );
if (db == NULL) {
@@ -371,7 +373,7 @@
-
qdb->execute_updatef() : Executes the formatted update DML
+
qdb->execute_updatef() : Executes the formatted update DML
Parameters
db a pointer of qdb_t object
@@ -469,7 +471,7 @@
-
qdb->execute_queryf() : Executes the formatted query
+
qdb->execute_queryf() : Executes the formatted query
Parameters
db a pointer of qdb_t object
@@ -557,7 +559,7 @@
-
qdb->begin_tran() : Start transaction
+
qdb->begin_tran() : Start transaction
Parameters
db a pointer of qdb_t object
@@ -595,7 +597,7 @@
-
qdb->commit() : Commit transaction
+
qdb->commit() : Commit transaction
Parameters
db a pointer of qdb_t object
@@ -675,7 +677,7 @@
-
qdb->set_fetchtype() : Set result fetching type
+
qdb->set_fetchtype() : Set result fetching type
Parameters
db a pointer of qdb_t object
@@ -712,7 +714,7 @@
-
qdb->ping() : Checks whether the connection to the server is working.
+
qdb->ping() : Checks whether the connection to the server is working.
Parameters
db a pointer of qdb_t object
@@ -794,7 +796,7 @@
-
qdb->get_error() : Get error number and message
+
qdb->get_error() : Get error number and message
Parameters
db a pointer of qdb_t object
@@ -1211,7 +1213,7 @@
extensions qdatabase.c
+ 1.8.6
diff --git a/doc/html/qdatabase_8c_source.html b/doc/html/qdatabase_8c_source.html
index 908d96ac..d72cb8f1 100644
--- a/doc/html/qdatabase_8c_source.html
+++ b/doc/html/qdatabase_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qdatabase.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -166,36 +168,36 @@
102 #ifndef _DOXYGEN_SKIP
- 104 static bool open_ (qdb_t *db);
- 105 static bool close_ (qdb_t *db);
+ 104 static bool open_ (qdb_t *db);
+ 105 static bool close_ (qdb_t *db);
-
-
- 109 static qdbresult_t *
execute_query (qdb_t *db,
const char *query);
- 110 static qdbresult_t *
execute_queryf (qdb_t *db,
const char *format, ...);
+
+
+ 109 static qdbresult_t *
execute_query (qdb_t *db,
const char *query);
+ 110 static qdbresult_t *
execute_queryf (qdb_t *db,
const char *format, ...);
-
- 113 static bool commit (qdb_t *db);
-
+
+ 113 static bool commit (qdb_t *db);
+
-
-
- 118 static bool ping (qdb_t *db);
- 119 static const char *
get_error (qdb_t *db,
unsigned int *errorno);
- 120 static void free_ (qdb_t *db);
+
+
+ 118 static bool ping (qdb_t *db);
+ 119 static const char *
get_error (qdb_t *db,
unsigned int *errorno);
+ 120 static void free_ (qdb_t *db);
- 123 static const char *
_resultGetStr (qdbresult_t *result,
const char *field);
-
- 125 static int _resultGetInt (qdbresult_t *result,
const char *field);
-
-
+ 123 static const char *
_resultGetStr (qdbresult_t *result,
const char *field);
+
+ 125 static int _resultGetInt (qdbresult_t *result,
const char *field);
+
+
-
-
-
+
+
+
-
+
@@ -224,7 +226,7 @@
- 162 qdb_t *
qdb (
const char *dbtype,
const char *addr,
int port,
const char *username,
+ 162 qdb_t *
qdb (
const char *dbtype,
const char *addr,
int port,
const char *username,
163 const char *password,
const char *database,
bool autocommit)
@@ -263,23 +265,23 @@
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
220 Q_MUTEX_NEW(db->qmutex,
true );
@@ -294,20 +296,20 @@
-
+
234 if (db == NULL)
return false ;
237 if (db->connected ==
true ) {
-
+
241 #ifdef _Q_ENABLE_MYSQL
242 Q_MUTEX_ENTER(db->qmutex);
- 245 if (db->mysql != NULL)
close_ (db);
+ 245 if (db->mysql != NULL)
close_ (db);
247 if (mysql_library_init(0, NULL, NULL) != 0) {
248 Q_MUTEX_LEAVE(db->qmutex);
@@ -353,14 +355,14 @@
290 db->info.port, NULL, 0) == NULL) {
-
+
292 Q_MUTEX_LEAVE(db->qmutex);
297 if (mysql_autocommit(db->mysql, db->info.autocommit) != 0) {
-
+
299 Q_MUTEX_LEAVE(db->qmutex);
@@ -385,7 +387,7 @@
-
+
325 if (db == NULL)
return false ;
@@ -414,7 +416,7 @@
-
+
354 if (db == NULL || db->connected ==
false )
return -1;
@@ -445,13 +447,13 @@
-
+
386 DYNAMIC_VSPRINTF(query, format);
387 if (query == NULL)
return -1;
-
+
@@ -465,7 +467,7 @@
-
+
405 if (db == NULL || db->connected ==
false )
return NULL;
@@ -496,17 +498,17 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
+
@@ -522,7 +524,7 @@
-
+
463 DYNAMIC_VSPRINTF(query, format);
@@ -546,7 +548,7 @@
-
+
486 if (db == NULL)
return false ;
@@ -577,7 +579,7 @@
-
+
517 if (db == NULL)
return false ;
@@ -603,7 +605,7 @@
-
+
543 if (db == NULL)
return false ;
@@ -639,7 +641,7 @@
-
+
579 if (db == NULL)
return false ;
580 db->info.fetchtype = fromdb;
@@ -656,7 +658,7 @@
-
+
596 if (db == NULL)
return false ;
@@ -674,7 +676,7 @@
-
+
614 if (db == NULL)
return false ;
@@ -682,7 +684,7 @@
617 if (db->connected ==
true && mysql_ping(db->mysql) == 0) {
- 620 if (
open_ (db) ==
true ) {
+ 620 if (
open_ (db) ==
true ) {
621 DEBUG(
"Connection recovered." );
@@ -705,7 +707,7 @@
- 643 static const char *
get_error (qdb_t *db,
unsigned int *errorno)
+ 643 static const char *
get_error (qdb_t *db,
unsigned int *errorno)
645 if (db == NULL || db->connected ==
false )
return "(no opened db)" ;
@@ -728,13 +730,13 @@
-
+
668 if (db == NULL)
return ;
670 Q_MUTEX_ENTER(db->qmutex);
-
+
674 free(db->info.dbtype);
@@ -760,7 +762,7 @@
-
+
700 #ifdef _Q_ENABLE_MYSQL
701 if (result == NULL || result->rs == NULL || result->cols <= 0)
return NULL;
@@ -788,7 +790,7 @@
-
+
728 #ifdef _Q_ENABLE_MYSQL
@@ -812,7 +814,7 @@
-
+
752 const char *val = result->get_str(result, field);
753 if (val == NULL)
return 0;
@@ -827,7 +829,7 @@
-
+
767 const char *val = result->get_str_at(result, idx);
768 if (val == NULL)
return 0;
@@ -841,7 +843,7 @@
-
+
781 #ifdef _Q_ENABLE_MYSQL
782 if (result == NULL || result->rs == NULL)
return false ;
@@ -862,7 +864,7 @@
-
+
802 #ifdef _Q_ENABLE_MYSQL
803 if (result == NULL || result->rs == NULL)
return 0;
@@ -879,7 +881,7 @@
-
+
819 #ifdef _Q_ENABLE_MYSQL
820 if (result == NULL || result->rs == NULL)
return 0;
@@ -899,7 +901,7 @@
-
+
839 #ifdef _Q_ENABLE_MYSQL
840 if (result == NULL || result->rs == NULL)
return 0;
@@ -914,7 +916,7 @@
-
+
854 #ifdef _Q_ENABLE_MYSQL
855 if (result == NULL)
return ;
@@ -935,6 +937,30 @@
+static int _resultGetInt(qdbresult_t *result, const char *field)
qdbresult->get_int(): Get the result as integer by field name
+static bool get_conn_status(qdb_t *db)
qdb->get_conn_status(): Get last connection status
+qdb_t * qdb(const char *dbtype, const char *addr, int port, const char *username, const char *password, const char *database, bool autocommit)
Initialize internal connector structure.
+static int execute_update(qdb_t *db, const char *query)
qdb->execute_update(): Executes the update DML
+static int execute_updatef(qdb_t *db, const char *format,...)
qdb->execute_updatef(): Executes the formatted update DML
+static const char * _resultGetStr(qdbresult_t *result, const char *field)
qdbresult->get_str(): Get the result as string by field name
+static int result_get_row(qdbresult_t *result)
qdbresult->get_row(): Get the current row number
+static bool open_(qdb_t *db)
qdb->open(): Connect to database server
+static int _resultGetIntAt(qdbresult_t *result, int idx)
qdbresult->get_int_at(): Get the result as integer by column number
+static int result_get_rows(qdbresult_t *result)
qdbresult->get_rows(): Get the number of rows in the result set
+static bool ping(qdb_t *db)
qdb->ping(): Checks whether the connection to the server is working.
+static const char * _resultGetStrAt(qdbresult_t *result, int idx)
qdbresult->get_str_at(): Get the result as string by column number
+static bool _resultGetNext(qdbresult_t *result)
qdbresult->get_next(): Retrieves the next row of a result set
+static qdbresult_t * execute_query(qdb_t *db, const char *query)
qdb->execute_query(): Executes the query
+static const char * get_error(qdb_t *db, unsigned int *errorno)
qdb->get_error(): Get error number and message
+static void result_free(qdbresult_t *result)
qdbresult->free(): De-allocate the result
+static int result_get_cols(qdbresult_t *result)
qdbresult->get_cols(): Get the number of columns in the result set
+static bool close_(qdb_t *db)
qdb->close(): Disconnect from database server
+static bool begin_tran(qdb_t *db)
qdb->begin_tran(): Start transaction
+static qdbresult_t * execute_queryf(qdb_t *db, const char *format,...)
qdb->execute_queryf(): Executes the formatted query
+static void free_(qdb_t *db)
qdb->free(): De-allocate qdb_t structure
+static bool set_fetchtype(qdb_t *db, bool fromdb)
qdb->set_fetchtype(): Set result fetching type
+static bool commit(qdb_t *db)
qdb->commit(): Commit transaction
+static bool rollback(qdb_t *db)
qdb->rellback(): Roll-back and abort transaction
@@ -943,7 +969,7 @@
extensions qdatabase.c
+ 1.8.6
diff --git a/doc/html/qencode_8c.html b/doc/html/qencode_8c.html
index 0d140397..52941bdf 100644
--- a/doc/html/qencode_8c.html
+++ b/doc/html/qencode_8c.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qencode.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,25 +76,25 @@
qlisttbl_t * qparse_queries (qlisttbl_t *tbl, const char *query, char equalchar, char sepchar, int *count)
- Parse URL encoded query string.
+ Parse URL encoded query string. More...
char * qurl_encode (const void *bin, size_t size )
- Encode data using URL encoding(Percent encoding) algorithm.
+ Encode data using URL encoding(Percent encoding) algorithm. More...
size_t qurl_decode (char *str)
- Decode URL encoded string.
+ Decode URL encoded string. More...
char * qbase64_encode (const void *bin, size_t size )
- Encode data using BASE64 algorithm.
+ Encode data using BASE64 algorithm. More...
size_t qbase64_decode (char *str)
- Decode BASE64 encoded string.
+ Decode BASE64 encoded string. More...
char * qhex_encode (const void *bin, size_t size )
- Encode data to Hexadecimal digit format.
+ Encode data to Hexadecimal digit format. More...
size_t qhex_decode (char *str)
- Decode Hexadecimal encoded data.
+ Decode Hexadecimal encoded data. More...
@@ -155,7 +157,7 @@
Returns qlisttbl container pointer, otherwise returns NULL.
cont char query = "category=love&str=%C5%A5%B5%F0%C4%DA%B4%F5&sort=asc" ;
-
qlisttbl_t *tbl =
qparse_queries (NULL, req->pszQueryString,
'=' ,
'&' , NULL);
+
qlisttbl_t *tbl =
qparse_queries (NULL, req->pszQueryString,
'=' ,
'&' , NULL);
printf("category = %s\n" , tbl->get_str(tbl, "category" , false ));
printf("str = %s\n" , tbl->get_str(tbl, "str" , false ));
printf("sort = %s\n" , tbl->get_str(tbl, "sort" , false ));
@@ -200,13 +202,13 @@
Returns a malloced string pointer of URL encoded string in case of successful, otherwise returns NULL
const char *text = "hello 'qLibc' world" ;
-
+
if (encstr == NULL) return -1;
printf("Original: %s\n" , text);
printf("Encoded : %s\n" , encstr);
-
+
printf("Decoded : %s (%zu bytes)\n" , encstr, decsize);
free(encstr);
@@ -283,13 +285,13 @@
Returns a malloced string pointer of BASE64 encoded string in case of successful, otherwise returns NULL
const char *text = "hello world" ;
-
+
if (encstr == NULL) return -1;
printf("Original: %s\n" , text);
printf("Encoded : %s\n" , encstr);
-
+
printf("Decoded : %s (%zu bytes)\n" , encstr, decsize);
free(encstr);
@@ -366,13 +368,13 @@
Returns a malloced string pointer of Hexadecimal encoded string in case of successful, otherwise returns NULL
const char *text = "hello world" ;
-
+
if (encstr == NULL) return -1;
printf("Original: %s\n" , text);
printf("Encoded : %s\n" , encstr);
-
+
printf("Decoded : %s (%zu bytes)\n" , encstr, decsize);
free(encstr);
@@ -424,7 +426,7 @@
utilities qencode.c
+ 1.8.6
diff --git a/doc/html/qencode_8c_source.html b/doc/html/qencode_8c_source.html
index d64160d0..b605f78c 100644
--- a/doc/html/qencode_8c_source.html
+++ b/doc/html/qencode_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qencode.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -124,10 +126,10 @@
- 62 qlisttbl_t *
qparse_queries (qlisttbl_t *tbl,
const char *query,
char equalchar,
+ 62 qlisttbl_t *
qparse_queries (qlisttbl_t *tbl,
const char *query,
char equalchar,
63 char sepchar,
int *count) {
-
+
@@ -139,9 +141,9 @@
74 newquery = strdup(query);
75 while (newquery && *newquery) {
76 char *value = _q_makeword(newquery, sepchar);
- 77 char *name =
qstrtrim (_q_makeword(value, equalchar));
-
-
+ 77 char *name =
qstrtrim (_q_makeword(value, equalchar));
+
+
81 if (tbl->putstr(tbl, name, value) ==
true )
@@ -185,7 +187,7 @@
-
+
124 const char URLCHARTBL[16*16] = {
125 00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
126 00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
@@ -252,7 +254,7 @@
-
+
@@ -309,7 +311,7 @@
-
+
248 const char B64CHARTBL[64] = {
249 'A' ,
'B' ,
'C' ,
'D' ,
'E' ,
'F' ,
'G' ,
'H' ,
'I' ,
'J' ,
'K' ,
'L' ,
'M' ,
'N' ,
'O' ,
'P' ,
250 'Q' ,
'R' ,
'S' ,
'T' ,
'U' ,
'V' ,
'W' ,
'X' ,
'Y' ,
'Z' ,
'a' ,
'b' ,
'c' ,
'd' ,
'e' ,
'f' ,
@@ -368,7 +370,7 @@
-
+
307 const char B64MAPTBL[16 * 16] = {
308 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
309 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
@@ -453,7 +455,7 @@
-
+
392 const char HEXCHARTBL[16] = {
393 '0' ,
'1' ,
'2' ,
'3' ,
'4' ,
'5' ,
'6' ,
'7' ,
'8' ,
'9' ,
'a' ,
'b' ,
'c' ,
'd' ,
'e' ,
'f'
@@ -465,7 +467,7 @@
400 unsigned char *pSrc = (
unsigned char *) bin;
401 char *pHexPt = pHexStr;
- 403 for (i = 0; i <
size ; i++) {
+ 403 for (i = 0; i <
size ; i++) {
404 *pHexPt++ = HEXCHARTBL[(pSrc[i] >> 4)];
405 *pHexPt++ = HEXCHARTBL[(pSrc[i] & 0x0F)];
@@ -486,7 +488,7 @@
-
+
425 const char HEXMAPTBL[16*16] = {
426 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
427 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -515,6 +517,16 @@
451 return (pBinPt - str);
+static size_t size(qlist_t *list)
qlist->size(): Returns the number of elements in this list.
+char * qhex_encode(const void *bin, size_t size)
Encode data to Hexadecimal digit format.
+size_t qhex_decode(char *str)
Decode Hexadecimal encoded data.
+size_t qbase64_decode(char *str)
Decode BASE64 encoded string.
+size_t qurl_decode(char *str)
Decode URL encoded string.
+qlisttbl_t * qlisttbl(int options)
Create a new Q_LIST linked-list container.
+char * qbase64_encode(const void *bin, size_t size)
Encode data using BASE64 algorithm.
+qlisttbl_t * qparse_queries(qlisttbl_t *tbl, const char *query, char equalchar, char sepchar, int *count)
Parse URL encoded query string.
+char * qstrtrim(char *str)
Remove white spaces(including CR, LF) from head and tail of the string.
+char * qurl_encode(const void *bin, size_t size)
Encode data using URL encoding(Percent encoding) algorithm.
@@ -523,7 +535,7 @@
utilities qencode.c
+ 1.8.6
diff --git a/doc/html/qfile_8c.html b/doc/html/qfile_8c.html
index 32ccdcc0..40216c65 100644
--- a/doc/html/qfile_8c.html
+++ b/doc/html/qfile_8c.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qfile.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -81,46 +83,46 @@
bool qfile_lock (int fd)
- Lock file.
+ Lock file. More...
bool qfile_unlock (int fd)
- Unlock file which is locked by qfile_lock()
+ Unlock file which is locked by qfile_lock() More...
bool qfile_exist (const char *filepath)
- Check file existence.
+ Check file existence. More...
void * qfile_load (const char *filepath, size_t *nbytes)
- Load file into memory.
+ Load file into memory. More...
void * qfile_read (FILE *fp, size_t *nbytes)
- Read data from a file stream.
+ Read data from a file stream. More...
ssize_t qfile_save (const char *filepath, const void *buf, size_t size , bool append)
- Save data into file.
+ Save data into file. More...
bool qfile_mkdir (const char *dirpath, mode_t mode, bool recursive)
- Attempts to create a directory recursively.
+ Attempts to create a directory recursively. More...
bool qfile_check_path (const char *path)
- Check path string contains invalid characters.
+ Check path string contains invalid characters. More...
char * qfile_get_name (const char *filepath)
- Get filename from filepath.
+ Get filename from filepath. More...
char * qfile_get_dir (const char *filepath)
- Get directory suffix from filepath.
+ Get directory suffix from filepath. More...
char * qfile_get_ext (const char *filepath)
- Get extension from filepath.
+ Get extension from filepath. More...
off_t qfile_get_size (const char *filepath)
- Get file size.
+ Get file size. More...
char * qfile_correct_path (char *path)
- Correct path string.
+ Correct path string. More...
char * qfile_abspath (char *buf, size_t bufsize, const char *path)
- Make full absolute system path string.
+ Make full absolute system path string. More...
@@ -152,17 +154,17 @@
Returns true if successful, otherwise returns false.
int fd = open(...);
-
+
(...atomic file access...)
-
+
}
FILE *fp = fopen(...);
int fd = fileno(fp);
-
+
(...atomic file access...)
-
+
}
Definition at line 74 of file qfile.c .
@@ -183,7 +185,7 @@
-
Unlock file which is locked by qfile_lock()
+
Unlock file which is locked by qfile_lock()
Parameters
fd file descriptor
@@ -257,15 +259,15 @@
Returns allocated memory pointer if successful, otherwise returns NULL.
-
char *text = (
char *)
qfile_load (
"/tmp/text.txt" , NULL);
+
char *text = (
char *)
qfile_load (
"/tmp/text.txt" , NULL);
int binlen = 0;
-
char *bin = (
char *)
qfile_load (
"/tmp/binary.bin" , &binlen);
+
char *bin = (
char *)
qfile_load (
"/tmp/binary.bin" , &binlen);
int binlen = 10;
-
char *bin = (
char *)
qfile_load (
"/tmp/binary.bin" , &binlen);
+
char *bin = (
char *)
qfile_load (
"/tmp/binary.bin" , &binlen);
Note This method actually allocates memory more than 1 bytes than filesize then append NULL character at the end. For example, when the file size is 10 bytes long, 10+1 bytes will allocated and the last byte is always NULL character. So you can load text file and use without appending NULL character. By the way, the actual file size 10 will be returned at nbytes variable.
Definition at line 159 of file qfile.c .
@@ -306,7 +308,7 @@
Returns allocated memory pointer if successful, otherwise returns NULL.
Note This method append NULL character at the end of stream. but nbytes only counts actual readed bytes.
Definition at line 214 of file qfile.c .
@@ -362,11 +364,11 @@
Returns the number of bytes written if successful, otherwise returns -1.
char *text = "hello" ;
-
qfile_save (
"/tmp/text.txt" , (
void *)text, strlen(text),
false );
+
qfile_save (
"/tmp/text.txt" , (
void *)text, strlen(text),
false );
int integer1 = 75;
-
qfile_save (
"/tmp/integer.bin, (void*)&integer, sizeof(int));
+
qfile_save (
"/tmp/integer.bin, (void*)&integer, sizeof(int));
Definition at line 283 of file qfile.c .
@@ -626,11 +628,11 @@
Returns buffer pointer if successful, otherwise returns NULL.
char buf[PATH_MAX];
chdir("/usr/local" );
-
-
-
-
-
+
+
+
+
+
Definition at line 530 of file qfile.c .
@@ -644,7 +646,7 @@
utilities qfile.c
+ 1.8.6
diff --git a/doc/html/qfile_8c_source.html b/doc/html/qfile_8c_source.html
index e2d9c076..d394b07d 100644
--- a/doc/html/qfile_8c_source.html
+++ b/doc/html/qfile_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qfile.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -136,7 +138,7 @@
-
+
@@ -160,7 +162,7 @@
-
+
@@ -184,7 +186,7 @@
-
+
123 if (access(filepath, F_OK) == 0)
@@ -221,7 +223,7 @@
-
+
161 if ((fd = open(filepath, O_RDONLY, 0)) < 0)
@@ -232,7 +234,7 @@
- 170 size_t size = fs.st_size;
+ 170 size_t size = fs.st_size;
171 if (nbytes != NULL && *nbytes > 0 && *nbytes < fs.st_size)
@@ -276,9 +278,9 @@
-
+
215 size_t memsize = 1024;
-
+
218 if (nbytes != NULL && *nbytes > 0) {
@@ -345,7 +347,7 @@
-
+
@@ -374,15 +376,15 @@
- 312 bool qfile_mkdir (
const char *dirpath, mode_t mode,
bool recursive) {
+ 312 bool qfile_mkdir (
const char *dirpath, mode_t mode,
bool recursive) {
313 DEBUG(
"try to create directory %s" , dirpath);
314 if (mkdir(dirpath, mode) == 0)
318 if (recursive ==
true && errno == ENOENT) {
-
-
+
+
321 && mkdir(dirpath, mode) == 0) {
@@ -399,7 +401,7 @@
-
+
@@ -418,7 +420,7 @@
-
+
357 char *path = strdup(filepath);
358 char *bname = basename(path);
359 char *filename = strdup(bname);
@@ -433,7 +435,7 @@
-
+
372 char *path = strdup(filepath);
373 char *dname = dirname(path);
374 char *dir = strdup(dname);
@@ -448,15 +450,15 @@
-
+
387 #define MAX_EXTENSION_LENGTH (8)
-
+
389 char *p = strrchr(filename,
'.' );
391 if (p != NULL && strlen(p + 1) <= MAX_EXTENSION_LENGTH
- 392 &&
qstrtest (isalnum, p + 1) ==
true ) {
+ 392 &&
qstrtest (isalnum, p + 1) ==
true ) {
-
+
@@ -472,7 +474,7 @@
-
+
412 if (stat(filepath, &finfo) < 0)
@@ -496,22 +498,22 @@
-
+
-
+
443 if (strstr(path,
"//" ) != NULL) {
-
+
448 if (strstr(path,
"/./" ) != NULL) {
-
+
@@ -523,7 +525,7 @@
-
+
462 strcpy(path, pszNewPrefix);
463 strcat(path, pszTmp + 3);
@@ -560,7 +562,7 @@
496 if (!strcmp(path + (nLen - 3),
"/.." )) {
497 path[nLen - 3] =
'\0' ;
-
+
499 strcpy(path, pszNewPath);
@@ -592,22 +594,42 @@
-
+
534 if (path[0] ==
'/' ) {
-
+
537 if (getcwd(buf, bufsize) == NULL)
-
+
+static size_t size(qlist_t *list)
qlist->size(): Returns the number of elements in this list.
+char * qfile_get_name(const char *filepath)
Get filename from filepath.
+char * qfile_correct_path(char *path)
Correct path string.
+char * qfile_abspath(char *buf, size_t bufsize, const char *path)
Make full absolute system path string.
+bool qfile_exist(const char *filepath)
Check file existence.
+off_t qfile_get_size(const char *filepath)
Get file size.
+bool qfile_mkdir(const char *dirpath, mode_t mode, bool recursive)
Attempts to create a directory recursively.
+char * qfile_get_dir(const char *filepath)
Get directory suffix from filepath.
+char * qstrtrim(char *str)
Remove white spaces(including CR, LF) from head and tail of the string.
+char * qfile_get_ext(const char *filepath)
Get extension from filepath.
+char * qstrcpy(char *dst, size_t size, const char *src)
Copy src string to dst.
+bool qfile_lock(int fd)
Lock file.
+ssize_t qfile_save(const char *filepath, const void *buf, size_t size, bool append)
Save data into file.
+void * qfile_load(const char *filepath, size_t *nbytes)
Load file into memory.
+bool qstrtest(int(*testfunc)(int), const char *str)
Test for an alpha-numeric string.
+bool qfile_unlock(int fd)
Unlock file which is locked by qfile_lock()
+char * qstrreplace(const char *mode, char *srcstr, const char *tokstr, const char *word)
Replace string or tokens as word from source string with given mode.
+char * qstrlower(char *str)
Convert character to lower character.
+void * qfile_read(FILE *fp, size_t *nbytes)
Read data from a file stream.
+bool qfile_check_path(const char *path)
Check path string contains invalid characters.
@@ -616,7 +638,7 @@
utilities qfile.c
+ 1.8.6
diff --git a/doc/html/qhash_8c.html b/doc/html/qhash_8c.html
index 07b48e03..aa58597a 100644
--- a/doc/html/qhash_8c.html
+++ b/doc/html/qhash_8c.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qhash.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,22 +76,22 @@
bool qhashmd5 (const void *data, size_t nbytes, void *retbuf)
- Calculate 128-bit(16-bytes) MD5 hash.
+ Calculate 128-bit(16-bytes) MD5 hash. More...
bool qhashmd5_file (const char *filepath, off_t offset, ssize_t nbytes, void *retbuf)
- Get 128-bit MD5 hash of a file contents.
+ Get 128-bit MD5 hash of a file contents. More...
uint32_t qhashfnv1_32 (const void *data, size_t nbytes)
- Get 32-bit FNV1 hash.
+ Get 32-bit FNV1 hash. More...
uint64_t qhashfnv1_64 (const void *data, size_t nbytes)
- Get 64-bit FNV1 hash integer.
+ Get 64-bit FNV1 hash integer. More...
uint32_t qhashmurmur3_32 (const void *data, size_t nbytes)
- Get 32-bit Murmur3 hash.
+ Get 32-bit Murmur3 hash. More...
bool qhashmurmur3_128 (const void *data, size_t nbytes, void *retbuf)
- Get 128-bit Murmur3 hash.
+ Get 128-bit Murmur3 hash. More...
@@ -139,10 +141,10 @@
Returns true if successful, otherwise false.
unsigned char md5hash[16];
-
+
-
+
printf("Hex encoded MD5: %s\n" , md5ascii);
free(md5ascii);
@@ -198,7 +200,7 @@
Returns true if successful, otherwise false.
unsigned char md5hash[16];
-
+
Definition at line 97 of file qhash.c .
@@ -237,7 +239,7 @@
Returns 32-bit unsigned hash value.
-
+
Fowler/Noll/Vo hash
The basis of this hash algorithm was taken from an idea sent as reviewer
@@ -299,7 +301,7 @@
Returns 64-bit unsigned hash value.
-
+
Definition at line 218 of file qhash.c .
@@ -338,7 +340,7 @@
Returns 32-bit unsigned hash value.
-
+
MurmurHash3 was created by Austin Appleby in 2008. The initial
implementation was published in C++ and placed in the public .
https:
@@ -391,10 +393,10 @@
Returns true if successful, otherwise false.
unsigned char hash[16];
-
+
-
+
printf("Hex encoded Murmur3: %s\n" , ascii);
free(ascii);
@@ -410,7 +412,7 @@
utilities qhash.c
+ 1.8.6
diff --git a/doc/html/qhash_8c_source.html b/doc/html/qhash_8c_source.html
index 9fea2be3..2e8713c5 100644
--- a/doc/html/qhash_8c_source.html
+++ b/doc/html/qhash_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qhash.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -129,7 +131,7 @@
- 67 bool qhashmd5 (
const void *data,
size_t nbytes,
void *retbuf) {
+ 67 bool qhashmd5 (
const void *data,
size_t nbytes,
void *retbuf) {
68 if (data == NULL || retbuf == NULL) {
@@ -159,7 +161,7 @@
-
+
99 if (filepath == NULL || offset < 0 || nbytes < 0 || retbuf == NULL) {
@@ -173,7 +175,7 @@
109 if (fstat(fd, &st) < 0)
- 111 size_t size = st.st_size;
+ 111 size_t size = st.st_size;
114 if (size < offset + nbytes) {
@@ -249,7 +251,7 @@
-
+
188 if (data == NULL || nbytes == 0)
@@ -280,7 +282,7 @@
-
+
219 if (data == NULL || nbytes == 0)
@@ -320,7 +322,7 @@
-
+
259 if (data == NULL || nbytes == 0)
@@ -392,7 +394,7 @@
-
+
331 if (data == NULL || nbytes == 0)
@@ -503,6 +505,13 @@
+static size_t size(qlist_t *list)
qlist->size(): Returns the number of elements in this list.
+bool qhashmurmur3_128(const void *data, size_t nbytes, void *retbuf)
Get 128-bit Murmur3 hash.
+bool qhashmd5(const void *data, size_t nbytes, void *retbuf)
Calculate 128-bit(16-bytes) MD5 hash.
+uint32_t qhashmurmur3_32(const void *data, size_t nbytes)
Get 32-bit Murmur3 hash.
+bool qhashmd5_file(const char *filepath, off_t offset, ssize_t nbytes, void *retbuf)
Get 128-bit MD5 hash of a file contents.
+uint32_t qhashfnv1_32(const void *data, size_t nbytes)
Get 32-bit FNV1 hash.
+uint64_t qhashfnv1_64(const void *data, size_t nbytes)
Get 64-bit FNV1 hash integer.
@@ -511,7 +520,7 @@
utilities qhash.c
+ 1.8.6
diff --git a/doc/html/qhasharr_8c.html b/doc/html/qhasharr_8c.html
index 2208db62..5e2fa3f3 100644
--- a/doc/html/qhasharr_8c.html
+++ b/doc/html/qhasharr_8c.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qhasharr.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,54 +76,57 @@
size_t qhasharr_calculate_memsize (int max)
- Get how much memory is needed for N slots.
+ Get how much memory is needed for N slots. More...
qhasharr_t * qhasharr (void *memory, size_t memsize)
- Initialize static hash table.
+ Initialize static hash table. More...
+
+static qhasharr_slot_t * _get_slots (qhasharr_t *tbl)
+
static bool put (qhasharr_t *tbl, const char *key, const void *value, size_t size )
- qhasharr->put() : Put an object into this table.
+ qhasharr->put() : Put an object into this table. More...
static bool putstr (qhasharr_t *tbl, const char *key, const char *str)
- qhasharr->putstr() : Put a string into this table
+ qhasharr->putstr() : Put a string into this table More...
static bool putstrf (qhasharr_t *tbl, const char *key, const char *format,...)
- qhasharr->putstrf() : Put a formatted string into this table.
+ qhasharr->putstrf() : Put a formatted string into this table. More...
static bool putint (qhasharr_t *tbl, const char *key, int64_t num)
- qhasharr->putint() : Put an integer into this table as string type.
+ qhasharr->putint() : Put an integer into this table as string type. More...
static void * get (qhasharr_t *tbl, const char *key, size_t *size )
- qhasharr->get() : Get an object from this table
+ qhasharr->get() : Get an object from this table More...
static char * getstr (qhasharr_t *tbl, const char *key)
- qhasharr->getstr() : Finds an object with given name and returns as string type.
+ qhasharr->getstr() : Finds an object with given name and returns as string type. More...
static int64_t getint (qhasharr_t *tbl, const char *key)
- qhasharr->getint() : Finds an object with given name and returns as integer type.
+ qhasharr->getint() : Finds an object with given name and returns as integer type. More...
static bool getnext (qhasharr_t *tbl, qnobj_t *obj, int *idx)
- qhasharr->getnext() : Get next element.
+ qhasharr->getnext() : Get next element. More...
static bool remove_ (qhasharr_t *tbl, const char *key)
- qhasharr->remove(): Remove an object from this table.
+ qhasharr->remove(): Remove an object from this table. More...
static int size (qhasharr_t *tbl, int *maxslots, int *usedslots)
- qhasharr->size() : Returns the number of objects in this table.
+ qhasharr->size() : Returns the number of objects in this table. More...
static void clear (qhasharr_t *tbl)
- qhasharr->clear() : Clears this table so that it contains no keys.
+ qhasharr->clear() : Clears this table so that it contains no keys. More...
static bool debug (qhasharr_t *tbl, FILE *out)
- qhasharr->debug() : Print hash table for debugging purpose
+ qhasharr->debug() : Print hash table for debugging purpose More...
void free_ (qhasharr_t *tbl)
- qhasharr->free(): De-allocate table reference object.
+ qhasharr->free(): De-allocate table reference object. More...
Static(array) hash-table implementation.
-
qhasharr implements a hash-table which maps keys to values and stores into fixed size static memory like shared-memory and memory-mapped file. The creator qhasharr() initializes static memory to makes small slots in it. The default slot size factors are defined in _Q_HASHARR_KEYSIZE and _Q_HASHARR_VALUESIZE. And they are applied at compile time.
+
qhasharr implements a hash-table which maps keys to values and stores into fixed size static memory like shared-memory and memory-mapped file. The creator qhasharr() initializes static memory to makes small slots in it. The default slot size factors are defined in _Q_HASHARR_KEYSIZE and _Q_HASHARR_VALUESIZE. And they are applied at compile time.
The value part of an element will be stored across several slots if it's size exceeds the slot size. But the key part of an element will be truncated if the size exceeds and it's length and more complex MD5 hash value will be stored with the key. So to look up a particular key, first we find an element which has same hash value. If the key was not truncated, we just do key comparison. But if the key was truncated because it's length exceeds, we do both md5 and key comparison(only stored size) to verify that the key is same. So please be aware of that, theoretically there is a possibility we pick wrong element in case a key exceeds the limit, has same length and MD5 hash with lookup key. But this possibility is extreamly low and almost never happen in practice. If you happpen to want to make sure everything, you set _Q_HASHARR_KEYSIZE big enough at compile time to make sure all keys fits in it.
qhasharr hash-table does not support thread-safe. So users should handle race conditions on application side by raising user lock before calling functions which modify the table data.
[Data Structure Diagram]
@@ -141,7 +146,7 @@
+--------------------------------------------------------------------------+
char memory[1000 * 10];
-
qhasharr_t *tbl =
qhasharr (memory,
sizeof (memory));
+
qhasharr_t *tbl =
qhasharr (memory,
sizeof (memory));
if (tbl == NULL) return ;
@@ -163,15 +168,15 @@
An example for using hash table over shared memory.
[CREATOR SIDE]
int maxslots = 1000;
-
+
-
int shmid =
qshm_init (
"/tmp/some_id_file" ,
'q' , memsize,
true );
+
int shmid =
qshm_init (
"/tmp/some_id_file" ,
'q' , memsize,
true );
if (shmid < 0) return -1;
-
+
-
qhasharr_t *tbl =
qhasharr (memory, memsize);
+
qhasharr_t *tbl =
qhasharr (memory, memsize);
if (hasharr == NULL) return -1;
(...your codes with your own locking mechanism...)
@@ -180,16 +185,16 @@
tbl->free(tbl);
-
+
[USER SIDE]
-
+
-
+
-
+
(...your codes with your own locking mechanism...)
@@ -222,7 +227,7 @@
Returns memory size needed
Note This can be used for calculating minimum memory size for N slots.
-
Definition at line 194 of file qhasharr.c .
+
Definition at line 195 of file qhasharr.c .
@@ -273,12 +278,12 @@
char memory[112 * 100];
-qhasharr_t *tbl =
qhasharr (memory,
sizeof (memory));
+qhasharr_t *tbl =
qhasharr (memory,
sizeof (memory));
-
+
-
Definition at line 223 of file qhasharr.c .
+
Definition at line 224 of file qhasharr.c .
@@ -326,7 +331,7 @@
-
qhasharr->put() : Put an object into this table.
+
qhasharr->put() : Put an object into this table.
Parameters
tbl qhasharr_t container pointer.
@@ -349,7 +354,7 @@
-Definition at line 293 of file qhasharr.c .
+Definition at line 296 of file qhasharr.c .
@@ -391,7 +396,7 @@
-
qhasharr->putstr() : Put a string into this table
+
qhasharr->putstr() : Put a string into this table
Parameters
tbl qhasharr_t container pointer.
@@ -413,7 +418,7 @@
-Definition at line 396 of file qhasharr.c .
+Definition at line 400 of file qhasharr.c .
@@ -461,7 +466,7 @@
-
qhasharr->putstrf() : Put a formatted string into this table.
+
qhasharr->putstrf() : Put a formatted string into this table.
Parameters
tbl qhasharr_t container pointer.
@@ -484,7 +489,7 @@
-Definition at line 415 of file qhasharr.c .
+Definition at line 419 of file qhasharr.c .
@@ -526,7 +531,7 @@
-
qhasharr->putint() : Put an integer into this table as string type.
+
qhasharr->putint() : Put an integer into this table as string type.
Parameters
tbl qhasharr_t container pointer.
@@ -549,7 +554,7 @@
Note The integer will be converted to a string object and stored as string object.
-Definition at line 444 of file qhasharr.c .
+Definition at line 448 of file qhasharr.c .
@@ -591,7 +596,7 @@
-
qhasharr->get() : Get an object from this table
+
qhasharr->get() : Get an object from this table
Parameters
tbl qhasharr_t container pointer.
@@ -614,7 +619,7 @@
Note returned object must be freed after done using.
-Definition at line 467 of file qhasharr.c .
+Definition at line 471 of file qhasharr.c .
@@ -650,7 +655,7 @@
-
qhasharr->getstr() : Finds an object with given name and returns as string type.
+
qhasharr->getstr() : Finds an object with given name and returns as string type.
Parameters
tbl qhasharr_t container pointer.
@@ -672,7 +677,7 @@
Note returned object must be freed after done using.
-Definition at line 503 of file qhasharr.c .
+Definition at line 507 of file qhasharr.c .
@@ -708,7 +713,7 @@
-
qhasharr->getint() : Finds an object with given name and returns as integer type.
+
qhasharr->getint() : Finds an object with given name and returns as integer type.
Parameters
tbl qhasharr_t container pointer.
@@ -729,7 +734,7 @@
-Definition at line 520 of file qhasharr.c .
+Definition at line 524 of file qhasharr.c .
@@ -771,7 +776,7 @@
-
qhasharr->getnext() : Get next element.
+
qhasharr->getnext() : Get next element.
Parameters
tbl qhasharr_t container pointer.
@@ -801,7 +806,7 @@
}
Note Please be aware a key name will be returned with truncated length because key name is truncated when it put into the table if it's length is longer than _Q_HASHARR_KEYSIZE.
-Definition at line 559 of file qhasharr.c .
+Definition at line 563 of file qhasharr.c .
@@ -858,7 +863,7 @@
-Definition at line 611 of file qhasharr.c .
+Definition at line 616 of file qhasharr.c .
@@ -900,7 +905,7 @@
-
qhasharr->size() : Returns the number of objects in this table.
+
qhasharr->size() : Returns the number of objects in this table.
Parameters
tbl qhasharr_t container pointer.
@@ -909,7 +914,7 @@
Returns a number of elements stored.
-Definition at line 688 of file qhasharr.c .
+Definition at line 694 of file qhasharr.c .
@@ -935,7 +940,7 @@
-
qhasharr->clear() : Clears this table so that it contains no keys.
+
qhasharr->clear() : Clears this table so that it contains no keys.
Parameters
tbl qhasharr_t container pointer.
@@ -944,7 +949,7 @@
Returns true if successful, otherwise returns false.
-Definition at line 711 of file qhasharr.c .
+Definition at line 717 of file qhasharr.c .
@@ -980,7 +985,7 @@
-
qhasharr->debug() : Print hash table for debugging purpose
+
qhasharr->debug() : Print hash table for debugging purpose
Parameters
tbl qhasharr_t container pointer.
@@ -999,7 +1004,7 @@
-Definition at line 740 of file qhasharr.c .
+Definition at line 747 of file qhasharr.c .
@@ -1026,7 +1031,7 @@
Note This does not de-allocate memory but only function reference object. Data memory such as shared memory must be de-allocated separately.
-Definition at line 814 of file qhasharr.c .
+Definition at line 822 of file qhasharr.c .
@@ -1038,7 +1043,7 @@
containers qhasharr.c
+ 1.8.6
diff --git a/doc/html/qhasharr_8c.js b/doc/html/qhasharr_8c.js
index a27c31db..2d3f44b6 100644
--- a/doc/html/qhasharr_8c.js
+++ b/doc/html/qhasharr_8c.js
@@ -2,6 +2,7 @@ var qhasharr_8c =
[
[ "qhasharr_calculate_memsize", "qhasharr_8c.html#a83012ec9fea85ca5770529997306334d", null ],
[ "qhasharr", "qhasharr_8c.html#aa0f33578b50024a4a239472c52eee18c", null ],
+ [ "_get_slots", "qhasharr_8c.html#a85f371e7f611a6f647fb58e6b3aaa4dc", null ],
[ "put", "qhasharr_8c.html#a969b1074c488063dff5b63aa7125defa", null ],
[ "putstr", "qhasharr_8c.html#a6002779614dbefb5685e2b309f47e98f", null ],
[ "putstrf", "qhasharr_8c.html#a8acb022ac1b2753eb2de582657d6be1f", null ],
diff --git a/doc/html/qhasharr_8c_source.html b/doc/html/qhasharr_8c_source.html
index 26c631e5..b84c9d0d 100644
--- a/doc/html/qhasharr_8c_source.html
+++ b/doc/html/qhasharr_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qhasharr.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -214,938 +216,969 @@
150 #ifndef _DOXYGEN_SKIP
- 152 static bool put (qhasharr_t *tbl,
const char *key,
const void *value,
-
- 154 static bool putstr (qhasharr_t *tbl,
const char *key,
const char *str);
- 155 static bool putstrf (qhasharr_t *tbl,
const char *key,
const char *format, ...);
- 156 static bool putint (qhasharr_t *tbl,
const char *key, int64_t num);
-
- 158 static void *
get (qhasharr_t *tbl,
const char *key,
size_t *
size );
- 159 static char *
getstr (qhasharr_t *tbl,
const char *key);
- 160 static int64_t
getint (qhasharr_t *tbl,
const char *key);
- 161 static bool getnext (qhasharr_t *tbl, qnobj_t *obj,
int *idx);
-
- 163 static bool remove_ (qhasharr_t *tbl,
const char *key);
-
- 165 static int size (qhasharr_t *tbl,
int *maxslots,
int *usedslots);
- 166 static void clear (qhasharr_t *tbl);
- 167 static bool debug (qhasharr_t *tbl, FILE *out);
-
- 169 static void free_ (qhasharr_t *tbl);
-
-
- 172 static int _find_empty(qhasharr_t *tbl,
int startidx);
- 173 static int _get_idx(qhasharr_t *tbl,
const char *key,
unsigned int hash);
- 174 static void *_get_data(qhasharr_t *tbl,
int idx,
size_t *
size );
- 175 static bool _put_data(qhasharr_t *tbl,
int idx,
unsigned int hash,
- 176 const char *key,
const void *value,
size_t size ,
-
- 178 static bool _copy_slot(qhasharr_t *tbl,
int idx1,
int idx2);
- 179 static bool _remove_slot(qhasharr_t *tbl,
int idx);
- 180 static bool _remove_data(qhasharr_t *tbl,
int idx);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 195 size_t memsize =
sizeof (qhasharr_data_t)
- 196 + (
sizeof (qhasharr_slot_t) * (max));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 223 qhasharr_t *
qhasharr (
void *memory,
size_t memsize) {
-
- 225 qhasharr_data_t *data = (qhasharr_data_t *) memory;
-
-
-
-
- 230 int maxslots = (memsize -
sizeof (qhasharr_data_t))
- 231 /
sizeof (qhasharr_slot_t);
- 232 if (maxslots < 1 || memsize <=
sizeof (qhasharr_t)) {
-
-
-
-
-
- 238 memset((
void *) data, 0, memsize);
- 239 data->maxslots = maxslots;
-
-
-
-
-
- 245 data->slots = (qhasharr_slot_t *) (memory +
sizeof (qhasharr_data_t));
-
-
- 248 qhasharr_t *tbl = (qhasharr_t *) malloc(
sizeof (qhasharr_t));
-
-
-
-
- 253 memset((
void *) tbl, 0,
sizeof (qhasharr_t));
-
-
-
-
-
-
-
-
-
-
-
+ 152 static qhasharr_slot_t* _get_slots(qhasharr_t *tbl);
+ 153 static bool put (qhasharr_t *tbl,
const char *key,
const void *value,
+
+ 155 static bool putstr (qhasharr_t *tbl,
const char *key,
const char *str);
+ 156 static bool putstrf (qhasharr_t *tbl,
const char *key,
const char *format, ...);
+ 157 static bool putint (qhasharr_t *tbl,
const char *key, int64_t num);
+
+ 159 static void *
get (qhasharr_t *tbl,
const char *key,
size_t *
size );
+ 160 static char *
getstr (qhasharr_t *tbl,
const char *key);
+ 161 static int64_t
getint (qhasharr_t *tbl,
const char *key);
+ 162 static bool getnext (qhasharr_t *tbl, qnobj_t *obj,
int *idx);
+
+ 164 static bool remove_ (qhasharr_t *tbl,
const char *key);
+
+ 166 static int size (qhasharr_t *tbl,
int *maxslots,
int *usedslots);
+ 167 static void clear (qhasharr_t *tbl);
+ 168 static bool debug (qhasharr_t *tbl, FILE *out);
+
+ 170 static void free_ (qhasharr_t *tbl);
+
+
+ 173 static int _find_empty(qhasharr_t *tbl,
int startidx);
+ 174 static int _get_idx(qhasharr_t *tbl,
const char *key,
unsigned int hash);
+ 175 static void *_get_data(qhasharr_t *tbl,
int idx,
size_t *
size );
+ 176 static bool _put_data(qhasharr_t *tbl,
int idx,
unsigned int hash,
+ 177 const char *key,
const void *value,
size_t size ,
+
+ 179 static bool _copy_slot(qhasharr_t *tbl,
int idx1,
int idx2);
+ 180 static bool _remove_slot(qhasharr_t *tbl,
int idx);
+ 181 static bool _remove_data(qhasharr_t *tbl,
int idx);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 196 size_t memsize =
sizeof (qhasharr_data_t)
+ 197 + (
sizeof (qhasharr_slot_t) * (max));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 224 qhasharr_t *
qhasharr (
void *memory,
size_t memsize) {
+
+ 226 qhasharr_data_t *data = (qhasharr_data_t *) memory;
+
+
+
+
+ 231 int maxslots = (memsize -
sizeof (qhasharr_data_t))
+ 232 /
sizeof (qhasharr_slot_t);
+ 233 if (maxslots < 1 || memsize <=
sizeof (qhasharr_t)) {
+
+
+
+
+
+ 239 memset((
void *) data, 0, memsize);
+ 240 data->maxslots = maxslots;
+
+
+
+
+
+ 246 qhasharr_t *tbl = (qhasharr_t *) malloc(
sizeof (qhasharr_t));
+
+
+
+
+ 251 memset((
void *) tbl, 0,
sizeof (qhasharr_t));
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 293 static bool put (qhasharr_t *tbl,
const char *key,
const void *value,
-
- 295 if (tbl == NULL || key == NULL || value == NULL) {
-
-
-
-
- 300 qhasharr_data_t *data = tbl->data;
-
-
- 303 if (data->usedslots >= data->maxslots) {
- 304 DEBUG(
"hasharr: put %s - FULL" , key);
-
-
-
-
-
- 310 unsigned int hash =
qhashmurmur3_32 (key, strlen(key)) % data->maxslots;
-
-
- 313 if (data->slots[hash].count == 0) {
-
- 315 if (_put_data(tbl, hash, hash, key, value, size, 1) ==
false ) {
- 316 DEBUG(
"hasharr: FAILED put(new) %s" , key);
-
- 318 } DEBUG(
"hasharr: put(new) %s (idx=%d,hash=%u,tot=%d)" ,
- 319 key, hash, hash, data->usedslots);
- 320 }
else if (data->slots[hash].count > 0) {
-
- 322 int idx = _get_idx(tbl, key, hash);
-
-
-
- 326 return put (tbl, key, value, size);
-
-
- 329 int idx = _find_empty(tbl, hash);
-
-
-
-
-
-
- 336 if (_put_data(tbl, idx, hash, key, value, size, -1) ==
false ) {
- 337 DEBUG(
"hasharr: FAILED put(col) %s" , key);
-
-
-
-
- 342 data->slots[hash].count++;
-
- 344 DEBUG(
"hasharr: put(col) %s (idx=%d,hash=%u,tot=%d)" ,
- 345 key, idx, hash, data->usedslots);
-
-
-
-
-
-
- 352 int idx = _find_empty(tbl, hash + 1);
-
-
-
-
-
-
- 359 _copy_slot(tbl, idx, hash);
- 360 _remove_slot(tbl, hash);
+
+
+
+ 277 static qhasharr_slot_t* _get_slots(qhasharr_t *tbl)
+
+ 279 return (qhasharr_slot_t*)((
char *)(tbl->data) +
sizeof (qhasharr_data_t));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 296 static bool put (qhasharr_t *tbl,
const char *key,
const void *value,
+
+ 298 if (tbl == NULL || key == NULL || value == NULL) {
+
+
+
+
+ 303 qhasharr_data_t *data = tbl->data;
+ 304 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+
+ 307 if (data->usedslots >= data->maxslots) {
+ 308 DEBUG(
"hasharr: put %s - FULL" , key);
+
+
+
+
+
+ 314 unsigned int hash =
qhashmurmur3_32 (key, strlen(key)) % data->maxslots;
+
+
+ 317 if (tblslots[hash].count == 0) {
+
+ 319 if (_put_data(tbl, hash, hash, key, value, size, 1) ==
false ) {
+ 320 DEBUG(
"hasharr: FAILED put(new) %s" , key);
+
+ 322 } DEBUG(
"hasharr: put(new) %s (idx=%d,hash=%u,tot=%d)" ,
+ 323 key, hash, hash, data->usedslots);
+ 324 }
else if (tblslots[hash].count > 0) {
+
+ 326 int idx = _get_idx(tbl, key, hash);
+
+
+
+ 330 return put (tbl, key, value, size);
+
+
+ 333 int idx = _find_empty(tbl, hash);
+
+
+
+
+
+
+ 340 if (_put_data(tbl, idx, hash, key, value, size, -1) ==
false ) {
+ 341 DEBUG(
"hasharr: FAILED put(col) %s" , key);
+
+
+
+
+ 346 tblslots[hash].count++;
+
+ 348 DEBUG(
"hasharr: put(col) %s (idx=%d,hash=%u,tot=%d)" ,
+ 349 key, idx, hash, data->usedslots);
+
+
+
+
+
+
+ 356 int idx = _find_empty(tbl, hash + 1);
+
+
+
+
-
- 363 if (data->slots[idx].count == -2) {
- 364 data->slots[data->slots[idx].hash].link = idx;
- 365 if (data->slots[idx].link != -1) {
- 366 data->slots[data->slots[idx].link].hash = idx;
-
-
-
-
- 371 if (_put_data(tbl, hash, hash, key, value, size, 1) ==
false ) {
- 372 DEBUG(
"hasharr: FAILED put(swp) %s" , key);
-
-
-
- 376 DEBUG(
"hasharr: put(swp) %s (idx=%u,hash=%u,tot=%d)" ,
- 377 key, hash, hash, data->usedslots);
-
+
+ 363 _copy_slot(tbl, idx, hash);
+ 364 _remove_slot(tbl, hash);
+
+
+ 367 if (tblslots[idx].count == -2) {
+ 368 tblslots[tblslots[idx].hash].link = idx;
+ 369 if (tblslots[idx].link != -1) {
+ 370 tblslots[tblslots[idx].link].hash = idx;
+
+
+
+
+ 375 if (_put_data(tbl, hash, hash, key, value, size, 1) ==
false ) {
+ 376 DEBUG(
"hasharr: FAILED put(swp) %s" , key);
+
+
-
-
-
-
-
-
-
-
-
+ 380 DEBUG(
"hasharr: put(swp) %s (idx=%u,hash=%u,tot=%d)" ,
+ 381 key, hash, hash, data->usedslots);
+
+
+
+
+
+
+
-
-
-
-
-
-
- 396 static bool putstr (qhasharr_t *tbl,
const char *key,
const char *str) {
- 397 int size = (str != NULL) ? (strlen(str) + 1) : 0;
- 398 return put (tbl, key, (
void *) str, size);
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ 400 static bool putstr (qhasharr_t *tbl,
const char *key,
const char *str) {
+ 401 int size = (str != NULL) ? (strlen(str) + 1) : 0;
+ 402 return put (tbl, key, (
void *) str, size);
+
+
+
+
-
-
-
-
-
-
-
- 415 static bool putstrf (qhasharr_t *tbl,
const char *key,
const char *format, ...) {
-
- 417 DYNAMIC_VSPRINTF(str, format);
-
-
-
-
-
- 423 bool ret =
putstr (tbl, key, str);
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 419 static bool putstrf (qhasharr_t *tbl,
const char *key,
const char *format, ...) {
+
+ 421 DYNAMIC_VSPRINTF(str, format);
+
+
+
+
+
+ 427 bool ret =
putstr (tbl, key, str);
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- 444 static bool putint (qhasharr_t *tbl,
const char *key, int64_t num) {
-
- 446 snprintf(str,
sizeof (str),
"%" PRId64, num);
- 447 return putstr (tbl, key, str);
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 448 static bool putint (qhasharr_t *tbl,
const char *key, int64_t num) {
+
+ 450 snprintf(str,
sizeof (str),
"%" PRId64, num);
+ 451 return putstr (tbl, key, str);
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- 467 static void *
get (qhasharr_t *tbl,
const char *key,
size_t *
size ) {
- 468 if (tbl == NULL || key == NULL) {
-
-
-
-
- 473 qhasharr_data_t *data = tbl->data;
-
-
- 476 unsigned int hash =
qhashmurmur3_32 (key, strlen(key)) % data->maxslots;
-
- 478 int idx = _get_idx(tbl, key, hash);
-
-
-
-
-
- 484 return _get_data(tbl, idx,
size );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 503 static char *
getstr (qhasharr_t *tbl,
const char *key) {
- 504 return (
char *)
get (tbl, key, NULL);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 520 static int64_t
getint (qhasharr_t *tbl,
const char *key) {
-
- 522 char *str =
getstr (tbl, key);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 559 static bool getnext (qhasharr_t *tbl, qnobj_t *obj,
int *idx) {
- 560 if (tbl == NULL || obj == NULL || idx == NULL) {
-
-
-
-
- 565 qhasharr_data_t *data = tbl->data;
-
- 567 for (; *idx < data->maxslots; (*idx)++) {
- 568 if (data->slots[*idx].count == 0 || data->slots[*idx].count == -2) {
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 471 static void *
get (qhasharr_t *tbl,
const char *key,
size_t *
size ) {
+ 472 if (tbl == NULL || key == NULL) {
+
+
+
+
+ 477 qhasharr_data_t *data = tbl->data;
+
+
+ 480 unsigned int hash =
qhashmurmur3_32 (key, strlen(key)) % data->maxslots;
+
+ 482 int idx = _get_idx(tbl, key, hash);
+
+
+
+
+
+ 488 return _get_data(tbl, idx,
size );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 507 static char *
getstr (qhasharr_t *tbl,
const char *key) {
+ 508 return (
char *)
get (tbl, key, NULL);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 524 static int64_t
getint (qhasharr_t *tbl,
const char *key) {
+
+ 526 char *str =
getstr (tbl, key);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 563 static bool getnext (qhasharr_t *tbl, qnobj_t *obj,
int *idx) {
+ 564 if (tbl == NULL || obj == NULL || idx == NULL) {
+
+
+
+
+ 569 qhasharr_data_t *data = tbl->data;
+ 570 qhasharr_slot_t *tblslots = _get_slots(tbl);
- 572 size_t keylen = data->slots[*idx].data.pair.keylen;
- 573 if (keylen > _Q_HASHARR_KEYSIZE)
- 574 keylen = _Q_HASHARR_KEYSIZE;
-
- 576 obj->name = (
char *) malloc(keylen + 1);
- 577 if (obj->name == NULL) {
-
-
-
- 581 memcpy(obj->name, data->slots[*idx].data.pair.key, keylen);
- 582 obj->name[keylen] =
'\0' ;
-
- 584 obj->data = _get_data(tbl, *idx, &obj->size);
- 585 if (obj->data == NULL) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 611 static bool remove_ (qhasharr_t *tbl,
const char *key) {
- 612 if (tbl == NULL || key == NULL) {
-
-
-
-
- 617 qhasharr_data_t *data = tbl->data;
-
-
- 620 unsigned int hash =
qhashmurmur3_32 (key, strlen(key)) % data->maxslots;
+ 572 for (; *idx < data->maxslots; (*idx)++) {
+ 573 if (tblslots[*idx].count == 0 || tblslots[*idx].count == -2) {
+
+
+
+ 577 size_t keylen = tblslots[*idx].data.pair.keylen;
+ 578 if (keylen > _Q_HASHARR_KEYSIZE)
+ 579 keylen = _Q_HASHARR_KEYSIZE;
+
+ 581 obj->name = (
char *) malloc(keylen + 1);
+ 582 if (obj->name == NULL) {
+
+
+
+ 586 memcpy(obj->name, tblslots[*idx].data.pair.key, keylen);
+ 587 obj->name[keylen] =
'\0' ;
+
+ 589 obj->data = _get_data(tbl, *idx, &obj->size);
+ 590 if (obj->data == NULL) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 616 static bool remove_ (qhasharr_t *tbl,
const char *key) {
+ 617 if (tbl == NULL || key == NULL) {
+
+
+
- 622 int idx = _get_idx(tbl, key, hash);
-
- 624 DEBUG(
"not found %s" , key);
-
-
-
-
- 629 if (data->slots[idx].count == 1) {
-
- 631 _remove_data(tbl, idx);
- 632 DEBUG(
"hasharr: rem %s (idx=%d,tot=%d)" , key, idx, data->usedslots);
- 633 }
else if (data->slots[idx].count > 1) {
-
-
- 636 for (idx2 = idx + 1;; idx2++) {
- 637 if (idx2 >= data->maxslots)
-
-
- 640 DEBUG(
"hasharr: [BUG] failed to remove dup key %s." , key);
-
-
-
- 644 if (data->slots[idx2].count == -1
- 645 && data->slots[idx2].hash == hash) {
-
-
-
-
-
- 651 int backupcount = data->slots[idx].count;
- 652 _remove_data(tbl, idx);
- 653 _copy_slot(tbl, idx, idx2);
- 654 _remove_slot(tbl, idx2);
+ 622 qhasharr_data_t *data = tbl->data;
+ 623 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+
+ 626 unsigned int hash =
qhashmurmur3_32 (key, strlen(key)) % data->maxslots;
+
+ 628 int idx = _get_idx(tbl, key, hash);
+
+ 630 DEBUG(
"not found %s" , key);
+
+
+
+
+ 635 if (tblslots[idx].count == 1) {
+
+ 637 _remove_data(tbl, idx);
+ 638 DEBUG(
"hasharr: rem %s (idx=%d,tot=%d)" , key, idx, data->usedslots);
+ 639 }
else if (tblslots[idx].count > 1) {
+
+
+ 642 for (idx2 = idx + 1;; idx2++) {
+ 643 if (idx2 >= data->maxslots)
+
+
+ 646 DEBUG(
"hasharr: [BUG] failed to remove dup key %s." , key);
+
+
+
+ 650 if (tblslots[idx2].count == -1
+ 651 && tblslots[idx2].hash == hash) {
+
+
+
- 656 data->slots[idx].count = backupcount - 1;
- 657 if (data->slots[idx].link != -1) {
- 658 data->slots[data->slots[idx].link].hash = idx;
-
-
- 661 DEBUG(
"hasharr: rem(lead) %s (idx=%d,tot=%d)" ,
- 662 key, idx, data->usedslots);
-
-
- 665 if (data->slots[data->slots[idx].hash].count <= 1) {
- 666 DEBUG(
"hasharr: [BUG] failed to remove %s. "
- 667 "counter of leading slot mismatch." , key);
-
-
-
- 671 data->slots[data->slots[idx].hash].count--;
-
-
- 674 _remove_data(tbl, idx);
- 675 DEBUG(
"hasharr: rem(dup) %s (idx=%d,tot=%d)" , key, idx, data->usedslots);
-
-
-
-
-
-
-
-
-
-
-
-
- 688 static int size (qhasharr_t *tbl,
int *maxslots,
int *usedslots) {
-
-
-
-
-
- 694 qhasharr_data_t *data = tbl->data;
-
- 696 if (maxslots != NULL)
- 697 *maxslots = data->maxslots;
- 698 if (usedslots != NULL)
- 699 *usedslots = data->usedslots;
-
-
-
-
-
-
-
-
-
-
-
- 711 static void clear (qhasharr_t *tbl) {
-
-
-
-
-
- 717 qhasharr_data_t *data = tbl->data;
-
- 719 if (data->usedslots == 0)
+
+ 657 int backupcount = tblslots[idx].count;
+ 658 _remove_data(tbl, idx);
+ 659 _copy_slot(tbl, idx, idx2);
+ 660 _remove_slot(tbl, idx2);
+
+ 662 tblslots[idx].count = backupcount - 1;
+ 663 if (tblslots[idx].link != -1) {
+ 664 tblslots[tblslots[idx].link].hash = idx;
+
+
+ 667 DEBUG(
"hasharr: rem(lead) %s (idx=%d,tot=%d)" ,
+ 668 key, idx, data->usedslots);
+
+
+ 671 if (tblslots[tblslots[idx].hash].count <= 1) {
+ 672 DEBUG(
"hasharr: [BUG] failed to remove %s. "
+ 673 "counter of leading slot mismatch." , key);
+
+
+
+ 677 tblslots[tblslots[idx].hash].count--;
+
+
+ 680 _remove_data(tbl, idx);
+ 681 DEBUG(
"hasharr: rem(dup) %s (idx=%d,tot=%d)" , key, idx, data->usedslots);
+
+
+
+
+
+
+
+
+
+
+
+
+ 694 static int size (qhasharr_t *tbl,
int *maxslots,
int *usedslots) {
+
+
+
+
+
+ 700 qhasharr_data_t *data = tbl->data;
+
+ 702 if (maxslots != NULL)
+ 703 *maxslots = data->maxslots;
+ 704 if (usedslots != NULL)
+ 705 *usedslots = data->usedslots;
+
+
+
+
+
+
+
+
+
+
+
+ 717 static void clear (qhasharr_t *tbl) {
+
+
-
-
-
-
-
- 726 memset((
void *) data->slots,
'\0' ,
- 727 (data->maxslots *
sizeof (qhasharr_slot_t)));
-
-
-
-
-
-
-
-
-
-
-
-
- 740 static bool debug (qhasharr_t *tbl, FILE *out) {
-
-
-
-
-
-
-
-
-
-
- 751 qhasharr_data_t *data = tbl->data;
+
+
+ 723 qhasharr_data_t *data = tbl->data;
+ 724 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+ 726 if (data->usedslots == 0)
+
+
+
+
+
+
+ 733 memset((
void *) tblslots,
'\0' ,
+ 734 (data->maxslots *
sizeof (qhasharr_slot_t)));
+
+
+
+
+
+
+
+
+
+
+
+
+ 747 static bool debug (qhasharr_t *tbl, FILE *out) {
+
+
+
+
-
-
- 755 while (tbl->getnext(tbl, &obj, &idx) ==
true ) {
- 756 uint16_t keylen = data->slots[idx - 1].data.pair.keylen;
- 757 fprintf(out,
"%s%s(%d)=" , obj.name,
- 758 (keylen > _Q_HASHARR_KEYSIZE) ?
"..." :
"" , keylen);
- 759 _q_humanOut(out, obj.data, obj.size, MAX_HUMANOUT);
- 760 fprintf(out,
" (%zu)\n" , obj.size);
-
-
-
-
-
-
- 767 fprintf(out,
"%d elements (slot %d used/%d total)\n" ,
- 768 data->num, data->usedslots, data->maxslots);
- 769 for (idx = 0; idx < data->maxslots; idx++) {
- 770 if (data->slots[idx].count == 0)
continue ;
-
- 772 fprintf(out,
"slot=%d,type=" , idx);
- 773 if (data->slots[idx].count == -2) {
- 774 fprintf(out,
"EXTEND,prev=%d,next=%d,data=" ,
- 775 data->slots[idx].hash, data->slots[idx].link);
-
- 777 data->slots[idx].data.ext.value,
- 778 data->slots[idx].size,
-
- 780 fprintf(out,
",size=%d" , data->slots[idx].size);
-
- 782 fprintf(out,
"%s" , (data->slots[idx].count == -1)?
"COLISN" :
"NORMAL" );
- 783 fprintf(out,
",count=%d,hash=%u,key=" ,
- 784 data->slots[idx].count, data->slots[idx].hash);
-
- 786 data->slots[idx].data.pair.key,
- 787 (data->slots[idx].data.pair.keylen>_Q_HASHARR_KEYSIZE)
-
- 789 : data->slots[idx].data.pair.keylen,
-
- 791 fprintf(out,
",keylen=%d,data=" , data->slots[idx].data.pair.keylen);
-
- 793 data->slots[idx].data.pair.value,
- 794 data->slots[idx].size,
-
- 796 fprintf(out,
",size=%d" , data->slots[idx].size);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 818 #ifndef _DOXYGEN_SKIP
-
-
- 821 static int _find_empty(qhasharr_t *tbl,
int startidx) {
- 822 qhasharr_data_t *data = tbl->data;
-
- 824 if (startidx >= data->maxslots)
-
-
-
-
- 829 if (data->slots[idx].count == 0)
-
-
-
- 833 if (idx >= data->maxslots)
-
-
-
-
-
-
-
-
- 842 static int _get_idx(qhasharr_t *tbl,
const char *key,
unsigned int hash) {
- 843 qhasharr_data_t *data = tbl->data;
-
- 845 if (data->slots[hash].count > 0) {
-
- 847 for (count = 0, idx = hash; count < data->slots[hash].count;) {
- 848 if (data->slots[idx].hash == hash
- 849 && (data->slots[idx].count > 0
- 850 || data->slots[idx].count == -1)) {
-
-
-
-
- 855 size_t keylen = strlen(key);
-
- 857 if (keylen == data->slots[idx].data.pair.keylen) {
- 858 if (keylen <= _Q_HASHARR_KEYSIZE) {
-
- 860 if (!memcmp(key, data->slots[idx].data.pair.key,
-
-
-
-
-
- 866 unsigned char keymd5[16];
-
- 868 if (!memcmp(key, data->slots[idx].data.pair.key,
-
-
- 871 data->slots[idx].data.pair.keymd5,
-
-
-
-
-
-
-
-
-
- 881 if (idx >= data->maxslots)
-
-
-
-
-
-
-
-
-
-
-
-
-
- 895 static void *_get_data(qhasharr_t *tbl,
int idx,
size_t *
size ) {
-
-
-
-
-
- 901 qhasharr_data_t *data = tbl->data;
-
-
-
- 905 for (newidx = idx, valsize = 0;; newidx = data->slots[newidx].link) {
- 906 valsize += data->slots[newidx].size;
- 907 if (data->slots[newidx].link == -1)
-
+
+
+
+
+
+
+ 759 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+
+
+ 763 while (tbl->getnext(tbl, &obj, &idx) ==
true ) {
+ 764 uint16_t keylen = tblslots[idx - 1].data.pair.keylen;
+ 765 fprintf(out,
"%s%s(%d)=" , obj.name,
+ 766 (keylen > _Q_HASHARR_KEYSIZE) ?
"..." :
"" , keylen);
+ 767 _q_humanOut(out, obj.data, obj.size, MAX_HUMANOUT);
+ 768 fprintf(out,
" (%zu)\n" , obj.size);
+
+
+
+
+
+
+ 775 fprintf(out,
"%d elements (slot %d used/%d total)\n" ,
+ 776 data->num, data->usedslots, data->maxslots);
+ 777 for (idx = 0; idx < data->maxslots; idx++) {
+ 778 if (tblslots[idx].count == 0)
continue ;
+
+ 780 fprintf(out,
"slot=%d,type=" , idx);
+ 781 if (tblslots[idx].count == -2) {
+ 782 fprintf(out,
"EXTEND,prev=%d,next=%d,data=" ,
+ 783 tblslots[idx].hash, tblslots[idx].link);
+
+ 785 tblslots[idx].data.ext.value,
+
+
+ 788 fprintf(out,
",size=%d" , tblslots[idx].
size );
+
+ 790 fprintf(out,
"%s" , (tblslots[idx].count == -1)?
"COLISN" :
"NORMAL" );
+ 791 fprintf(out,
",count=%d,hash=%u,key=" ,
+ 792 tblslots[idx].count, tblslots[idx].hash);
+
+ 794 tblslots[idx].data.pair.key,
+ 795 (tblslots[idx].data.pair.keylen>_Q_HASHARR_KEYSIZE)
+
+ 797 : tblslots[idx].data.pair.keylen,
+
+ 799 fprintf(out,
",keylen=%d,data=" , tblslots[idx].data.pair.keylen);
+
+ 801 tblslots[idx].data.pair.value,
+
+
+ 804 fprintf(out,
",size=%d" , tblslots[idx].
size );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 826 #ifndef _DOXYGEN_SKIP
+
+
+ 829 static int _find_empty(qhasharr_t *tbl,
int startidx) {
+ 830 qhasharr_data_t *data = tbl->data;
+ 831 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+ 833 if (startidx >= data->maxslots)
+
+
+
+
+ 838 if (tblslots[idx].count == 0)
+
+
+
+ 842 if (idx >= data->maxslots)
+
+
+
+
+
+
+
+
+ 851 static int _get_idx(qhasharr_t *tbl,
const char *key,
unsigned int hash) {
+ 852 qhasharr_data_t *data = tbl->data;
+ 853 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+ 855 if (tblslots[hash].count > 0) {
+
+ 857 for (count = 0, idx = hash; count < tblslots[hash].count;) {
+ 858 if (tblslots[idx].hash == hash
+ 859 && (tblslots[idx].count > 0
+ 860 || tblslots[idx].count == -1)) {
+
+
+
+
+ 865 size_t keylen = strlen(key);
+
+ 867 if (keylen == tblslots[idx].data.pair.keylen) {
+ 868 if (keylen <= _Q_HASHARR_KEYSIZE) {
+
+ 870 if (!memcmp(key, tblslots[idx].data.pair.key,
+
+
+
+
+
+ 876 unsigned char keymd5[16];
+
+ 878 if (!memcmp(key, tblslots[idx].data.pair.key,
+
+
+ 881 tblslots[idx].data.pair.keymd5,
+
+
+
+
+
+
+
+
+
+ 891 if (idx >= data->maxslots)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 905 static void *_get_data(qhasharr_t *tbl,
int idx,
size_t *
size ) {
+
+
+
-
- 912 value = malloc(valsize);
-
-
-
-
-
- 918 for (newidx = idx, vp = value;; newidx = data->slots[newidx].link) {
- 919 if (data->slots[newidx].count == -2) {
-
- 921 memcpy(vp, (
void *) data->slots[newidx].data.ext.value,
- 922 data->slots[newidx].size);
-
-
- 925 memcpy(vp, (
void *) data->slots[newidx].data.pair.value,
- 926 data->slots[newidx].size);
-
+
+ 912 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+
+
+ 916 for (newidx = idx, valsize = 0;; newidx = tblslots[newidx].link) {
+ 917 valsize += tblslots[newidx].size;
+ 918 if (tblslots[newidx].link == -1)
+
+
+
+
+ 923 value = malloc(valsize);
+
+
+
+
- 929 vp += data->slots[newidx].size;
- 930 if (data->slots[newidx].link == -1)
-
-
-
-
-
-
-
-
- 939 static bool _put_data(qhasharr_t *tbl,
int idx,
unsigned int hash,
- 940 const char *key,
const void *value,
size_t size,
-
- 942 qhasharr_data_t *data = tbl->data;
-
-
- 945 if (data->slots[idx].count != 0) {
- 946 DEBUG(
"hasharr: BUG found." );
-
-
-
-
- 951 size_t keylen = strlen(key);
- 952 unsigned char keymd5[16];
-
-
-
- 956 data->slots[idx].count = count;
- 957 data->slots[idx].hash = hash;
- 958 strncpy(data->slots[idx].data.pair.key, key, _Q_HASHARR_KEYSIZE);
- 959 memcpy((
char *) data->slots[idx].data.pair.keymd5, (
char *) keymd5, 16);
- 960 data->slots[idx].data.pair.keylen = keylen;
- 961 data->slots[idx].link = -1;
+ 929 for (newidx = idx, vp = value;; newidx = tblslots[newidx].link) {
+ 930 if (tblslots[newidx].count == -2) {
+
+ 932 memcpy(vp, (
void *) tblslots[newidx].data.ext.value,
+ 933 tblslots[newidx].size);
+
+
+ 936 memcpy(vp, (
void *) tblslots[newidx].data.pair.value,
+ 937 tblslots[newidx].size);
+
+
+ 940 vp += tblslots[newidx].size;
+ 941 if (tblslots[newidx].link == -1)
+
+
+
+
+
+
+
+
+ 950 static bool _put_data(qhasharr_t *tbl,
int idx,
unsigned int hash,
+ 951 const char *key,
const void *value,
size_t size,
+
+ 953 qhasharr_data_t *data = tbl->data;
+ 954 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+
+ 957 if (tblslots[idx].count != 0) {
+ 958 DEBUG(
"hasharr: BUG found." );
+
+
+
-
-
-
- 966 for (newidx = idx, savesize = 0; savesize <
size ;) {
-
- 968 int tmpidx = _find_empty(tbl, newidx + 1);
-
- 970 DEBUG(
"hasharr: Can't expand slot for key %s." , key);
- 971 _remove_data(tbl, idx);
-
-
-
-
-
- 977 memset((
void *) (&data->slots[tmpidx]),
'\0' ,
- 978 sizeof (qhasharr_slot_t));
-
- 980 data->slots[tmpidx].count = -2;
- 981 data->slots[tmpidx].hash = newidx;
- 982 data->slots[tmpidx].link = -1;
- 983 data->slots[tmpidx].size = 0;
-
- 985 data->slots[newidx].link = tmpidx;
-
- 987 DEBUG(
"hasharr: slot %d is linked to slot %d for key %s." ,
- 988 tmpidx, newidx, key);
-
-
+ 963 size_t keylen = strlen(key);
+ 964 unsigned char keymd5[16];
+
+
+
+ 968 tblslots[idx].count = count;
+ 969 tblslots[idx].hash = hash;
+ 970 strncpy(tblslots[idx].data.pair.key, key, _Q_HASHARR_KEYSIZE);
+ 971 memcpy((
char *) tblslots[idx].data.pair.keymd5, (
char *) keymd5, 16);
+ 972 tblslots[idx].data.pair.keylen = keylen;
+ 973 tblslots[idx].link = -1;
+
+
+
+
+ 978 for (newidx = idx, savesize = 0; savesize <
size ;) {
+
+ 980 int tmpidx = _find_empty(tbl, newidx + 1);
+
+ 982 DEBUG(
"hasharr: Can't expand slot for key %s." , key);
+ 983 _remove_data(tbl, idx);
+
+
+
+
+
+ 989 memset((
void *) (&tblslots[tmpidx]),
'\0' ,
+ 990 sizeof (qhasharr_slot_t));
-
- 993 size_t copysize = size - savesize;
-
- 995 if (data->slots[newidx].count == -2) {
-
- 997 if (copysize >
sizeof (
struct _Q_HASHARR_SLOT_EXT)) {
- 998 copysize =
sizeof (
struct _Q_HASHARR_SLOT_EXT);
-
- 1000 memcpy(data->slots[newidx].data.ext.value, value + savesize,
-
-
-
- 1004 if (copysize > _Q_HASHARR_VALUESIZE) {
- 1005 copysize = _Q_HASHARR_VALUESIZE;
-
- 1007 memcpy(data->slots[newidx].data.pair.value, value + savesize,
-
-
-
-
-
- 1013 data->slots[newidx].size = copysize;
- 1014 savesize += copysize;
-
-
-
-
-
-
-
-
- 1023 static bool _copy_slot(qhasharr_t *tbl,
int idx1,
int idx2) {
- 1024 qhasharr_data_t *data = tbl->data;
-
- 1026 if (data->slots[idx1].count != 0 || data->slots[idx2].count == 0) {
- 1027 DEBUG(
"hasharr: BUG found." );
-
-
+ 992 tblslots[tmpidx].count = -2;
+ 993 tblslots[tmpidx].hash = newidx;
+ 994 tblslots[tmpidx].link = -1;
+ 995 tblslots[tmpidx].size = 0;
+
+ 997 tblslots[newidx].link = tmpidx;
+
+ 999 DEBUG(
"hasharr: slot %d is linked to slot %d for key %s." ,
+ 1000 tmpidx, newidx, key);
+
+
+
+
+ 1005 size_t copysize = size - savesize;
+
+ 1007 if (tblslots[newidx].count == -2) {
+
+ 1009 if (copysize >
sizeof (
struct _Q_HASHARR_SLOT_EXT)) {
+ 1010 copysize =
sizeof (
struct _Q_HASHARR_SLOT_EXT);
+
+ 1012 memcpy(tblslots[newidx].data.ext.value, value + savesize,
+
+
+
+ 1016 if (copysize > _Q_HASHARR_VALUESIZE) {
+ 1017 copysize = _Q_HASHARR_VALUESIZE;
+
+ 1019 memcpy(tblslots[newidx].data.pair.value, value + savesize,
+
+
+
+
+
+ 1025 tblslots[newidx].size = copysize;
+ 1026 savesize += copysize;
+
+
+
- 1032 memcpy((
void *) (&data->slots[idx1]), (
void *) (&data->slots[idx2]),
- 1033 sizeof (qhasharr_slot_t));
+
+
-
-
-
-
-
-
- 1041 static bool _remove_slot(qhasharr_t *tbl,
int idx) {
- 1042 qhasharr_data_t *data = tbl->data;
-
- 1044 if (data->slots[idx].count == 0) {
- 1045 DEBUG(
"hasharr: BUG found." );
-
-
-
-
- 1050 data->slots[idx].count = 0;
-
-
-
-
-
-
+ 1035 static bool _copy_slot(qhasharr_t *tbl,
int idx1,
int idx2) {
+ 1036 qhasharr_data_t *data = tbl->data;
+ 1037 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+ 1039 if (tblslots[idx1].count != 0 || tblslots[idx2].count == 0) {
+ 1040 DEBUG(
"hasharr: BUG found." );
+
+
+
+
+ 1045 memcpy((
void *) (&tblslots[idx1]), (
void *) (&tblslots[idx2]),
+ 1046 sizeof (qhasharr_slot_t));
+
+
+
+
+
+
+
+ 1054 static bool _remove_slot(qhasharr_t *tbl,
int idx) {
+ 1055 qhasharr_data_t *data = tbl->data;
+ 1056 qhasharr_slot_t *tblslots = _get_slots(tbl);
- 1058 static bool _remove_data(qhasharr_t *tbl,
int idx) {
- 1059 qhasharr_data_t *data = tbl->data;
-
- 1061 if (data->slots[idx].count == 0) {
- 1062 DEBUG(
"hasharr: BUG found." );
-
-
-
-
-
- 1068 int link = data->slots[idx].link;
- 1069 _remove_slot(tbl, idx);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 1058 if (tblslots[idx].count == 0) {
+ 1059 DEBUG(
"hasharr: BUG found." );
+
+
+
+
+ 1064 tblslots[idx].count = 0;
+
+
+
+
+
+
+
+ 1072 static bool _remove_data(qhasharr_t *tbl,
int idx) {
+ 1073 qhasharr_data_t *data = tbl->data;
+ 1074 qhasharr_slot_t *tblslots = _get_slots(tbl);
+
+ 1076 if (tblslots[idx].count == 0) {
+ 1077 DEBUG(
"hasharr: BUG found." );
+
+
+
+
+
+ 1083 int link = tblslots[idx].link;
+ 1084 _remove_slot(tbl, idx);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+static bool getnext(qhasharr_t *tbl, qnobj_t *obj, int *idx)
qhasharr->getnext(): Get next element.
+static int64_t getint(qhasharr_t *tbl, const char *key)
qhasharr->getint(): Finds an object with given name and returns as integer type.
+qhasharr_t * qhasharr(void *memory, size_t memsize)
Initialize static hash table.
+static bool putint(qhasharr_t *tbl, const char *key, int64_t num)
qhasharr->putint(): Put an integer into this table as string type.
+static bool put(qhasharr_t *tbl, const char *key, const void *value, size_t size)
qhasharr->put(): Put an object into this table.
+bool qhashmd5(const void *data, size_t nbytes, void *retbuf)
Calculate 128-bit(16-bytes) MD5 hash.
+uint32_t qhashmurmur3_32(const void *data, size_t nbytes)
Get 32-bit Murmur3 hash.
+static bool putstr(qhasharr_t *tbl, const char *key, const char *str)
qhasharr->putstr(): Put a string into this table
+static bool remove_(qhasharr_t *tbl, const char *key)
qhasharr->remove(): Remove an object from this table.
+size_t qhasharr_calculate_memsize(int max)
Get how much memory is needed for N slots.
+static int size(qhasharr_t *tbl, int *maxslots, int *usedslots)
qhasharr->size(): Returns the number of objects in this table.
+void free_(qhasharr_t *tbl)
qhasharr->free(): De-allocate table reference object.
+static bool debug(qhasharr_t *tbl, FILE *out)
qhasharr->debug(): Print hash table for debugging purpose
+static char * getstr(qhasharr_t *tbl, const char *key)
qhasharr->getstr(): Finds an object with given name and returns as string type.
+static void clear(qhasharr_t *tbl)
qhasharr->clear(): Clears this table so that it contains no keys.
+static bool putstrf(qhasharr_t *tbl, const char *key, const char *format,...)
qhasharr->putstrf(): Put a formatted string into this table.
@@ -1154,7 +1187,7 @@
containers qhasharr.c
+ 1.8.6
diff --git a/doc/html/qhashtbl_8c.html b/doc/html/qhashtbl_8c.html
index e47d5ed0..191d592b 100644
--- a/doc/html/qhashtbl_8c.html
+++ b/doc/html/qhashtbl_8c.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qhashtbl.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -80,52 +82,52 @@
qhashtbl_t * qhashtbl (size_t range, int options)
- Initialize hash table.
+ Initialize hash table. More...
static bool put (qhashtbl_t *tbl, const char *name, const void *data, size_t size )
- qhashtbl->put() : Put a object into this table.
+ qhashtbl->put() : Put a object into this table. More...
static bool putstr (qhashtbl_t *tbl, const char *name, const char *str)
- qhashtbl->putstr() : Put a string into this table.
+ qhashtbl->putstr() : Put a string into this table. More...
static bool putstrf (qhashtbl_t *tbl, const char *name, const char *format,...)
- qhashtbl->putstrf() : Put a formatted string into this table.
+ qhashtbl->putstrf() : Put a formatted string into this table. More...
static bool putint (qhashtbl_t *tbl, const char *name, const int64_t num)
- qhashtbl->putint() : Put a integer into this table as string type.
+ qhashtbl->putint() : Put a integer into this table as string type. More...
static void * get (qhashtbl_t *tbl, const char *name, size_t *size , bool newmem)
- qhashtbl->get() : Get a object from this table.
+ qhashtbl->get() : Get a object from this table. More...
static char * getstr (qhashtbl_t *tbl, const char *name, const bool newmem)
- qhashtbl->getstr() : Finds an object with given name and returns as string type.
+ qhashtbl->getstr() : Finds an object with given name and returns as string type. More...
static int64_t getint (qhashtbl_t *tbl, const char *name)
- qhashtbl->getint() : Finds an object with given name and returns as integer type.
+ qhashtbl->getint() : Finds an object with given name and returns as integer type. More...
static bool getnext (qhashtbl_t *tbl, qhnobj_t *obj, const bool newmem)
- qhashtbl->getnext() : Get next element.
+ qhashtbl->getnext() : Get next element. More...
static bool remove_ (qhashtbl_t *tbl, const char *name)
- qhashtbl->remove(): Remove an object from this table.
+ qhashtbl->remove(): Remove an object from this table. More...
static size_t size (qhashtbl_t *tbl)
- qhashtbl->size() : Returns the number of keys in this hashtable.
+ qhashtbl->size() : Returns the number of keys in this hashtable. More...
void clear (qhashtbl_t *tbl)
- qhashtbl->clear() : Clears this hashtable so that it contains no keys.
+ qhashtbl->clear() : Clears this hashtable so that it contains no keys. More...
bool debug (qhashtbl_t *tbl, FILE *out)
- qhashtbl->debug() : Print hash table for debugging purpose
+ qhashtbl->debug() : Print hash table for debugging purpose More...
static void lock (qhashtbl_t *tbl)
- qhashtbl->lock() : Enter critical section.
+ qhashtbl->lock() : Enter critical section. More...
static void unlock (qhashtbl_t *tbl)
- qhashtbl->unlock() : Leave critical section.
+ qhashtbl->unlock() : Leave critical section. More...
void free_ (qhashtbl_t *tbl)
- qhashtbl->free(): De-allocate hash table
+ qhashtbl->free(): De-allocate hash table More...
@@ -150,7 +152,7 @@
-qhashtbl_t *tbl =
qhashtbl (0, QHASHTBL_THREADSAFE);
+qhashtbl_t *tbl =
qhashtbl (0, QHASHTBL_THREADSAFE);
tbl->put(tbl, "sample1" , "binary" , 6);
@@ -161,7 +163,7 @@
tbl->debug(tbl, stdout, true );
-void *sample1 = tbl->get(tbl,
"sample1" , &
size ,
true );
+void *sample1 = tbl->get(tbl,
"sample1" , &
size ,
true );
char *sample2 = tbl->getstr(tbl, "sample2" , false );
int sample3 = tbl->getint(tbl, "sample3" );
@@ -289,7 +291,7 @@
-
qhashtbl->put() : Put a object into this table.
+
qhashtbl->put() : Put a object into this table.
Parameters
tbl qhashtbl_t container pointer.
@@ -311,7 +313,7 @@
-Definition at line 227 of file qhashtbl.c .
+Definition at line 228 of file qhashtbl.c .
@@ -353,7 +355,7 @@
-
qhashtbl->putstr() : Put a string into this table.
+
qhashtbl->putstr() : Put a string into this table.
Parameters
tbl qhashtbl_t container pointer.
@@ -374,7 +376,7 @@
-Definition at line 310 of file qhashtbl.c .
+Definition at line 311 of file qhashtbl.c .
@@ -422,7 +424,7 @@
-
qhashtbl->putstrf() : Put a formatted string into this table.
+
qhashtbl->putstrf() : Put a formatted string into this table.
Parameters
tbl qhashtbl_t container pointer.
@@ -443,7 +445,7 @@
-Definition at line 327 of file qhashtbl.c .
+Definition at line 328 of file qhashtbl.c .
@@ -485,7 +487,7 @@
-
qhashtbl->putint() : Put a integer into this table as string type.
+
qhashtbl->putint() : Put a integer into this table as string type.
Parameters
tbl qhashtbl_t container pointer.
@@ -507,7 +509,7 @@
Note The integer will be converted to a string object and stored as string object.
-Definition at line 355 of file qhashtbl.c .
+Definition at line 356 of file qhashtbl.c .
@@ -555,7 +557,7 @@
-
qhashtbl->get() : Get a object from this table.
+
qhashtbl->get() : Get a object from this table.
Parameters
tbl qhashtbl_t container pointer.
@@ -581,16 +583,16 @@
(...codes...)
-
+
struct myobj *obj = (struct myobj*)tbl->get(tbl, "key_name" , &size, false );
-
+
struct myobj *obj = (struct myobj*)tbl->get(tbl, "key_name" , &size, true );
if (obj != NULL) free(obj);
Note If newmem flag is set, returned data will be malloced and should be deallocated by user. Otherwise returned pointer will point internal buffer directly and should not be de-allocated by user. In thread-safe mode, newmem flag should be true always.
-Definition at line 395 of file qhashtbl.c .
+Definition at line 396 of file qhashtbl.c .
@@ -632,7 +634,7 @@
-
qhashtbl->getstr() : Finds an object with given name and returns as string type.
+
qhashtbl->getstr() : Finds an object with given name and returns as string type.
Parameters
tbl qhashtbl_t container pointer.
@@ -655,7 +657,7 @@
Note If newmem flag is set, returned data will be malloced and should be deallocated by user.
-Definition at line 455 of file qhashtbl.c .
+Definition at line 456 of file qhashtbl.c .
@@ -691,7 +693,7 @@
-
qhashtbl->getint() : Finds an object with given name and returns as integer type.
+
qhashtbl->getint() : Finds an object with given name and returns as integer type.
Parameters
tbl qhashtbl_t container pointer.
@@ -712,7 +714,7 @@
-Definition at line 472 of file qhashtbl.c .
+Definition at line 473 of file qhashtbl.c .
@@ -754,7 +756,7 @@
-
qhashtbl->getnext() : Get next element.
+
qhashtbl->getnext() : Get next element.
Parameters
tbl qhashtbl_t container pointer.
@@ -801,7 +803,7 @@
tbl->unlock(tbl);
Note obj should be initialized with 0 by using memset() before first call. If newmem flag is true, user should de-allocate obj.name and obj.data resources.
-Definition at line 528 of file qhashtbl.c .
+Definition at line 529 of file qhashtbl.c .
@@ -857,7 +859,7 @@
-Definition at line 604 of file qhashtbl.c .
+Definition at line 605 of file qhashtbl.c .
@@ -883,7 +885,7 @@
-
qhashtbl->size() : Returns the number of keys in this hashtable.
+
qhashtbl->size() : Returns the number of keys in this hashtable.
Parameters
tbl qhashtbl_t container pointer.
@@ -892,7 +894,7 @@
Returns number of elements stored
-Definition at line 655 of file qhashtbl.c .
+Definition at line 656 of file qhashtbl.c .
@@ -910,7 +912,7 @@
-
qhashtbl->clear() : Clears this hashtable so that it contains no keys.
+
qhashtbl->clear() : Clears this hashtable so that it contains no keys.
Parameters
tbl qhashtbl_t container pointer.
@@ -918,7 +920,7 @@
-Definition at line 664 of file qhashtbl.c .
+Definition at line 665 of file qhashtbl.c .
@@ -946,7 +948,7 @@
-
qhashtbl->debug() : Print hash table for debugging purpose
+
qhashtbl->debug() : Print hash table for debugging purpose
Parameters
tbl qhashtbl_t container pointer.
@@ -965,7 +967,7 @@
-Definition at line 696 of file qhashtbl.c .
+Definition at line 697 of file qhashtbl.c .
@@ -991,18 +993,18 @@
-
qhashtbl->lock() : Enter critical section.
+
qhashtbl->lock() : Enter critical section.
Parameters
tbl qhashtbl_t container pointer.
-
Note From user side, normally locking operation is only needed when traverse all elements using qhashtbl->getnext() .
+Note From user side, normally locking operation is only needed when traverse all elements using qhashtbl->getnext() .
This operation will do nothing if QHASHTBL_THREADSAFE option was not given at the initialization time.
-Definition at line 728 of file qhashtbl.c .
+Definition at line 729 of file qhashtbl.c .
@@ -1028,7 +1030,7 @@
-
qhashtbl->unlock() : Leave critical section.
+
qhashtbl->unlock() : Leave critical section.
Parameters
tbl qhashtbl_t container pointer.
@@ -1037,7 +1039,7 @@
Note This operation will do nothing if QHASHTBL_THREADSAFE option was not given at the initialization time.
-Definition at line 741 of file qhashtbl.c .
+Definition at line 742 of file qhashtbl.c .
@@ -1063,7 +1065,7 @@
-Definition at line 750 of file qhashtbl.c .
+Definition at line 751 of file qhashtbl.c .
@@ -1075,7 +1077,7 @@
containers qhashtbl.c
+ 1.8.6
diff --git a/doc/html/qhashtbl_8c_source.html b/doc/html/qhashtbl_8c_source.html
index 687efc92..fbd76bd4 100644
--- a/doc/html/qhashtbl_8c_source.html
+++ b/doc/html/qhashtbl_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qhashtbl.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -163,33 +165,33 @@
98 #include "utilities/qhash.h"
99 #include "containers/qhashtbl.h"
- 101 #define DEFAULT_INDEX_RANGE (1000)
+ 101 #define DEFAULT_INDEX_RANGE (1000)
103 #ifndef _DOXYGEN_SKIP
- 106 static bool put (qhashtbl_t *tbl,
const char *name,
const void *data,
-
- 108 static bool putstr (qhashtbl_t *tbl,
const char *name,
const char *str);
- 109 static bool putstrf (qhashtbl_t *tbl,
const char *name,
const char *format, ...);
- 110 static bool putint (qhashtbl_t *tbl,
const char *name, int64_t num);
+ 106 static bool put (qhashtbl_t *tbl,
const char *name,
const void *data,
+
+ 108 static bool putstr (qhashtbl_t *tbl,
const char *name,
const char *str);
+ 109 static bool putstrf (qhashtbl_t *tbl,
const char *name,
const char *format, ...);
+ 110 static bool putint (qhashtbl_t *tbl,
const char *name, int64_t num);
- 112 static void *
get (qhashtbl_t *tbl,
const char *name,
size_t *
size ,
bool newmem);
- 113 static char *
getstr (qhashtbl_t *tbl,
const char *name,
bool newmem);
- 114 static int64_t
getint (qhashtbl_t *tbl,
const char *name);
+ 112 static void *
get (qhashtbl_t *tbl,
const char *name,
size_t *
size ,
bool newmem);
+ 113 static char *
getstr (qhashtbl_t *tbl,
const char *name,
bool newmem);
+ 114 static int64_t
getint (qhashtbl_t *tbl,
const char *name);
- 116 static bool getnext (qhashtbl_t *tbl, qhnobj_t *obj,
bool newmem);
+ 116 static bool getnext (qhashtbl_t *tbl, qhnobj_t *obj,
bool newmem);
- 118 static bool remove_ (qhashtbl_t *tbl,
const char *name);
+ 118 static bool remove_ (qhashtbl_t *tbl,
const char *name);
- 120 static size_t size (qhashtbl_t *tbl);
- 121 static void clear (qhashtbl_t *tbl);
- 122 static bool debug (qhashtbl_t *tbl, FILE *out);
+ 120 static size_t size (qhashtbl_t *tbl);
+ 121 static void clear (qhashtbl_t *tbl);
+ 122 static bool debug (qhashtbl_t *tbl, FILE *out);
- 124 static void lock (qhashtbl_t *tbl);
- 125 static void unlock (qhashtbl_t *tbl);
+ 124 static void lock (qhashtbl_t *tbl);
+ 125 static void unlock (qhashtbl_t *tbl);
- 127 static void free_ (qhashtbl_t *tbl);
+ 127 static void free_ (qhashtbl_t *tbl);
@@ -217,7 +219,7 @@
-
+
@@ -239,588 +241,606 @@
-
-
-
-
+
+
+
+
-
-
+
+
-
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
- 204 malloc_failure: errno = ENOMEM;
-
-
-
- 208 assert(tbl->qmutex == NULL);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 227 static bool put (qhashtbl_t *tbl,
const char *name,
const void *data,
-
- 229 if (name == NULL || data == NULL) {
-
-
-
-
-
-
- 236 int idx = hash % tbl->range;
-
-
-
-
-
- 242 for (obj = tbl->slots[idx]; obj != NULL; obj = obj->next) {
- 243 if (obj->hash == hash && !strcmp(obj->name, name)) {
-
-
-
-
-
- 249 char *dupname = strdup(name);
- 250 void *dupdata = malloc(size);
- 251 if (dupname == NULL || dupdata == NULL) {
-
-
-
-
-
-
-
-
- 260 memcpy(dupdata, data, size);
-
-
-
-
- 265 obj = (qhnobj_t *) calloc(1,
sizeof (qhnobj_t));
-
-
-
-
-
-
-
-
- 274 if (tbl->slots[idx] != NULL) {
-
- 276 obj->next = tbl->slots[idx];
-
- 278 tbl->slots[idx] = obj;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 310 static bool putstr (qhashtbl_t *tbl,
const char *name,
const char *str) {
- 311 size_t size = (str != NULL) ? (strlen(str) + 1) : 0;
- 312 return put (tbl, name, str, size);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 327 static bool putstrf (qhashtbl_t *tbl,
const char *name,
const char *format, ...) {
-
- 329 DYNAMIC_VSPRINTF(str, format);
-
-
-
-
-
- 335 bool ret =
putstr (tbl, name, str);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 355 static bool putint (qhashtbl_t *tbl,
const char *name,
const int64_t num) {
-
- 357 snprintf(str,
sizeof (str),
"%" PRId64, num);
- 358 return putstr (tbl, name, str);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 395 static void *
get (qhashtbl_t *tbl,
const char *name,
size_t *
size ,
bool newmem) {
-
-
-
-
-
-
- 402 int idx = hash % tbl->range;
-
-
-
-
-
- 408 for (obj = tbl->slots[idx]; obj != NULL; obj = obj->next) {
- 409 if (obj->hash == hash && !strcmp(obj->name, name)) {
-
-
-
-
-
-
- 416 if (newmem ==
false ) {
-
-
- 419 data = malloc(obj->size);
-
-
-
-
- 424 memcpy(data, obj->data, obj->size);
-
- 426 if (
size != NULL && data != NULL)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 455 static char *
getstr (qhashtbl_t *tbl,
const char *name,
const bool newmem) {
- 456 return get (tbl, name, NULL, newmem);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 472 static int64_t
getint (qhashtbl_t *tbl,
const char *name) {
-
- 474 char *str =
getstr (tbl, name,
true );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 528 static bool getnext (qhashtbl_t *tbl, qhnobj_t *obj,
const bool newmem) {
-
-
-
-
-
-
-
-
-
- 538 qhnobj_t *cursor = NULL;
-
- 540 if (obj->name != NULL) {
- 541 idx = (obj->hash % tbl->range) + 1;
-
-
-
- 545 if (cursor != NULL) {
-
-
-
-
- 550 for (; idx < tbl->range; idx++) {
- 551 if (tbl->slots[idx] != NULL) {
- 552 cursor = tbl->slots[idx];
-
-
-
-
-
-
- 559 if (cursor != NULL) {
- 560 if (newmem ==
true ) {
- 561 obj->name = strdup(cursor->name);
- 562 obj->data = malloc(cursor->size);
- 563 if (obj->name == NULL || obj->data == NULL) {
- 564 DEBUG(
"getnext(): Unable to allocate memory." );
- 565 if (obj->name != NULL)
-
- 567 if (obj->data != NULL)
-
-
-
-
-
- 573 memcpy(obj->data, cursor->data, cursor->size);
- 574 obj->size = cursor->size;
-
- 576 obj->name = cursor->name;
- 577 obj->data = cursor->data;
-
- 579 obj->hash = cursor->hash;
- 580 obj->size = cursor->size;
- 581 obj->next = cursor->next;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 604 static bool remove_ (qhashtbl_t *tbl,
const char *name) {
-
-
-
-
-
-
-
-
- 613 int idx = hash % tbl->range;
-
-
-
- 617 qhnobj_t *prev = NULL;
-
- 619 for (obj = tbl->slots[idx]; obj != NULL; obj = obj->next) {
- 620 if (obj->hash == hash && !strcmp(obj->name, name)) {
-
-
- 623 tbl->slots[idx] = obj->next;
-
- 625 prev->next = obj->next;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 655 static size_t size (qhashtbl_t *tbl) {
-
-
-
-
-
-
-
-
-
-
-
- 667 for (idx = 0; idx < tbl->range && tbl->num > 0; idx++) {
- 668 if (tbl->slots[idx] == NULL)
-
- 670 qhnobj_t *obj = tbl->slots[idx];
- 671 tbl->slots[idx] = NULL;
- 672 while (obj != NULL) {
- 673 qhnobj_t *next = obj->next;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 696 bool debug (qhashtbl_t *tbl, FILE *out) {
-
-
-
-
-
-
- 703 memset((
void *) &obj, 0,
sizeof (obj));
-
- 705 while (tbl->getnext(tbl, &obj,
false ) ==
true ) {
- 706 fprintf(out,
"%s=" , obj.name);
- 707 _q_humanOut(out, obj.data, obj.size, MAX_HUMANOUT);
- 708 fprintf(out,
" (%zu, hash=%u)\n" , obj.size, obj.hash);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 728 static void lock (qhashtbl_t *tbl) {
- 729 Q_MUTEX_ENTER(tbl->qmutex);
-
-
-
-
-
-
-
-
-
-
-
-
- 742 Q_MUTEX_LEAVE(tbl->qmutex);
-
-
-
-
-
-
-
-
-
-
- 753 if (tbl->slots != NULL)
-
-
- 756 Q_MUTEX_DESTROY(tbl->qmutex);
-
-
+
+
+
+
+
+ 209 assert(tbl->qmutex == NULL);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 228 static bool put (qhashtbl_t *tbl,
const char *name,
const void *data,
+
+ 230 if (name == NULL || data == NULL) {
+
+
+
+
+
+
+ 237 int idx = hash % tbl->range;
+
+
+
+
+
+ 243 for (obj = tbl->slots[idx]; obj != NULL; obj = obj->next) {
+ 244 if (obj->hash == hash && !strcmp(obj->name, name)) {
+
+
+
+
+
+ 250 char *dupname = strdup(name);
+ 251 void *dupdata = malloc(size);
+ 252 if (dupname == NULL || dupdata == NULL) {
+
+
+
+
+
+
+
+
+ 261 memcpy(dupdata, data, size);
+
+
+
+
+ 266 obj = (qhnobj_t *) calloc(1,
sizeof (qhnobj_t));
+
+
+
+
+
+
+
+
+ 275 if (tbl->slots[idx] != NULL) {
+
+ 277 obj->next = tbl->slots[idx];
+
+ 279 tbl->slots[idx] = obj;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 311 static bool putstr (qhashtbl_t *tbl,
const char *name,
const char *str) {
+ 312 size_t size = (str != NULL) ? (strlen(str) + 1) : 0;
+ 313 return put (tbl, name, str, size);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 328 static bool putstrf (qhashtbl_t *tbl,
const char *name,
const char *format, ...) {
+
+ 330 DYNAMIC_VSPRINTF(str, format);
+
+
+
+
+
+ 336 bool ret =
putstr (tbl, name, str);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 356 static bool putint (qhashtbl_t *tbl,
const char *name,
const int64_t num) {
+
+ 358 snprintf(str,
sizeof (str),
"%" PRId64, num);
+ 359 return putstr (tbl, name, str);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 396 static void *
get (qhashtbl_t *tbl,
const char *name,
size_t *
size ,
bool newmem) {
+
+
+
+
+
+
+ 403 int idx = hash % tbl->range;
+
+
+
+
+
+ 409 for (obj = tbl->slots[idx]; obj != NULL; obj = obj->next) {
+ 410 if (obj->hash == hash && !strcmp(obj->name, name)) {
+
+
+
+
+
+
+ 417 if (newmem ==
false ) {
+
+
+ 420 data = malloc(obj->size);
+
+
+
+
+ 425 memcpy(data, obj->data, obj->size);
+
+ 427 if (
size != NULL && data != NULL)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 456 static char *
getstr (qhashtbl_t *tbl,
const char *name,
const bool newmem) {
+ 457 return get (tbl, name, NULL, newmem);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 473 static int64_t
getint (qhashtbl_t *tbl,
const char *name) {
+
+ 475 char *str =
getstr (tbl, name,
true );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 529 static bool getnext (qhashtbl_t *tbl, qhnobj_t *obj,
const bool newmem) {
+
+
+
+
+
+
+
+
+
+ 539 qhnobj_t *cursor = NULL;
+
+ 541 if (obj->name != NULL) {
+ 542 idx = (obj->hash % tbl->range) + 1;
+
+
+
+ 546 if (cursor != NULL) {
+
+
+
+
+ 551 for (; idx < tbl->range; idx++) {
+ 552 if (tbl->slots[idx] != NULL) {
+ 553 cursor = tbl->slots[idx];
+
+
+
+
+
+
+ 560 if (cursor != NULL) {
+ 561 if (newmem ==
true ) {
+ 562 obj->name = strdup(cursor->name);
+ 563 obj->data = malloc(cursor->size);
+ 564 if (obj->name == NULL || obj->data == NULL) {
+ 565 DEBUG(
"getnext(): Unable to allocate memory." );
+ 566 if (obj->name != NULL)
+
+ 568 if (obj->data != NULL)
+
+
+
+
+
+ 574 memcpy(obj->data, cursor->data, cursor->size);
+ 575 obj->size = cursor->size;
+
+ 577 obj->name = cursor->name;
+ 578 obj->data = cursor->data;
+
+ 580 obj->hash = cursor->hash;
+ 581 obj->size = cursor->size;
+ 582 obj->next = cursor->next;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 605 static bool remove_ (qhashtbl_t *tbl,
const char *name) {
+
+
+
+
+
+
+
+
+ 614 int idx = hash % tbl->range;
+
+
+
+ 618 qhnobj_t *prev = NULL;
+
+ 620 for (obj = tbl->slots[idx]; obj != NULL; obj = obj->next) {
+ 621 if (obj->hash == hash && !strcmp(obj->name, name)) {
+
+
+ 624 tbl->slots[idx] = obj->next;
+
+ 626 prev->next = obj->next;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 656 static size_t size (qhashtbl_t *tbl) {
+
+
+
+
+
+
+
+
+
+
+
+ 668 for (idx = 0; idx < tbl->range && tbl->num > 0; idx++) {
+ 669 if (tbl->slots[idx] == NULL)
+
+ 671 qhnobj_t *obj = tbl->slots[idx];
+ 672 tbl->slots[idx] = NULL;
+ 673 while (obj != NULL) {
+ 674 qhnobj_t *next = obj->next;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 697 bool debug (qhashtbl_t *tbl, FILE *out) {
+
+
+
+
+
+
+ 704 memset((
void *) &obj, 0,
sizeof (obj));
+
+ 706 while (tbl->getnext(tbl, &obj,
false ) ==
true ) {
+ 707 fprintf(out,
"%s=" , obj.name);
+ 708 _q_humanOut(out, obj.data, obj.size, MAX_HUMANOUT);
+ 709 fprintf(out,
" (%zu, hash=%u)\n" , obj.size, obj.hash);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 729 static void lock (qhashtbl_t *tbl) {
+ 730 Q_MUTEX_ENTER(tbl->qmutex);
+
+
+
+
+
+
+
+
+
+
+
+
+ 743 Q_MUTEX_LEAVE(tbl->qmutex);
+
+
+
+
+
+
+
+
+
+
+ 754 if (tbl->slots != NULL)
+
+
+ 757 Q_MUTEX_DESTROY(tbl->qmutex);
+
+
+static bool remove_(qhashtbl_t *tbl, const char *name)
qhashtbl->remove(): Remove an object from this table.
+static bool putint(qhashtbl_t *tbl, const char *name, const int64_t num)
qhashtbl->putint(): Put a integer into this table as string type.
+#define DEFAULT_INDEX_RANGE
+uint32_t qhashmurmur3_32(const void *data, size_t nbytes)
Get 32-bit Murmur3 hash.
+static size_t size(qhashtbl_t *tbl)
qhashtbl->size(): Returns the number of keys in this hashtable.
+static void unlock(qhashtbl_t *tbl)
qhashtbl->unlock(): Leave critical section.
+static int64_t getint(qhashtbl_t *tbl, const char *name)
qhashtbl->getint(): Finds an object with given name and returns as integer type.
+qhashtbl_t * qhashtbl(size_t range, int options)
Initialize hash table.
+void free_(qhashtbl_t *tbl)
qhashtbl->free(): De-allocate hash table
+bool debug(qhashtbl_t *tbl, FILE *out)
qhashtbl->debug(): Print hash table for debugging purpose
+static bool putstr(qhashtbl_t *tbl, const char *name, const char *str)
qhashtbl->putstr(): Put a string into this table.
+static bool getnext(qhashtbl_t *tbl, qhnobj_t *obj, const bool newmem)
qhashtbl->getnext(): Get next element.
+static bool putstrf(qhashtbl_t *tbl, const char *name, const char *format,...)
qhashtbl->putstrf(): Put a formatted string into this table.
+static bool put(qhashtbl_t *tbl, const char *name, const void *data, size_t size)
qhashtbl->put(): Put a object into this table.
+static void lock(qhashtbl_t *tbl)
qhashtbl->lock(): Enter critical section.
+void clear(qhashtbl_t *tbl)
qhashtbl->clear(): Clears this hashtable so that it contains no keys.
+static char * getstr(qhashtbl_t *tbl, const char *name, const bool newmem)
qhashtbl->getstr(): Finds an object with given name and returns as string type.
@@ -829,7 +849,7 @@
containers qhashtbl.c
+ 1.8.6
diff --git a/doc/html/qhttpclient_8c.html b/doc/html/qhttpclient_8c.html
index f45c21b6..93da8ef9 100644
--- a/doc/html/qhttpclient_8c.html
+++ b/doc/html/qhttpclient_8c.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qhttpclient.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -144,61 +146,61 @@
qhttpclient_t * qhttpclient (const char *destname, int port)
- Initialize & create new HTTP client.
+ Initialize & create new HTTP client. More...
static bool setssl (qhttpclient_t *client)
- qhttpclient->setssl() : Sets connection to HTTPS connection
+ qhttpclient->setssl() : Sets connection to HTTPS connection More...
static void settimeout (qhttpclient_t *client, int timeoutms)
- qhttpclient->settimeout() : Sets connection wait timeout.
+ qhttpclient->settimeout() : Sets connection wait timeout. More...
static void setkeepalive (qhttpclient_t *client, bool keepalive)
- qhttpclient->setkeepalive() : Sets KEEP-ALIVE feature on/off.
+ qhttpclient->setkeepalive() : Sets KEEP-ALIVE feature on/off. More...
static void setuseragent (qhttpclient_t *client, const char *useragent)
- qhttpclient->setuseragent() : Sets user-agent string.
+ qhttpclient->setuseragent() : Sets user-agent string. More...
static bool open_ (qhttpclient_t *client)
- qhttpclient->open(): Opens a connection to the remote host.
+ qhttpclient->open(): Opens a connection to the remote host. More...
static bool head (qhttpclient_t *client, const char *uri, int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders)
- qhttpclient->head() : Sends a HEAD request.
+ qhttpclient->head() : Sends a HEAD request. More...
static bool get (qhttpclient_t *client, const char *uri, int fd, off_t *savesize, int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders, bool(*callback)(void *userdata, off_t recvbytes), void *userdata)
- qhttpclient->get() : Downloads a file from the remote host using GET method.
+ qhttpclient->get() : Downloads a file from the remote host using GET method. More...
static bool put (qhttpclient_t *client, const char *uri, int fd, off_t length, int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders, bool(*callback)(void *userdata, off_t sentbytes), void *userdata)
- qhttpclient->put() : Uploads a file to the remote host using PUT method.
+ qhttpclient->put() : Uploads a file to the remote host using PUT method. More...
static void * cmd (qhttpclient_t *client, const char *method, const char *uri, void *data, size_t size , int *rescode, size_t *contentslength, qlisttbl_t *reqheaders, qlisttbl_t *resheaders)
- qhttpclient->cmd() : Sends a custom request(method) to the remote host and reads it's response.
+ qhttpclient->cmd() : Sends a custom request(method) to the remote host and reads it's response. More...
static bool sendrequest (qhttpclient_t *client, const char *method, const char *uri, qlisttbl_t *reqheaders)
- qhttpclient->sendrequest() : Sends a HTTP request to the remote host.
+ qhttpclient->sendrequest() : Sends a HTTP request to the remote host. More...
static int readresponse (qhttpclient_t *client, qlisttbl_t *resheaders, off_t *contentlength)
- qhttpclient->readresponse() : Reads HTTP response header from the remote host.
+ qhttpclient->readresponse() : Reads HTTP response header from the remote host. More...
static ssize_t gets_ (qhttpclient_t *client, char *buf, size_t bufsize)
- qhttpclient->gets(): Reads a text line from a HTTP/HTTPS stream.
+ qhttpclient->gets(): Reads a text line from a HTTP/HTTPS stream. More...
static ssize_t read_ (qhttpclient_t *client, void *buf, size_t nbytes)
- qhttpclient->read(): Reads data from a HTTP/HTTPS stream.
+ qhttpclient->read(): Reads data from a HTTP/HTTPS stream. More...
static ssize_t write_ (qhttpclient_t *client, const void *buf, size_t nbytes)
- qhttpclient->write(): Writes data to a HTTP/HTTPS stream.
+ qhttpclient->write(): Writes data to a HTTP/HTTPS stream. More...
static off_t recvfile (qhttpclient_t *client, int fd, off_t nbytes)
- qhttpclient->recvfile() : Reads data from a HTTP/HTTPS stream and save into a file descriptor.
+ qhttpclient->recvfile() : Reads data from a HTTP/HTTPS stream and save into a file descriptor. More...
static off_t sendfile_ (qhttpclient_t *client, int fd, off_t nbytes)
- qhttpclient->sendfile(): Send file data to a HTTP/HTTPS stream.
+ qhttpclient->sendfile(): Send file data to a HTTP/HTTPS stream. More...
static bool _close (qhttpclient_t *client)
- qhttpclient->close(): Closes the connection.
+ qhttpclient->close(): Closes the connection. More...
static void _free (qhttpclient_t *client)
- qhttpclient->free(): Free object.
+ qhttpclient->free(): Free object. More...
@@ -210,7 +212,7 @@
int main(void ) {
- qhttpclient_t *httpclient =
qhttpclient (
"https://secure.qdecoder.org" , 0);
+ qhttpclient_t *httpclient =
qhttpclient (
"https://secure.qdecoder.org" , 0);
if (httpclient == NULL) return -1;
@@ -221,7 +223,7 @@
}
- qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
+ qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
off_t nSavesize = 0;
@@ -257,7 +259,7 @@
Content-Type=text/plain? (11)
Example code for multiple PUT operation using same keep-alive connection.
-
qhttpclient_t *httpclient =
qhttpclient (
"www.qdecoder.org" , 80);
+
qhttpclient_t *httpclient =
qhttpclient (
"www.qdecoder.org" , 80);
if (httpclient == NULL) return ;
@@ -311,13 +313,13 @@
Returns HTTP client object if succcessful, otherwise returns NULL.
-
-
qhttpclient_t *client =
qhttpclient (
"www.qdecoder.org" , 80);
-
qhttpclient_t *client =
qhttpclient (
"http://www.qdecoder.org" , 0);
-
qhttpclient_t *client =
qhttpclient (
"http://www.qdecoder.org:80" , 0);
-
qhttpclient_t *client =
qhttpclient (
"https://www.qdecoder.org" , 0);
-
qhttpclient_t *client =
qhttpclient (
"https://www.qdecoder.org:443" , 0);
-
Note Keep-alive feature is turned off by default. Turn it on by calling setkeepalive() . If destname is URI string starting with "https://", setssl() will be called internally.
+
+
qhttpclient_t *client =
qhttpclient (
"www.qdecoder.org" , 80);
+
qhttpclient_t *client =
qhttpclient (
"http://www.qdecoder.org" , 0);
+
qhttpclient_t *client =
qhttpclient (
"http://www.qdecoder.org:80" , 0);
+
qhttpclient_t *client =
qhttpclient (
"https://www.qdecoder.org" , 0);
+
qhttpclient_t *client =
qhttpclient (
"https://www.qdecoder.org:443" , 0);
+
Note Keep-alive feature is turned off by default. Turn it on by calling setkeepalive() . If destname is URI string starting with "https://", setssl() will be called internally.
Definition at line 245 of file qhttpclient.c .
@@ -345,7 +347,7 @@
-
qhttpclient->setssl() : Sets connection to HTTPS connection
+
qhttpclient->setssl() : Sets connection to HTTPS connection
Parameters
client qhttpclient object pointer
@@ -390,7 +392,7 @@
-
qhttpclient->settimeout() : Sets connection wait timeout.
+
qhttpclient->settimeout() : Sets connection wait timeout.
Parameters
client qhttpclient object pointer
@@ -437,7 +439,7 @@
-
qhttpclient->setkeepalive() : Sets KEEP-ALIVE feature on/off.
+
qhttpclient->setkeepalive() : Sets KEEP-ALIVE feature on/off.
Parameters
client qhttpclient object pointer
@@ -484,7 +486,7 @@
-
qhttpclient->setuseragent() : Sets user-agent string.
+
qhttpclient->setuseragent() : Sets user-agent string.
Parameters
client qhttpclient object pointer
@@ -585,7 +587,7 @@
-
qhttpclient->head() : Sends a HEAD request.
+
qhttpclient->head() : Sends a HEAD request.
Parameters
client qhttpclient object pointer.
@@ -599,12 +601,12 @@
Returns true if successful(got 200 response), otherwise returns false
main() {
-
qhttpclient_t *httpclient =
qhttpclient (
"http://www.qdecoder.org" , 0);
+
qhttpclient_t *httpclient =
qhttpclient (
"http://www.qdecoder.org" , 0);
if (httpclient == NULL) return ;
-
qlisttbl_t *reqheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
-
qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
+
qlisttbl_t *reqheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
+
qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
int nRescode = 0;
@@ -706,7 +708,7 @@
-
qhttpclient->get() : Downloads a file from the remote host using GET method.
+
qhttpclient->get() : Downloads a file from the remote host using GET method.
Parameters
client qhttpclient object pointer.
@@ -735,15 +737,15 @@
main() {
- qhttpclient_t *httpclient =
qhttpclient (
"http://www.qdecoder.org" , 0);
+ qhttpclient_t *httpclient =
qhttpclient (
"http://www.qdecoder.org" , 0);
if (httpclient == NULL) return ;
int nFd = open("/tmp/test.data" , O_WRONLY | O_CREAT, 0644);
- qlisttbl_t *reqheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
- qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
+ qlisttbl_t *reqheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
+ qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
struct userdata mydata;
@@ -856,7 +858,7 @@
-
qhttpclient->put() : Uploads a file to the remote host using PUT method.
+
qhttpclient->put() : Uploads a file to the remote host using PUT method.
Parameters
client qhttpclient object pointer.
@@ -885,7 +887,7 @@
main() {
- qhttpclient_t *httpclient =
qhttpclient (
"http://www.qdecoder.org" , 0);
+ qhttpclient_t *httpclient =
qhttpclient (
"http://www.qdecoder.org" , 0);
if (httpclient == NULL) return ;
@@ -895,7 +897,7 @@
time_t nFileDate = ...;
- qlisttbl_t *reqheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
+ qlisttbl_t *reqheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
reqheaders->putstr(reqheaders, "X-FILE-MD5SUM" , pFileMd5sum);
reqheaders->putInt(reqheaders, "X-FILE-DATE" , nFileDate);
@@ -905,7 +907,7 @@
int nRescode = 0;
- qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
+ qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
bool bRet = httpclient->put(httpclient,
"/img/qdecoder.png" , nFd, nFileSize,
&nRescode,
@@ -1038,7 +1040,7 @@
printf("Contents : %s\n" , (char *)contents);
free(contents);
}
-Note This store server's response into memory so if you expect server responses large amount of data, consider to use sendrequest() and readresponse() instead of using this. The returning malloced content will be allocated +1 byte than actual content size 'contentslength' and will be null terminated.
+Note This store server's response into memory so if you expect server responses large amount of data, consider to use sendrequest() and readresponse() instead of using this. The returning malloced content will be allocated +1 byte than actual content size 'contentslength' and will be null terminated.
Definition at line 1094 of file qhttpclient.c .
@@ -1088,7 +1090,7 @@
-
qhttpclient->sendrequest() : Sends a HTTP request to the remote host.
+
qhttpclient->sendrequest() : Sends a HTTP request to the remote host.
Parameters
client qhttpclient object pointer
@@ -1100,7 +1102,7 @@
Returns true if successful, otherwise returns false
Note Default headers(Host, User-Agent, Connection) will be used if reqheaders does not have those headers in it.
-qlisttbl_t *reqheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
+
qlisttbl_t *reqheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
reqheaders->putstr(reqheaders, "Date" , qTimeGetGmtStaticStr(0), true );
httpclient->sendrequest(client,
@@ -1148,7 +1150,7 @@
-
qhttpclient->readresponse() : Reads HTTP response header from the remote host.
+
qhttpclient->readresponse() : Reads HTTP response header from the remote host.
Parameters
client qhttpclient object pointer
@@ -1162,7 +1164,7 @@
httpclient->sendrequest(client, "DELETE" , "/img/qdecoder.png" , NULL);
-qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
+qlisttbl_t *resheaders =
qlisttbl (QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
off_t clength;
int rescode = httpclient->readresponse(client, resheaders, &clength);
if (clength > 0) {
@@ -1223,7 +1225,7 @@
Returns the number of bytes read from file descriptor if successful, otherwise returns -1.
-Note Be sure the return value does not mean the length of actual stored data. It means how many bytes are readed from the file descriptor, so the new-line characters will be counted, but not be stored.
+Note Be sure the return value does not mean the length of actual stored data. It means how many bytes are read from the file descriptor, so the new-line characters will be counted, but not stored.
Definition at line 1367 of file qhttpclient.c .
@@ -1515,7 +1517,7 @@
Note If the connection was not closed, it will close the connection first prior to de-allocate object.
httpclient->free(httpclient);
-Definition at line 1674 of file qhttpclient.c .
+Definition at line 1673 of file qhttpclient.c .
@@ -1527,7 +1529,7 @@
extensions qhttpclient.c
+ 1.8.6
diff --git a/doc/html/qhttpclient_8c_source.html b/doc/html/qhttpclient_8c_source.html
index 3f9c7670..cbcb29e9 100644
--- a/doc/html/qhttpclient_8c_source.html
+++ b/doc/html/qhttpclient_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qhttpclient.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -206,39 +208,39 @@
142 #ifndef _DOXYGEN_SKIP
- 144 static bool open_ (qhttpclient_t *client);
- 145 static bool setssl (qhttpclient_t *client);
- 146 static void settimeout (qhttpclient_t *client,
int timeoutms);
- 147 static void setkeepalive (qhttpclient_t *client,
bool keepalive);
- 148 static void setuseragent (qhttpclient_t *client,
const char *agentname);
+ 144 static bool open_ (qhttpclient_t *client);
+ 145 static bool setssl (qhttpclient_t *client);
+ 146 static void settimeout (qhttpclient_t *client,
int timeoutms);
+ 147 static void setkeepalive (qhttpclient_t *client,
bool keepalive);
+ 148 static void setuseragent (qhttpclient_t *client,
const char *agentname);
- 150 static bool head (qhttpclient_t *client,
const char *uri,
int *rescode,
+ 150 static bool head (qhttpclient_t *client,
const char *uri,
int *rescode,
151 qlisttbl_t *reqheaders, qlisttbl_t *resheaders);
152 static bool get (qhttpclient_t *client,
const char *uri,
int fd, off_t *savesize,
153 int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders,
154 bool (*callback)(
void *userdata, off_t recvbytes),
- 156 static bool put (qhttpclient_t *client,
const char *uri,
int fd, off_t length,
+ 156 static bool put (qhttpclient_t *client,
const char *uri,
int fd, off_t length,
157 int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders,
158 bool (*callback)(
void *userdata, off_t sentbytes),
- 160 static void *
cmd (qhttpclient_t *client,
const char *method,
const char *uri,
- 161 void *data,
size_t size ,
int *rescode,
size_t *contentslength,
+ 160 static void *
cmd (qhttpclient_t *client,
const char *method,
const char *uri,
+ 161 void *data,
size_t size ,
int *rescode,
size_t *contentslength,
162 qlisttbl_t *reqheaders, qlisttbl_t *resheaders);
- 164 static bool sendrequest (qhttpclient_t *client,
const char *method,
+ 164 static bool sendrequest (qhttpclient_t *client,
const char *method,
165 const char *uri, qlisttbl_t *reqheaders);
- 166 static int readresponse (qhttpclient_t *client, qlisttbl_t *resheaders,
+ 166 static int readresponse (qhttpclient_t *client, qlisttbl_t *resheaders,
167 off_t *contentlength);
- 169 static ssize_t
gets_ (qhttpclient_t *client,
char *buf,
size_t bufsize);
- 170 static ssize_t
read_ (qhttpclient_t *client,
void *buf,
size_t nbytes);
- 171 static ssize_t
write_ (qhttpclient_t *client,
const void *buf,
size_t nbytes);
- 172 static off_t
recvfile (qhttpclient_t *client,
int fd, off_t nbytes);
- 173 static off_t
sendfile_ (qhttpclient_t *client,
int fd, off_t nbytes);
+ 169 static ssize_t
gets_ (qhttpclient_t *client,
char *buf,
size_t bufsize);
+ 170 static ssize_t
read_ (qhttpclient_t *client,
void *buf,
size_t nbytes);
+ 171 static ssize_t
write_ (qhttpclient_t *client,
const void *buf,
size_t nbytes);
+ 172 static off_t
recvfile (qhttpclient_t *client,
int fd, off_t nbytes);
+ 173 static off_t
sendfile_ (qhttpclient_t *client,
int fd, off_t nbytes);
- 175 static bool _close (qhttpclient_t *client);
- 176 static void _free (qhttpclient_t *client);
+ 175 static bool _close (qhttpclient_t *client);
+ 176 static void _free (qhttpclient_t *client);
179 static bool _set_socket_option(
int socket);
@@ -307,7 +309,7 @@
-
+
246 bool ishttps =
false ;
248 if (port == 0 || strstr(hostname,
"://" ) != NULL) {
@@ -319,12 +321,12 @@
255 DEBUG(
"https: %d, hostname: %s, port:%d\n" , ishttps, hostname, port);
- 257 qstrcpy (hostname,
sizeof (hostname), destname);
+ 257 qstrcpy (hostname,
sizeof (hostname), destname);
261 struct sockaddr_in addr;
-
+
@@ -342,36 +344,36 @@
-
-
-
-
+
+
+
+
- 285 client->open =
open_ ;
+ 285 client->open =
open_ ;
-
+
-
-
+
+
-
-
+
+
- 295 client->gets =
gets_ ;
- 296 client->read =
read_ ;
-
-
-
+ 295 client->gets =
gets_ ;
+ 296 client->read =
read_ ;
+
+
+
-
- 302 client->free =
_free ;
+
+ 302 client->free =
_free ;
-
-
-
+
+
+
-
+
@@ -385,7 +387,7 @@
- 323 static bool setssl (qhttpclient_t *client) {
+ 323 static bool setssl (qhttpclient_t *client) {
324 #ifdef ENABLE_OPENSSL
325 static bool initialized =
false ;
@@ -393,20 +395,20 @@
- 331 if (initialized ==
true || client->ssl != NULL) {
-
-
-
-
-
-
- 338 SSL_load_error_strings();
-
-
-
- 342 client->ssl = malloc(
sizeof (
struct SslConn));
- 343 if (client->ssl == NULL)
return false ;
- 344 memset(client->ssl, 0,
sizeof (
struct SslConn));
+
+
+ 333 if (initialized ==
false ) {
+
+ 335 SSL_load_error_strings();
+
+
+
+
+ 340 if (client->ssl == NULL) {
+ 341 client->ssl = malloc(
sizeof (
struct SslConn));
+ 342 if (client->ssl == NULL)
return false ;
+ 343 memset(client->ssl, 0,
sizeof (
struct SslConn));
+
@@ -425,7 +427,7 @@
- 363 static void settimeout (qhttpclient_t *client,
int timeoutms) {
+ 363 static void settimeout (qhttpclient_t *client,
int timeoutms) {
366 client->timeoutms = timeoutms;
@@ -442,7 +444,7 @@
-
+
381 client->keepalive = keepalive;
@@ -456,7 +458,7 @@
- 394 static void setuseragent (qhttpclient_t *client,
const char *useragent) {
+ 394 static void setuseragent (qhttpclient_t *client,
const char *useragent) {
395 if (client->useragent != NULL)
396 free(client->useragent);
397 client->useragent = strdup(useragent);
@@ -479,12 +481,12 @@
- 417 static bool open_ (qhttpclient_t *client) {
+ 417 static bool open_ (qhttpclient_t *client) {
418 if (client->socket >= 0) {
-
+
-
+
@@ -506,7 +508,7 @@
441 sizeof (client->addr));
443 && (errno != EINPROGRESS
-
+
445 DEBUG(
"connection failed. (%d)" , errno);
@@ -531,7 +533,7 @@
466 ssl->ctx = SSL_CTX_new(SSLv23_client_method());
467 if (ssl->ctx == NULL) {
468 DEBUG(
"OpenSSL: %s" , ERR_reason_error_string(ERR_get_error()));
-
+
@@ -539,14 +541,14 @@
474 ssl->ssl = SSL_new(ssl->ctx);
475 if (ssl->ssl == NULL) {
476 DEBUG(
"OpenSSL: %s" , ERR_reason_error_string(ERR_get_error()));
-
+
482 if (SSL_set_fd(ssl->ssl, client->socket) != 1) {
483 DEBUG(
"OpenSSL: %s" , ERR_reason_error_string(ERR_get_error()));
-
+
@@ -556,7 +558,7 @@
492 if (SSL_connect(ssl->ssl) != 1) {
493 DEBUG(
"OpenSSL: %s" , ERR_reason_error_string(ERR_get_error()));
-
+
@@ -615,7 +617,7 @@
- 553 static bool head (qhttpclient_t *client,
const char *uri,
int *rescode,
+ 553 static bool head (qhttpclient_t *client,
const char *uri,
int *rescode,
554 qlisttbl_t *reqheaders, qlisttbl_t *resheaders) {
@@ -625,7 +627,7 @@
561 bool freeReqHeaders =
false ;
562 if (reqheaders == NULL) {
-
+
564 QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
565 freeReqHeaders =
true ;
@@ -634,30 +636,30 @@
569 reqheaders->putstr(reqheaders,
"Accept" ,
"*/*" );
- 572 bool sendret =
sendrequest (client,
"HEAD" , uri, reqheaders);
+ 572 bool sendret =
sendrequest (client,
"HEAD" , uri, reqheaders);
573 if (freeReqHeaders ==
true )
574 reqheaders->free(reqheaders);
575 if (sendret ==
false ) {
-
+
-
+
- 588 if (
read_ (client, NULL, clength) != clength) {
-
+ 588 if (
read_ (client, NULL, clength) != clength) {
+
594 if (client->keepalive ==
false || client->connclose ==
true ) {
-
+
598 if (resno == HTTP_CODE_OK)
@@ -751,7 +753,7 @@
- 689 static bool get (qhttpclient_t *client,
const char *uri,
int fd, off_t *savesize,
+ 689 static bool get (qhttpclient_t *client,
const char *uri,
int fd, off_t *savesize,
690 int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders,
691 bool (*callback)(
void *userdata, off_t recvbytes),
@@ -765,7 +767,7 @@
701 bool freeReqHeaders =
false ;
702 if (reqheaders == NULL) {
-
+
704 QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
705 freeReqHeaders =
true ;
@@ -774,17 +776,17 @@
709 reqheaders->putstr(reqheaders,
"Accept" ,
"*/*" );
- 712 bool sendret =
sendrequest (client,
"GET" , uri, reqheaders);
+ 712 bool sendret =
sendrequest (client,
"GET" , uri, reqheaders);
713 if (freeReqHeaders ==
true )
714 reqheaders->free(reqheaders);
715 if (sendret ==
false ) {
-
+
-
+
@@ -792,14 +794,14 @@
727 if (resno != HTTP_CODE_OK) {
- 730 if (
read_ (client, NULL, clength) != clength) {
-
+ 730 if (
read_ (client, NULL, clength) != clength) {
+
736 if (client->keepalive ==
false || client->connclose ==
true ) {
-
+
@@ -807,7 +809,7 @@
744 if (callback != NULL && callback(userdata, recv) ==
false ) {
-
+
@@ -820,7 +822,7 @@
755 recvsize = MAX_ATOMIC_DATA_SIZE;
- 758 ssize_t ret =
recvfile (client, fd, recvsize);
+ 758 ssize_t ret =
recvfile (client, fd, recvsize);
@@ -829,14 +831,14 @@
765 if (callback != NULL) {
766 if (callback(userdata, recv) ==
false ) {
-
+
773 if (recv != clength) {
-
+
@@ -845,7 +847,7 @@
- 783 if (
gets_ (client, buf,
sizeof (buf)) <= 0)
+ 783 if (
gets_ (client, buf,
sizeof (buf)) <= 0)
@@ -861,7 +863,7 @@
- 799 ssize_t ret =
recvfile (client, fd, recvsize);
+ 799 ssize_t ret =
recvfile (client, fd, recvsize);
@@ -871,27 +873,27 @@
- 809 if (
gets_ (client, buf,
sizeof (buf)) <= 0)
+ 809 if (
gets_ (client, buf,
sizeof (buf)) <= 0)
813 if (recvsize > 0 && callback != NULL
814 && callback(userdata, recv) ==
false ) {
-
+
818 }
while (completed ==
false );
820 if (completed ==
false ) {
821 DEBUG(
"Broken pipe. %jd/chunked, errno=%d" , recv, errno);
-
+
828 if (client->keepalive ==
false || client->connclose ==
true ) {
-
+
@@ -983,7 +985,7 @@
- 921 static bool put (qhttpclient_t *client,
const char *uri,
int fd, off_t length,
+ 921 static bool put (qhttpclient_t *client,
const char *uri,
int fd, off_t length,
922 int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders,
923 bool (*callback)(
void *userdata, off_t sentbytes),
@@ -995,7 +997,7 @@
931 bool freeReqHeaders =
false ;
932 if (reqheaders == NULL) {
-
+
934 QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
935 freeReqHeaders =
true ;
@@ -1005,39 +1007,39 @@
940 reqheaders->putstr(reqheaders,
"Expect" ,
"100-continue" );
- 943 bool sendret =
sendrequest (client,
"PUT" , uri, reqheaders);
+ 943 bool sendret =
sendrequest (client,
"PUT" , uri, reqheaders);
944 if (freeReqHeaders ==
true ) {
945 reqheaders->free(reqheaders);
948 if (sendret ==
false ) {
-
+
-
+
955 DEBUG(
"timed out %d" , client->timeoutms);
-
+
-
+
963 if (resno != HTTP_CODE_CONTINUE) {
- 968 if (
read_ (client, NULL, clength) != clength) {
-
+ 968 if (
read_ (client, NULL, clength) != clength) {
+
974 if (client->keepalive ==
false || client->connclose ==
true ) {
-
+
@@ -1046,7 +1048,7 @@
982 if (callback != NULL) {
983 if (callback(userdata, sent) ==
false ) {
-
+
@@ -1058,27 +1060,27 @@
994 sendsize = MAX_ATOMIC_DATA_SIZE;
- 996 ssize_t ret =
sendfile_ (client, fd, sendsize);
+ 996 ssize_t ret =
sendfile_ (client, fd, sendsize);
1001 if (callback != NULL) {
1002 if (callback(userdata, sent) ==
false ) {
-
+
1009 if (sent != length) {
-
+
1014 if (callback != NULL) {
1015 if (callback(userdata, sent) ==
false ) {
-
+
@@ -1086,24 +1088,24 @@
-
+
1025 if (rescode != NULL)
1028 if (resno == HTTP_NO_RESPONSE) {
-
+
- 1034 if (
read_ (client, NULL, clength) != clength) {
-
+ 1034 if (
read_ (client, NULL, clength) != clength) {
+
1040 if (client->keepalive ==
false || client->connclose ==
true ) {
-
+
1044 if (resno == HTTP_CODE_CREATED)
@@ -1156,8 +1158,8 @@
- 1094 static void *
cmd (qhttpclient_t *client,
const char *method,
const char *uri,
- 1095 void *data,
size_t size ,
int *rescode,
size_t *contentslength,
+ 1094 static void *
cmd (qhttpclient_t *client,
const char *method,
const char *uri,
+ 1095 void *data,
size_t size ,
int *rescode,
size_t *contentslength,
1096 qlisttbl_t *reqheaders, qlisttbl_t *resheaders) {
@@ -1169,34 +1171,34 @@
1105 bool freeReqHeaders =
false ;
1106 if (reqheaders == NULL && data != NULL && size > 0) {
-
+
1108 QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
1109 reqheaders->putstrf(reqheaders,
"Content-Length" ,
"%jd" , size);
1110 freeReqHeaders =
true ;
- 1113 bool sendret =
sendrequest (client, method, uri, reqheaders);
+ 1113 bool sendret =
sendrequest (client, method, uri, reqheaders);
1114 if (freeReqHeaders ==
true ) {
1115 reqheaders->free(reqheaders);
1118 if (sendret ==
false ) {
-
+
1124 if (data != NULL && size > 0) {
- 1125 ssize_t written =
write_ (client, data, size);
+ 1125 ssize_t written =
write_ (client, data, size);
1126 if (written != size) {
-
+
- 1134 int resno =
readresponse (client, resheaders, &clength);
+ 1134 int resno =
readresponse (client, resheaders, &clength);
1135 if (rescode != NULL)
1137 if (contentslength != NULL)
@@ -1207,12 +1209,12 @@
1143 content = malloc(clength + 1);
1144 if (content != NULL) {
- 1145 if (
read_ (client, content, clength) == clength) {
+ 1145 if (
read_ (client, content, clength) == clength) {
1146 *(
char *) (content + clength) =
'\0' ;
-
+
@@ -1222,7 +1224,7 @@
1159 if (client->keepalive ==
false || client->connclose ==
true ) {
-
+
@@ -1251,16 +1253,16 @@
-
+
1190 const char *uri, qlisttbl_t *reqheaders) {
- 1191 if (
open_ (client) ==
false ) {
+ 1191 if (
open_ (client) ==
false ) {
1196 bool freeReqHeaders =
false ;
1197 if (reqheaders == NULL) {
-
+
1199 QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);
1200 if (reqheaders == NULL)
@@ -1282,7 +1284,7 @@
- 1220 qvector_t *outBuf =
qvector (0);
+ 1220 qvector_t *outBuf =
qvector (0);
@@ -1306,7 +1308,7 @@
1241 char *
final = outBuf->toarray(outBuf, &towrite);
1242 ssize_t written = 0;
1243 if (
final != NULL) {
- 1244 written =
write_ (client,
final , towrite);
+ 1244 written =
write_ (client,
final , towrite);
@@ -1350,7 +1352,7 @@
-
+
1289 off_t *contentlength) {
1290 if (contentlength != NULL) {
@@ -1358,7 +1360,7 @@
- 1296 if (
gets_ (client, buf,
sizeof (buf)) <= 0)
+ 1296 if (
gets_ (client, buf,
sizeof (buf)) <= 0)
1297 return HTTP_NO_RESPONSE;
@@ -1372,7 +1374,7 @@
1307 return HTTP_NO_RESPONSE;
- 1310 while (
gets_ (client, buf,
sizeof (buf)) > 0) {
+ 1310 while (
gets_ (client, buf,
sizeof (buf)) > 0) {
@@ -1382,7 +1384,7 @@
1317 if (value != NULL) {
-
+
@@ -1426,13 +1428,13 @@
-
-
+
+
- 1367 static ssize_t
gets_ (qhttpclient_t *client,
char *buf,
size_t bufsize) {
+ 1367 static ssize_t
gets_ (qhttpclient_t *client,
char *buf,
size_t bufsize) {
1368 #ifdef ENABLE_OPENSSL
1369 if (client->ssl == NULL) {
- 1370 return qio_gets (client->socket, buf, bufsize, client->timeoutms);
+ 1370 return qio_gets (client->socket, buf, bufsize, client->timeoutms);
1372 if (bufsize <= 1)
return -1;
@@ -1470,7 +1472,7 @@
- 1408 return qio_gets (client->socket, buf, bufsize, client->timeoutms);
+ 1408 return qio_gets (client->socket, buf, bufsize, client->timeoutms);
@@ -1493,10 +1495,10 @@
- 1431 static ssize_t
read_ (qhttpclient_t *client,
void *buf,
size_t nbytes) {
+ 1431 static ssize_t
read_ (qhttpclient_t *client,
void *buf,
size_t nbytes) {
1432 #ifdef ENABLE_OPENSSL
1433 if (client->ssl == NULL) {
- 1434 return qio_read (client->socket, buf, nbytes, client->timeoutms);
+ 1434 return qio_read (client->socket, buf, nbytes, client->timeoutms);
1436 if (nbytes == 0)
return 0;
@@ -1534,7 +1536,7 @@
- 1472 return qio_read (client->socket, buf, nbytes, client->timeoutms);
+ 1472 return qio_read (client->socket, buf, nbytes, client->timeoutms);
@@ -1547,10 +1549,10 @@
- 1485 static ssize_t
write_ (qhttpclient_t *client,
const void *buf,
size_t nbytes) {
+ 1485 static ssize_t
write_ (qhttpclient_t *client,
const void *buf,
size_t nbytes) {
1486 #ifdef ENABLE_OPENSSL
1487 if (client->ssl == NULL) {
- 1488 return qio_write (client->socket, buf, nbytes, -1);
+ 1488 return qio_write (client->socket, buf, nbytes, -1);
1490 if (nbytes == 0)
return 0;
@@ -1577,7 +1579,7 @@
- 1515 return qio_write (client->socket, buf, nbytes, -1);
+ 1515 return qio_write (client->socket, buf, nbytes, -1);
@@ -1591,7 +1593,7 @@
- 1529 static off_t
recvfile (qhttpclient_t *client,
int fd, off_t nbytes) {
+ 1529 static off_t
recvfile (qhttpclient_t *client,
int fd, off_t nbytes) {
@@ -1606,12 +1608,12 @@
1541 chunksize =
sizeof (buf);
- 1544 ssize_t rsize =
read_ (client, buf, chunksize);
+ 1544 ssize_t rsize =
read_ (client, buf, chunksize);
- 1549 ssize_t wsize =
qio_write (fd, buf, rsize, -1);
+ 1549 ssize_t wsize =
qio_write (fd, buf, rsize, -1);
1550 DEBUG(
"FILE write: %zd" , wsize);
@@ -1637,7 +1639,7 @@
- 1575 static off_t
sendfile_ (qhttpclient_t *client,
int fd, off_t nbytes) {
+ 1575 static off_t
sendfile_ (qhttpclient_t *client,
int fd, off_t nbytes) {
@@ -1652,13 +1654,13 @@
1587 chunksize =
sizeof (buf);
- 1590 ssize_t rsize =
qio_read (fd, buf, chunksize, -1);
+ 1590 ssize_t rsize =
qio_read (fd, buf, chunksize, -1);
1591 DEBUG(
"FILE read: %zd" , rsize);
- 1596 ssize_t wsize =
write_ (client, buf, rsize);
+ 1596 ssize_t wsize =
write_ (client, buf, rsize);
@@ -1685,7 +1687,7 @@
-
+
1624 if (client->socket < 0)
@@ -1711,107 +1713,136 @@
1646 if (client->ssl == NULL && MAX_SHUTDOWN_WAIT >= 0
1647 && shutdown(client->socket, SHUT_WR) == 0) {
- 1649 while (
qio_read (client->socket, buf,
sizeof (buf), MAX_SHUTDOWN_WAIT) > 0)
-
-
-
-
- 1654 close(client->socket);
- 1655 client->socket = -1;
- 1656 client->connclose =
false ;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1674 static void _free (qhttpclient_t *client) {
- 1675 if (client->socket >= 0) {
- 1676 client->close(client);
-
-
- 1679 if (client->ssl != NULL)
-
- 1681 if (client->hostname != NULL)
- 1682 free(client->hostname);
- 1683 if (client->useragent != NULL)
- 1684 free(client->useragent);
-
-
-
-
- 1689 #ifndef _DOXYGEN_SKIP
- 1690 static bool _set_socket_option(
int socket) {
-
-
-
- 1694 if (SET_TCP_LINGER_TIMEOUT > 0) {
-
-
- 1697 li.l_linger = SET_TCP_LINGER_TIMEOUT;
- 1698 if (setsockopt(socket, SOL_SOCKET, SO_LINGER, &li,
- 1699 sizeof (
struct linger)) < 0) {
-
-
-
-
-
- 1705 if (SET_TCP_NODELAY > 0) {
- 1706 int so_tcpnodelay = 1;
- 1707 if (setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, &so_tcpnodelay,
- 1708 sizeof (so_tcpnodelay)) < 0) {
-
-
-
-
-
-
-
- 1716 static bool _parse_uri(
const char *uri,
bool *protocol,
char *hostname,
- 1717 size_t namesize,
int *port) {
-
- 1719 if (!strncasecmp(uri,
"http://" , CONST_STRLEN(
"http://" ))) {
-
-
- 1722 }
else if (!strncasecmp(uri,
"https://" , CONST_STRLEN(
"https://" ))) {
-
-
-
-
-
-
- 1729 char *t1 = strstr(uri,
"://" );
-
- 1731 char *t2 = strstr(t1,
"/" );
-
- 1733 t2 = (
char *) uri + strlen(uri);
-
- 1735 if (t2 - t1 + 1 > namesize)
-
- 1737 qstrncpy (hostname, namesize, t1, t2 - t1);
-
- 1739 t1 = strstr(hostname,
":" );
-
-
- 1742 *port = atoi(t1 + 1);
-
-
-
-
-
-
-
+ 1649 while (
qio_read (client->socket, buf,
sizeof (buf), MAX_SHUTDOWN_WAIT) > 0);
+
+
+
+ 1653 close(client->socket);
+ 1654 client->socket = -1;
+ 1655 client->connclose =
false ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1673 static void _free (qhttpclient_t *client) {
+ 1674 if (client->socket >= 0) {
+ 1675 client->close(client);
+
+
+ 1678 if (client->ssl != NULL)
+
+ 1680 if (client->hostname != NULL)
+ 1681 free(client->hostname);
+ 1682 if (client->useragent != NULL)
+ 1683 free(client->useragent);
+
+
+
+
+ 1688 #ifndef _DOXYGEN_SKIP
+ 1689 static bool _set_socket_option(
int socket) {
+
+
+
+ 1693 if (SET_TCP_LINGER_TIMEOUT > 0) {
+
+
+ 1696 li.l_linger = SET_TCP_LINGER_TIMEOUT;
+ 1697 if (setsockopt(socket, SOL_SOCKET, SO_LINGER, &li,
+ 1698 sizeof (
struct linger)) < 0) {
+
+
+
+
+
+ 1704 if (SET_TCP_NODELAY > 0) {
+ 1705 int so_tcpnodelay = 1;
+ 1706 if (setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, &so_tcpnodelay,
+ 1707 sizeof (so_tcpnodelay)) < 0) {
+
+
+
+
+
+
+
+ 1715 static bool _parse_uri(
const char *uri,
bool *protocol,
char *hostname,
+ 1716 size_t namesize,
int *port) {
+
+ 1718 if (!strncasecmp(uri,
"http://" , CONST_STRLEN(
"http://" ))) {
+
+
+ 1721 }
else if (!strncasecmp(uri,
"https://" , CONST_STRLEN(
"https://" ))) {
+
+
+
+
+
+
+ 1728 char *t1 = strstr(uri,
"://" );
+
+ 1730 char *t2 = strstr(t1,
"/" );
+
+ 1732 t2 = (
char *) uri + strlen(uri);
+
+ 1734 if (t2 - t1 + 1 > namesize)
+
+ 1736 qstrncpy (hostname, namesize, t1, t2 - t1);
+
+ 1738 t1 = strstr(hostname,
":" );
+
+
+ 1741 *port = atoi(t1 + 1);
+
+
+
+
+
+
+
+static size_t size(qlist_t *list)
qlist->size(): Returns the number of elements in this list.
+static bool _close(qhttpclient_t *client)
qhttpclient->close(): Closes the connection.
+static void setkeepalive(qhttpclient_t *client, bool keepalive)
qhttpclient->setkeepalive(): Sets KEEP-ALIVE feature on/off.
+static ssize_t gets_(qhttpclient_t *client, char *buf, size_t bufsize)
qhttpclient->gets(): Reads a text line from a HTTP/HTTPS stream.
+static void settimeout(qhttpclient_t *client, int timeoutms)
qhttpclient->settimeout(): Sets connection wait timeout.
+ssize_t qio_gets(int fd, char *buf, size_t bufsize, int timeoutms)
Read a line from a file descriptor into the buffer pointed to until either a terminating newline or E...
+static bool sendrequest(qhttpclient_t *client, const char *method, const char *uri, qlisttbl_t *reqheaders)
qhttpclient->sendrequest(): Sends a HTTP request to the remote host.
+bool qsocket_get_addr(struct sockaddr_in *addr, const char *hostname, int port)
Convert hostname to sockaddr_in structure.
+qlisttbl_t * qlisttbl(int options)
Create a new Q_LIST linked-list container.
+char * qstrncpy(char *dst, size_t size, const char *src, size_t nbytes)
Copy src string to dst no more than n bytes.
+static off_t sendfile_(qhttpclient_t *client, int fd, off_t nbytes)
qhttpclient->sendfile(): Send file data to a HTTP/HTTPS stream.
+static void * cmd(qhttpclient_t *client, const char *method, const char *uri, void *data, size_t size, int *rescode, size_t *contentslength, qlisttbl_t *reqheaders, qlisttbl_t *resheaders)
qhttpclient->cmd(): Sends a custom request(method) to the remote host and reads it's response...
+static bool put(qhttpclient_t *client, const char *uri, int fd, off_t length, int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders, bool(*callback)(void *userdata, off_t sentbytes), void *userdata)
qhttpclient->put(): Uploads a file to the remote host using PUT method.
+char * qstrtrim(char *str)
Remove white spaces(including CR, LF) from head and tail of the string.
+static void setuseragent(qhttpclient_t *client, const char *useragent)
qhttpclient->setuseragent(): Sets user-agent string.
+static ssize_t write_(qhttpclient_t *client, const void *buf, size_t nbytes)
qhttpclient->write(): Writes data to a HTTP/HTTPS stream.
+static void _free(qhttpclient_t *client)
qhttpclient->free(): Free object.
+char * qstrcpy(char *dst, size_t size, const char *src)
Copy src string to dst.
+static bool setssl(qhttpclient_t *client)
qhttpclient->setssl(): Sets connection to HTTPS connection
+static int readresponse(qhttpclient_t *client, qlisttbl_t *resheaders, off_t *contentlength)
qhttpclient->readresponse(): Reads HTTP response header from the remote host.
+ssize_t qio_read(int fd, void *buf, size_t nbytes, int timeoutms)
Read from a file descriptor.
+qhttpclient_t * qhttpclient(const char *destname, int port)
Initialize & create new HTTP client.
+int qio_wait_writable(int fd, int timeoutms)
Test & wait until the file descriptor is ready for writing.
+ssize_t qio_write(int fd, const void *buf, size_t nbytes, int timeoutms)
Write to a file descriptor.
+static off_t recvfile(qhttpclient_t *client, int fd, off_t nbytes)
qhttpclient->recvfile(): Reads data from a HTTP/HTTPS stream and save into a file descriptor...
+static ssize_t read_(qhttpclient_t *client, void *buf, size_t nbytes)
qhttpclient->read(): Reads data from a HTTP/HTTPS stream.
+qvector_t * qvector(int options)
Initialize vector.
+int qio_wait_readable(int fd, int timeoutms)
Test & wait until the file descriptor has readable data.
+static bool head(qhttpclient_t *client, const char *uri, int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders)
qhttpclient->head(): Sends a HEAD request.
+static bool open_(qhttpclient_t *client)
qhttpclient->open(): Opens a connection to the remote host.
@@ -1820,7 +1851,7 @@
extensions qhttpclient.c
+ 1.8.6
diff --git a/doc/html/qio_8c.html b/doc/html/qio_8c.html
index 4f9eb0fe..00a61648 100644
--- a/doc/html/qio_8c.html
+++ b/doc/html/qio_8c.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qio.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -81,28 +83,28 @@
int qio_wait_readable (int fd, int timeoutms)
- Test & wait until the file descriptor has readable data.
+ Test & wait until the file descriptor has readable data. More...
int qio_wait_writable (int fd, int timeoutms)
- Test & wait until the file descriptor is ready for writing.
+ Test & wait until the file descriptor is ready for writing. More...
ssize_t qio_read (int fd, void *buf, size_t nbytes, int timeoutms)
- Read from a file descriptor.
+ Read from a file descriptor. More...
ssize_t qio_write (int fd, const void *buf, size_t nbytes, int timeoutms)
- Write to a file descriptor.
+ Write to a file descriptor. More...
off_t qio_send (int outfd, int infd, off_t nbytes, int timeoutms)
- Transfer data between file descriptors.
+ Transfer data between file descriptors. More...
ssize_t qio_gets (int fd, char *buf, size_t bufsize, int timeoutms)
- Read a line from a file descriptor into the buffer pointed to until either a terminating newline or EOF.
+ Read a line from a file descriptor into the buffer pointed to until either a terminating newline or EOF. More...
ssize_t qio_puts (int fd, const char *str, int timeoutms)
- Writes the string and a trailing newline to file descriptor.
+ Writes the string and a trailing newline to file descriptor. More...
ssize_t qio_printf (int fd, int timeoutms, const char *format,...)
- Formatted output to a file descriptor.
+ Formatted output to a file descriptor. More...
@@ -501,7 +503,7 @@
utilities qio.c
+ 1.8.6
diff --git a/doc/html/qio_8c_source.html b/doc/html/qio_8c_source.html
index ffed665c..5d0a4b02 100644
--- a/doc/html/qio_8c_source.html
+++ b/doc/html/qio_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qio.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -121,7 +123,7 @@
-
+
@@ -149,7 +151,7 @@
-
+
@@ -180,13 +182,13 @@
- 118 ssize_t
qio_read (
int fd,
void *buf,
size_t nbytes,
int timeoutms) {
+ 118 ssize_t
qio_read (
int fd,
void *buf,
size_t nbytes,
int timeoutms) {
123 while (total < nbytes) {
-
+
127 ssize_t rsize = read(fd, buf + total, nbytes - total);
@@ -221,13 +223,13 @@
- 159 ssize_t
qio_write (
int fd,
const void *buf,
size_t nbytes,
int timeoutms) {
+ 159 ssize_t
qio_write (
int fd,
const void *buf,
size_t nbytes,
int timeoutms) {
164 while (total < nbytes) {
-
+
167 ssize_t wsize = write(fd, buf + total, nbytes - total);
@@ -261,7 +263,7 @@
- 199 off_t
qio_send (
int outfd,
int infd, off_t nbytes,
int timeoutms) {
+ 199 off_t
qio_send (
int outfd,
int infd, off_t nbytes,
int timeoutms) {
@@ -276,13 +278,13 @@
211 chunksize =
sizeof (buf);
- 214 ssize_t rsize =
qio_read (infd, buf, chunksize, timeoutms);
+ 214 ssize_t rsize =
qio_read (infd, buf, chunksize, timeoutms);
215 DEBUG(
"read %zd" , rsize);
- 220 ssize_t wsize =
qio_write (outfd, buf, rsize, timeoutms);
+ 220 ssize_t wsize =
qio_write (outfd, buf, rsize, timeoutms);
221 DEBUG(
"write %zd" , wsize);
@@ -319,14 +321,14 @@
- 257 ssize_t
qio_gets (
int fd,
char *buf,
size_t bufsize,
int timeoutms) {
+ 257 ssize_t
qio_gets (
int fd,
char *buf,
size_t bufsize,
int timeoutms) {
263 for (ptr = buf; readcnt < (bufsize - 1); ptr++) {
- 264 ssize_t rsize =
qio_read (fd, ptr, 1, timeoutms);
+ 264 ssize_t rsize =
qio_read (fd, ptr, 1, timeoutms);
266 if (errno == EAGAIN || errno == EINPROGRESS) {
@@ -363,7 +365,7 @@
- 301 ssize_t
qio_puts (
int fd,
const char *str,
int timeoutms) {
+ 301 ssize_t
qio_puts (
int fd,
const char *str,
int timeoutms) {
302 size_t strsize = strlen(str);
303 char *newstr = (
char *) malloc(strsize + 1 + 1);
@@ -371,7 +373,7 @@
306 strncpy(newstr, str, strsize);
307 newstr[strsize] =
'\n' ;
308 newstr[strsize + 1] =
'\0' ;
- 309 ssize_t ret =
qio_write (fd, newstr, strsize + 1, timeoutms);
+ 309 ssize_t ret =
qio_write (fd, newstr, strsize + 1, timeoutms);
@@ -387,17 +389,25 @@
- 325 ssize_t
qio_printf (
int fd,
int timeoutms,
const char *format, ...) {
+ 325 ssize_t
qio_printf (
int fd,
int timeoutms,
const char *format, ...) {
327 DYNAMIC_VSPRINTF(buf, format);
- 331 ssize_t ret =
qio_write (fd, buf, strlen(buf), timeoutms);
+ 331 ssize_t ret =
qio_write (fd, buf, strlen(buf), timeoutms);
+ssize_t qio_printf(int fd, int timeoutms, const char *format,...)
Formatted output to a file descriptor.
+ssize_t qio_gets(int fd, char *buf, size_t bufsize, int timeoutms)
Read a line from a file descriptor into the buffer pointed to until either a terminating newline or E...
+ssize_t qio_puts(int fd, const char *str, int timeoutms)
Writes the string and a trailing newline to file descriptor.
+off_t qio_send(int outfd, int infd, off_t nbytes, int timeoutms)
Transfer data between file descriptors.
+ssize_t qio_read(int fd, void *buf, size_t nbytes, int timeoutms)
Read from a file descriptor.
+int qio_wait_writable(int fd, int timeoutms)
Test & wait until the file descriptor is ready for writing.
+ssize_t qio_write(int fd, const void *buf, size_t nbytes, int timeoutms)
Write to a file descriptor.
+int qio_wait_readable(int fd, int timeoutms)
Test & wait until the file descriptor has readable data.
@@ -406,7 +416,7 @@
utilities qio.c
+ 1.8.6
diff --git a/doc/html/qlist_8c.html b/doc/html/qlist_8c.html
index 3a16ee7a..6ad561c7 100644
--- a/doc/html/qlist_8c.html
+++ b/doc/html/qlist_8c.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qlist.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,79 +76,79 @@
qlist_t * qlist (int options)
- Create new qlist_t linked-list container.
+ Create new qlist_t linked-list container. More...
static size_t setsize (qlist_t *list, size_t max)
- qlist->setsize() : Limit maximum number of elements allowed in this list.
+ qlist->setsize() : Limit maximum number of elements allowed in this list. More...
static bool addfirst (qlist_t *list, const void *data, size_t size )
- qlist->addfirst() : Inserts a element at the beginning of this list.
+ qlist->addfirst() : Inserts a element at the beginning of this list. More...
static bool addlast (qlist_t *list, const void *data, size_t size )
- qlist->addlast() : Appends a element to the end of this list.
+ qlist->addlast() : Appends a element to the end of this list. More...
static bool addat (qlist_t *list, int index, const void *data, size_t size )
- qlist->addat() : Inserts a element at the specified position in this list.
+ qlist->addat() : Inserts a element at the specified position in this list. More...
static void * getfirst (qlist_t *list, size_t *size , bool newmem)
- qlist->getfirst() : Returns the first element in this list.
+ qlist->getfirst() : Returns the first element in this list. More...
static void * getlast (qlist_t *list, size_t *size , bool newmem)
- qlist->getlast() : Returns the last element in this list.
+ qlist->getlast() : Returns the last element in this list. More...
static void * getat (qlist_t *list, int index, size_t *size , bool newmem)
- qlist->getat() : Returns the element at the specified position in this list.
+ qlist->getat() : Returns the element at the specified position in this list. More...
static bool getnext (qlist_t *list, qdlobj_t *obj, bool newmem)
- qlist->getnext() : Get next element in this list.
+ qlist->getnext() : Get next element in this list. More...
static void * popfirst (qlist_t *list, size_t *size )
- qlist->popfirst() : Returns and remove the first element in this list.
+ qlist->popfirst() : Returns and remove the first element in this list. More...
static void * poplast (qlist_t *list, size_t *size )
- qlist->getlast() : Returns and remove the last element in this list.
+ qlist->getlast() : Returns and remove the last element in this list. More...
static void * popat (qlist_t *list, int index, size_t *size )
- qlist->popat() : Returns and remove the element at the specified position in this list.
+ qlist->popat() : Returns and remove the element at the specified position in this list. More...
static bool removefirst (qlist_t *list)
- qlist->removefirst() : Removes the first element in this list.
+ qlist->removefirst() : Removes the first element in this list. More...
static bool removelast (qlist_t *list)
- qlist->removelast() : Removes the last element in this list.
+ qlist->removelast() : Removes the last element in this list. More...
static bool removeat (qlist_t *list, int index)
- qlist->removeat() : Removes the element at the specified position in this list.
+ qlist->removeat() : Removes the element at the specified position in this list. More...
static size_t size (qlist_t *list)
- qlist->size() : Returns the number of elements in this list.
+ qlist->size() : Returns the number of elements in this list. More...
static size_t datasize (qlist_t *list)
- qlist->size() : Returns the sum of total element size.
+ qlist->size() : Returns the sum of total element size. More...
static void reverse (qlist_t *list)
- qlist->reverse() : Reverse the order of elements.
+ qlist->reverse() : Reverse the order of elements. More...
static void clear (qlist_t *list)
- qlist->clear() : Removes all of the elements from this list.
+ qlist->clear() : Removes all of the elements from this list. More...
static void * toarray (qlist_t *list, size_t *size )
- qlist->toarray() : Returns the serialized chunk containing all the elements in this list.
+ qlist->toarray() : Returns the serialized chunk containing all the elements in this list. More...
static char * tostring (qlist_t *list)
- qlist->tostring() : Returns a string representation of this list, containing string representation of each element.
+ qlist->tostring() : Returns a string representation of this list, containing string representation of each element. More...
static bool debug (qlist_t *list, FILE *out)
- qlist->debug() : Prints out stored elements for debugging purpose.
+ qlist->debug() : Prints out stored elements for debugging purpose. More...
static void lock (qlist_t *list)
- qlist->lock() : Enters critical section.
+ qlist->lock() : Enters critical section. More...
static void unlock (qlist_t *list)
- qlist->unlock() : Leaves critical section.
+ qlist->unlock() : Leaves critical section. More...
static void free_ (qlist_t *list)
- qlist->free(): Free qlist_t.
+ qlist->free(): Free qlist_t. More...
@@ -167,7 +169,7 @@
| DATA B |
+----------------------------------------+
-
qlist_t *list =
qlist (QLIST_THREADSAFE);
+
qlist_t *list =
qlist (QLIST_THREADSAFE);
list->addlast(list, "e1" , sizeof ("e1" ));
@@ -230,7 +232,7 @@
-
qlist_t *list =
qlist (0);
+
qlist_t *list =
qlist (0);
Note Available options:
QLIST_THREADSAFE - make it thread-safe.
@@ -272,7 +274,7 @@
-
qlist->setsize() : Limit maximum number of elements allowed in this list.
+
qlist->setsize() : Limit maximum number of elements allowed in this list.
Parameters
list qlist_t container pointer.
@@ -325,7 +327,7 @@
-
qlist->addfirst() : Inserts a element at the beginning of this list.
+
qlist->addfirst() : Inserts a element at the beginning of this list.
Parameters
list qlist_t container pointer.
@@ -350,7 +352,7 @@
struct my_obj obj;
-
+
list->addfirst(list, &obj, sizeof (struct my_obj));
Definition at line 257 of file qlist.c .
@@ -395,7 +397,7 @@
-
qlist->addlast() : Appends a element to the end of this list.
+
qlist->addlast() : Appends a element to the end of this list.
Parameters
list qlist_t container pointer.
@@ -465,7 +467,7 @@
-
qlist->addat() : Inserts a element at the specified position in this list.
+
qlist->addat() : Inserts a element at the specified position in this list.
Parameters
list qlist_t container pointer.
@@ -492,7 +494,7 @@
Linked-list [ A ]<=>[ B ]<=>[ C ]?==?[ ]
(positive index) 0 1 2 3
(negative index) -3 -2 -1
-
list->addat(list, 0, &obj, sizeof (obj));
list->addat(list, -1, &obj, sizeof (obj));
Note Index starts from 0.
@@ -539,7 +541,7 @@
-
qlist->getfirst() : Returns the first element in this list.
+
qlist->getfirst() : Returns the first element in this list.
Parameters
list qlist_t container pointer.
@@ -559,7 +561,7 @@
-
+
void *data = list->getfirst(list, &size, true );
if (data != NULL) {
(...omit...)
@@ -608,7 +610,7 @@
-
qlist->getlast() : Returns the last element in this list.
+
qlist->getlast() : Returns the last element in this list.
Parameters
list qlist_t container pointer.
@@ -673,7 +675,7 @@
-
qlist->getat() : Returns the element at the specified position in this list.
+
qlist->getat() : Returns the element at the specified position in this list.
Parameters
list qlist_t container pointer.
@@ -695,7 +697,7 @@
Linked-list [ A ]<=>[ B ]<=>[ C ]
(positive index) 0 1 2
(negative index) -3 -2 -1
-Note Negative index can be used for addressing a element from the end in this stack. For example, index -1 is same as getlast() and index 0 is same as getfirst() ;
+Note Negative index can be used for addressing a element from the end in this stack. For example, index -1 is same as getlast() and index 0 is same as getfirst() ;
Definition at line 472 of file qlist.c .
@@ -739,7 +741,7 @@
-
qlist->getnext() : Get next element in this list.
+
qlist->getnext() : Get next element in this list.
Parameters
list qlist_t container pointer.
@@ -756,7 +758,7 @@
Note obj should be initialized with 0 by using memset() before first call. If newmem flag is true, user should de-allocate obj.name and obj.data resources.
-
+
(...add data into list...)
qdlobj_t obj;
@@ -803,7 +805,7 @@
-
qlist->popfirst() : Returns and remove the first element in this list.
+
qlist->popfirst() : Returns and remove the first element in this list.
Parameters
list qlist_t container pointer.
@@ -855,7 +857,7 @@
-
qlist->getlast() : Returns and remove the last element in this list.
+
qlist->getlast() : Returns and remove the last element in this list.
Parameters
list qlist_t container pointer.
@@ -913,7 +915,7 @@
-
qlist->popat() : Returns and remove the element at the specified position in this list.
+
qlist->popat() : Returns and remove the element at the specified position in this list.
Parameters
list qlist_t container pointer.
@@ -933,7 +935,7 @@
Linked-list [ A ]<=>[ B ]<=>[ C ]
(positive index) 0 1 2
(negative index) -3 -2 -1
-Note Negative index can be used for addressing a element from the end in this stack. For example, index -1 is same as poplast() and index 0 is same as popfirst() ;
+Note Negative index can be used for addressing a element from the end in this stack. For example, index -1 is same as poplast() and index 0 is same as popfirst() ;
Definition at line 602 of file qlist.c .
@@ -961,7 +963,7 @@
-
qlist->removefirst() : Removes the first element in this list.
+
qlist->removefirst() : Removes the first element in this list.
Parameters
list qlist_t container pointer.
@@ -1002,7 +1004,7 @@
-
qlist->removelast() : Removes the last element in this list.
+
qlist->removelast() : Removes the last element in this list.
Parameters
list qlist_t container pointer.
@@ -1053,7 +1055,7 @@
-
qlist->removeat() : Removes the element at the specified position in this list.
+
qlist->removeat() : Removes the element at the specified position in this list.
Parameters
list qlist_t container pointer.
@@ -1095,7 +1097,7 @@
-
qlist->size() : Returns the number of elements in this list.
+
qlist->size() : Returns the number of elements in this list.
Parameters
list qlist_t container pointer.
@@ -1130,7 +1132,7 @@
-
qlist->size() : Returns the sum of total element size.
+
qlist->size() : Returns the sum of total element size.
Parameters
list qlist_t container pointer.
@@ -1165,7 +1167,7 @@
-
qlist->reverse() : Reverse the order of elements.
+
qlist->reverse() : Reverse the order of elements.
Parameters
list qlist_t container pointer.
@@ -1199,7 +1201,7 @@
-
qlist->clear() : Removes all of the elements from this list.
+
qlist->clear() : Removes all of the elements from this list.
Parameters
list qlist_t container pointer.
@@ -1337,7 +1339,7 @@
-
qlist->debug() : Prints out stored elements for debugging purpose.
+
qlist->debug() : Prints out stored elements for debugging purpose.
Parameters
list qlist_t container pointer.
@@ -1379,14 +1381,14 @@
-
qlist->lock() : Enters critical section.
+
qlist->lock() : Enters critical section.
Parameters
list qlist_t container pointer.
-
Note From user side, normally locking operation is only needed when traverse all elements using qlist->getnext() .
+
Note From user side, normally locking operation is only needed when traverse all elements using qlist->getnext() .
Definition at line 853 of file qlist.c .
@@ -1414,7 +1416,7 @@
-
qlist->unlock() : Leaves critical section.
+
qlist->unlock() : Leaves critical section.
Parameters
list qlist_t container pointer.
@@ -1468,7 +1470,7 @@
containers qlist.c
+ 1.8.6
diff --git a/doc/html/qlist_8c_source.html b/doc/html/qlist_8c_source.html
index 1372e84d..6fed040d 100644
--- a/doc/html/qlist_8c_source.html
+++ b/doc/html/qlist_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qlist.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -165,41 +167,41 @@
102 #ifndef _DOXYGEN_SKIP
- 103 static size_t setsize (qlist_t *list,
size_t max);
+ 103 static size_t setsize (qlist_t *list,
size_t max);
- 105 static bool addfirst (qlist_t *list,
const void *data,
size_t size );
- 106 static bool addlast (qlist_t *list,
const void *data,
size_t size );
- 107 static bool addat (qlist_t *list,
int index,
const void *data,
size_t size );
+ 105 static bool addfirst (qlist_t *list,
const void *data,
size_t size );
+ 106 static bool addlast (qlist_t *list,
const void *data,
size_t size );
+ 107 static bool addat (qlist_t *list,
int index,
const void *data,
size_t size );
- 109 static void *
getfirst (qlist_t *list,
size_t *
size ,
bool newmem);
- 110 static void *
getlast (qlist_t *list,
size_t *
size ,
bool newmem);
- 111 static void *
getat (qlist_t *list,
int index,
size_t *
size ,
bool newmem);
- 112 static bool getnext (qlist_t *list, qdlobj_t *obj,
bool newmem);
+ 109 static void *
getfirst (qlist_t *list,
size_t *
size ,
bool newmem);
+ 110 static void *
getlast (qlist_t *list,
size_t *
size ,
bool newmem);
+ 111 static void *
getat (qlist_t *list,
int index,
size_t *
size ,
bool newmem);
+ 112 static bool getnext (qlist_t *list, qdlobj_t *obj,
bool newmem);
-
-
- 116 static void *
popat (qlist_t *list,
int index,
size_t *
size );
+
+
+ 116 static void *
popat (qlist_t *list,
int index,
size_t *
size );
-
-
- 120 static bool removeat (qlist_t *list,
int index);
+
+
+ 120 static bool removeat (qlist_t *list,
int index);
- 122 static size_t size (qlist_t *list);
- 123 static size_t datasize (qlist_t *list);
- 124 static void reverse (qlist_t *list);
- 125 static void clear (qlist_t *list);
+ 122 static size_t size (qlist_t *list);
+ 123 static size_t datasize (qlist_t *list);
+ 124 static void reverse (qlist_t *list);
+ 125 static void clear (qlist_t *list);
-
- 128 static char *
tostring (qlist_t *list);
- 129 static bool debug (qlist_t *list, FILE *out);
+
+ 128 static char *
tostring (qlist_t *list);
+ 129 static bool debug (qlist_t *list, FILE *out);
- 131 static void lock (qlist_t *list);
- 132 static void unlock (qlist_t *list);
+ 131 static void lock (qlist_t *list);
+ 132 static void unlock (qlist_t *list);
- 134 static void free_ (qlist_t *list);
+ 134 static void free_ (qlist_t *list);
- 137 static void *_get_at(qlist_t *list,
int index,
size_t *
size ,
bool newmem,
+ 137 static void *_get_at(qlist_t *list,
int index,
size_t *
size ,
bool newmem,
139 static qdlobj_t *_get_obj(qlist_t *list,
int index);
140 static bool _remove_obj(qlist_t *list, qdlobj_t *obj);
@@ -222,7 +224,7 @@
-
+
161 qlist_t *list = (qlist_t *) calloc(1,
sizeof (qlist_t));
@@ -240,39 +242,39 @@
-
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
+
@@ -288,11 +290,11 @@
- 226 static size_t setsize (qlist_t *list,
size_t max) {
-
+ 226 static size_t setsize (qlist_t *list,
size_t max) {
+
228 size_t old = list->max;
-
+
@@ -319,8 +321,8 @@
-
- 258 return addat (list, 0, data, size);
+
+ 258 return addat (list, 0, data, size);
@@ -337,8 +339,8 @@
- 275 static bool addlast (qlist_t *list,
const void *data,
size_t size ) {
- 276 return addat (list, -1, data, size);
+ 275 static bool addlast (qlist_t *list,
const void *data,
size_t size ) {
+ 276 return addat (list, -1, data, size);
@@ -374,19 +376,19 @@
- 312 static bool addat (qlist_t *list,
int index,
const void *data,
size_t size ) {
+ 312 static bool addat (qlist_t *list,
int index,
const void *data,
size_t size ) {
314 if (data == NULL || size <= 0) {
-
+
322 if (list->max > 0 && list->num >= list->max) {
-
+
@@ -395,7 +397,7 @@
330 index = (list->num + index) + 1;
331 if (index < 0 || index > list->num) {
-
+
@@ -403,7 +405,7 @@
339 void *dup_data = malloc(size);
340 if (dup_data == NULL) {
-
+
@@ -413,12 +415,12 @@
348 qdlobj_t *obj = (qdlobj_t *) malloc(
sizeof (qdlobj_t));
-
+
355 obj->data = dup_data;
-
+
@@ -446,7 +448,7 @@
-
+
@@ -458,10 +460,10 @@
- 396 list->datasum +=
size ;
+ 396 list->datasum +=
size ;
-
+
@@ -487,8 +489,8 @@
-
- 426 return getat (list, 0, size, newmem);
+
+ 426 return getat (list, 0, size, newmem);
@@ -503,8 +505,8 @@
-
- 442 return getat (list, -1, size, newmem);
+
+ 442 return getat (list, -1, size, newmem);
@@ -534,7 +536,7 @@
- 472 static void *
getat (qlist_t *list,
int index,
size_t *
size ,
bool newmem) {
+ 472 static void *
getat (qlist_t *list,
int index,
size_t *
size ,
bool newmem) {
473 return _get_at(list, index, size, newmem,
false );
@@ -568,11 +570,11 @@
- 506 static bool getnext (qlist_t *list, qdlobj_t *obj,
bool newmem) {
+ 506 static bool getnext (qlist_t *list, qdlobj_t *obj,
bool newmem) {
-
+
512 qdlobj_t *cont = NULL;
@@ -582,7 +584,7 @@
-
+
@@ -605,7 +607,7 @@
-
+
@@ -620,8 +622,8 @@
-
- 559 return popat (list, 0, size);
+
+ 559 return popat (list, 0, size);
@@ -635,8 +637,8 @@
-
- 574 return popat (list, -1, size);
+
+ 574 return popat (list, -1, size);
@@ -664,7 +666,7 @@
- 602 static void *
popat (qlist_t *list,
int index,
size_t *
size ) {
+ 602 static void *
popat (qlist_t *list,
int index,
size_t *
size ) {
603 return _get_at(list, index, size,
true ,
true );
@@ -677,8 +679,8 @@
-
-
+
+
@@ -690,8 +692,8 @@
-
-
+
+
@@ -705,19 +707,19 @@
-
-
+
+
647 qdlobj_t *obj = _get_obj(list, index);
-
+
653 bool ret = _remove_obj(list, obj);
-
+
@@ -729,7 +731,7 @@
- 667 static size_t size (qlist_t *list) {
+ 667 static size_t size (qlist_t *list) {
@@ -740,7 +742,7 @@
-
+
679 return list->datasum;
@@ -749,8 +751,8 @@
-
-
+
+
690 for (obj = list->first; obj;) {
691 qdlobj_t *next = obj->next;
@@ -763,7 +765,7 @@
698 list->first = list->last;
-
+
@@ -771,8 +773,8 @@
-
-
+
+
712 for (obj = list->first; obj;) {
713 qdlobj_t *next = obj->next;
@@ -785,7 +787,7 @@
-
+
@@ -801,7 +803,7 @@
-
+
740 if (list->num <= 0) {
@@ -809,11 +811,11 @@
-
+
749 void *chunk = malloc(list->datasum);
-
+
@@ -824,7 +826,7 @@
759 memcpy(dp, obj->data, obj->size);
-
+
765 *size = list->datasum;
@@ -846,17 +848,17 @@
-
+
785 if (list->num <= 0) {
-
+
792 void *chunk = malloc(list->datasum + 1);
-
+
@@ -864,15 +866,15 @@
801 for (obj = list->first; obj; obj = obj->next) {
- 802 size_t size = obj->size;
+ 802 size_t size = obj->size;
804 if (*(
char *) (obj->data + (size - 1)) ==
'\0' )
806 memcpy(dp, obj->data, size);
-
+
809 *((
char *) dp) =
'\0' ;
-
+
812 return (
char *) chunk;
@@ -887,13 +889,13 @@
- 825 static bool debug (qlist_t *list, FILE *out) {
+ 825 static bool debug (qlist_t *list, FILE *out) {
-
+
834 for (i = 0, obj = list->first; obj; obj = obj->next, i++) {
@@ -901,7 +903,7 @@
836 _q_humanOut(out, obj->data, obj->size, MAX_HUMANOUT);
837 fprintf(out,
" (%zu)\n" , obj->size);
-
+
@@ -915,7 +917,7 @@
- 853 static void lock (qlist_t *list) {
+ 853 static void lock (qlist_t *list) {
854 Q_MUTEX_ENTER(list->qmutex);
@@ -924,7 +926,7 @@
-
+
863 Q_MUTEX_LEAVE(list->qmutex);
@@ -933,8 +935,8 @@
-
-
+
+
873 Q_MUTEX_DESTROY(list->qmutex);
@@ -942,14 +944,14 @@
878 #ifndef _DOXYGEN_SKIP
- 880 static void *_get_at(qlist_t *list,
int index,
size_t *
size ,
bool newmem,
+ 880 static void *_get_at(qlist_t *list,
int index,
size_t *
size ,
bool newmem,
-
+
885 qdlobj_t *obj = _get_obj(list, index);
-
+
@@ -958,7 +960,7 @@
893 if (newmem ==
true ) {
894 data = malloc(obj->size);
-
+
@@ -978,7 +980,7 @@
-
+
@@ -1051,6 +1053,31 @@
+static size_t size(qlist_t *list)
qlist->size(): Returns the number of elements in this list.
+static void * getfirst(qlist_t *list, size_t *size, bool newmem)
qlist->getfirst(): Returns the first element in this list.
+static void unlock(qlist_t *list)
qlist->unlock(): Leaves critical section.
+qlist_t * qlist(int options)
Create new qlist_t linked-list container.
+static bool removefirst(qlist_t *list)
qlist->removefirst(): Removes the first element in this list.
+static bool addfirst(qlist_t *list, const void *data, size_t size)
qlist->addfirst(): Inserts a element at the beginning of this list.
+static bool removelast(qlist_t *list)
qlist->removelast(): Removes the last element in this list.
+static void * getlast(qlist_t *list, size_t *size, bool newmem)
qlist->getlast(): Returns the last element in this list.
+static void * popat(qlist_t *list, int index, size_t *size)
qlist->popat(): Returns and remove the element at the specified position in this list.
+static void * getat(qlist_t *list, int index, size_t *size, bool newmem)
qlist->getat(): Returns the element at the specified position in this list.
+static void * popfirst(qlist_t *list, size_t *size)
qlist->popfirst(): Returns and remove the first element in this list.
+static void lock(qlist_t *list)
qlist->lock(): Enters critical section.
+static bool addlast(qlist_t *list, const void *data, size_t size)
qlist->addlast(): Appends a element to the end of this list.
+static void clear(qlist_t *list)
qlist->clear(): Removes all of the elements from this list.
+static size_t setsize(qlist_t *list, size_t max)
qlist->setsize(): Limit maximum number of elements allowed in this list.
+static bool addat(qlist_t *list, int index, const void *data, size_t size)
qlist->addat(): Inserts a element at the specified position in this list.
+static bool removeat(qlist_t *list, int index)
qlist->removeat(): Removes the element at the specified position in this list.
+static char * tostring(qlist_t *list)
qlist->tostring(): Returns a string representation of this list, containing string representation of ...
+static void free_(qlist_t *list)
qlist->free(): Free qlist_t.
+static void * poplast(qlist_t *list, size_t *size)
qlist->getlast(): Returns and remove the last element in this list.
+static void * toarray(qlist_t *list, size_t *size)
qlist->toarray(): Returns the serialized chunk containing all the elements in this list...
+static void reverse(qlist_t *list)
qlist->reverse(): Reverse the order of elements.
+static bool debug(qlist_t *list, FILE *out)
qlist->debug(): Prints out stored elements for debugging purpose.
+static bool getnext(qlist_t *list, qdlobj_t *obj, bool newmem)
qlist->getnext(): Get next element in this list.
+static size_t datasize(qlist_t *list)
qlist->size(): Returns the sum of total element size.
@@ -1059,7 +1086,7 @@
containers qlist.c
+ 1.8.6
diff --git a/doc/html/qlisttbl_8c.html b/doc/html/qlisttbl_8c.html
index 4291df9b..a6df49f8 100644
--- a/doc/html/qlisttbl_8c.html
+++ b/doc/html/qlisttbl_8c.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qlisttbl.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,70 +76,70 @@
qlisttbl_t * qlisttbl (int options)
- Create a new Q_LIST linked-list container.
+ Create a new Q_LIST linked-list container. More...
static bool put (qlisttbl_t *tbl, const char *name, const void *data, size_t size )
- qlisttbl->put() : Put an element to this table.
+ qlisttbl->put() : Put an element to this table. More...
static bool putstr (qlisttbl_t *tbl, const char *name, const char *str)
- qlisttbl->putstr() : Put a string into this table.
+ qlisttbl->putstr() : Put a string into this table. More...
static bool putstrf (qlisttbl_t *tbl, const char *name, const char *format,...)
- qlisttbl->putstrf() : Put a formatted string into this table.
+ qlisttbl->putstrf() : Put a formatted string into this table. More...
static bool putint (qlisttbl_t *tbl, const char *name, int64_t num)
- qlisttbl->putInt(): Put an integer into this table as string type.
+ qlisttbl->putInt(): Put an integer into this table as string type. More...
static void * get (qlisttbl_t *tbl, const char *name, size_t *size , bool newmem)
- qlisttbl->get() : Finds an object with given name.
+ qlisttbl->get() : Finds an object with given name. More...
static char * getstr (qlisttbl_t *tbl, const char *name, bool newmem)
- qlisttbl->getstr() : Finds an object with given name and returns as string type.
+ qlisttbl->getstr() : Finds an object with given name and returns as string type. More...
static int64_t getint (qlisttbl_t *tbl, const char *name)
- qlisttbl->getint() : Finds an object with given name and returns as integer type.
+ qlisttbl->getint() : Finds an object with given name and returns as integer type. More...
static qobj_t * getmulti (qlisttbl_t *tbl, const char *name, bool newmem, size_t *numobjs)
- qlisttbl->getmulti() : Finds all objects with given name and return a array of objects.
+ qlisttbl->getmulti() : Finds all objects with given name and return a array of objects. More...
static void freemulti (qobj_t *objs)
- qlisttbl->freemulti() : Deallocate object array returned by getmulti() .
+ qlisttbl->freemulti() : Deallocate object array returned by getmulti() . More...
static bool getnext (qlisttbl_t *tbl, qdlnobj_t *obj, const char *name, bool newmem)
- qlisttbl->getnext() : Get next element.
+ qlisttbl->getnext() : Get next element. More...
static size_t remove_ (qlisttbl_t *tbl, const char *name)
- qlisttbl->remove(): Remove matched objects with given name.
+ qlisttbl->remove(): Remove matched objects with given name. More...
static bool removeobj (qlisttbl_t *tbl, const qdlnobj_t *obj)
- qlisttbl->removeobj() : Remove objects with given object pointer.
+ qlisttbl->removeobj() : Remove objects with given object pointer. More...
static size_t size (qlisttbl_t *tbl)
- qlisttbl->size() : Returns the number of elements in this table.
+ qlisttbl->size() : Returns the number of elements in this table. More...
static void sort_ (qlisttbl_t *tbl)
- qlisttbl->sort(): Sort keys in this table.
+ qlisttbl->sort(): Sort keys in this table. More...
static void clear (qlisttbl_t *tbl)
- qlisttbl->clear() : Removes all of the elements from this table.
+ qlisttbl->clear() : Removes all of the elements from this table. More...
static bool save (qlisttbl_t *tbl, const char *filepath, char sepchar, bool encode)
- qlisttbl->save() : Save qlisttbl as plain text format Dumping direction is always forward(from the top to the bottom) to preserve the order when we load the file again.
+ qlisttbl->save() : Save qlisttbl as plain text format Dumping direction is always forward(from the top to the bottom) to preserve the order when we load the file again. More...
static ssize_t load (qlisttbl_t *tbl, const char *filepath, char sepchar, bool decode)
- qlisttbl->load() : Load and append entries from given filepath Loading direction is always appending at the bottom of the table to preserve the order as it was.
+ qlisttbl->load() : Load and append entries from given filepath Loading direction is always appending at the bottom of the table to preserve the order as it was. More...
static bool debug (qlisttbl_t *tbl, FILE *out)
- qlisttbl->debug() : Print out stored elements for debugging purpose.
+ qlisttbl->debug() : Print out stored elements for debugging purpose. More...
static void lock (qlisttbl_t *tbl)
- qlisttbl->lock() : Enter critical section.
+ qlisttbl->lock() : Enter critical section. More...
static void unlock (qlisttbl_t *tbl)
- qlisttbl->unlock() : Leave critical section.
+ qlisttbl->unlock() : Leave critical section. More...
static void free_ (qlisttbl_t *tbl)
- qlisttbl->free(): Free qlisttbl_t
+ qlisttbl->free(): Free qlisttbl_t More...
@@ -159,7 +161,7 @@
| KEY B | | VALUE B |
+-------+ +---------+
-
qlisttbl_t *tbl =
qlisttbl (QLISTTBL_THREADSAFE);
+
qlisttbl_t *tbl =
qlisttbl (QLISTTBL_THREADSAFE);
tbl->put(tbl, "e1" , "a" , strlen("e1" )+1);
@@ -226,8 +228,8 @@
-
-
qlisttbl_t *threadsafe_tbl =
qlisttbl (QLISTTBL_THREADSAFE);
+
+
qlisttbl_t *threadsafe_tbl =
qlisttbl (QLISTTBL_THREADSAFE);
Note Available options:
QLISTTBL_THREADSAFE - make it thread-safe.
QLISTTBL_UNIQUE - keys are all unique. replace same key
@@ -285,7 +287,7 @@
-
qlisttbl->put() : Put an element to this table.
+
qlisttbl->put() : Put an element to this table.
Parameters
tbl qlisttbl container pointer.
@@ -314,7 +316,7 @@
struct my_obj obj;
-
+
tbl->put(tbl, "obj1" , &obj, sizeof (struct my_obj));
Note The default behavior is adding an object at the end of this table unless QLISTTBL_INSERTTOP option was given.
@@ -360,7 +362,7 @@
-
qlisttbl->putstr() : Put a string into this table.
+
qlisttbl->putstr() : Put a string into this table.
Parameters
tbl qlisttbl container pointer.
@@ -429,7 +431,7 @@
-
qlisttbl->putstrf() : Put a formatted string into this table.
+
qlisttbl->putstrf() : Put a formatted string into this table.
Parameters
tbl qlisttbl container pointer.
@@ -562,7 +564,7 @@
-
qlisttbl->get() : Finds an object with given name.
+
qlisttbl->get() : Finds an object with given name.
If there are duplicate keys in the table, this will return the first matched one from the bottom (or the top if QLISTTBL_LOOKUPFORWARD option was given). So if there are duplicated keys, it'll return recently inserted one.
Parameters
-
+
(...codes...)
-
+
void *data = tbl->get(tbl, "key_name" , &size, false );
-
+
void *data = tbl->get(tbl, "key_name" , &size, true );
(...does something with data...)
if (data != NULL) free(data);
@@ -641,7 +643,7 @@
-
qlisttbl->getstr() : Finds an object with given name and returns as string type.
+
qlisttbl->getstr() : Finds an object with given name and returns as string type.
Parameters
tbl qlisttbl container pointer.
@@ -699,7 +701,7 @@
-
qlisttbl->getint() : Finds an object with given name and returns as integer type.
+
qlisttbl->getint() : Finds an object with given name and returns as integer type.
Parameters
tbl qlisttbl container pointer.
@@ -768,7 +770,7 @@
-
qlisttbl->getmulti() : Finds all objects with given name and return a array of objects.
+
qlisttbl->getmulti() : Finds all objects with given name and return a array of objects.
If there are duplicate keys in the table, this will return all the matched ones. The order of objects in return depends on setnextdir() setting. By default, the order is same(forward) as listed in the table.
Parameters
-
Note The returned array of qobj_t should be released by freemulti() call after use. Even you call getmulti() with newmem set false, freemulti() should be called all the times, so the object array itself can be released.
+
Note The returned array of qobj_t should be released by freemulti() call after use. Even you call getmulti() with newmem set false, freemulti() should be called all the times, so the object array itself can be released.
size_t numobjs = 0;
qobj_t *objs = tbl->getmulti(tbl, "e2" , true , &numobjs);
for (i = 0; objs[i].data != NULL; i++) {
@@ -825,7 +827,7 @@
-
qlisttbl->getnext() : Get next element.
+
qlisttbl->getnext() : Get next element.
Default searching direction is backward, from the bottom to top unless QLISTTBL_LOOKUPFORWARD option was specified.
Parameters
@@ -909,7 +911,7 @@
Note The obj should be initialized with 0 by using memset() before first call. If newmem flag is true, user should de-allocate obj.name and obj.data resources.
-
+
(...add data into table...)
@@ -1014,8 +1016,8 @@
-
qlisttbl->removeobj() : Remove objects with given object pointer.
-
This call is useful when you want to remove an element while traversing a table using getnext() . So the address pointed by obj maybe different than the actual object in a table, but it's ok because we'll recalculate the actual object address by referring it's links.
+
qlisttbl->removeobj() : Remove objects with given object pointer.
+
This call is useful when you want to remove an element while traversing a table using getnext() . So the address pointed by obj maybe different than the actual object in a table, but it's ok because we'll recalculate the actual object address by referring it's links.
Parameters
tbl qlisttbl container pointer.
@@ -1067,7 +1069,7 @@
-
qlisttbl->size() : Returns the number of elements in this table.
+
qlisttbl->size() : Returns the number of elements in this table.
Parameters
tbl qlisttbl container pointer.
@@ -1147,7 +1149,7 @@
-
qlisttbl->clear() : Removes all of the elements from this table.
+
qlisttbl->clear() : Removes all of the elements from this table.
Parameters
tbl qlisttbl container pointer.
@@ -1311,7 +1313,7 @@
-
qlisttbl->debug() : Print out stored elements for debugging purpose.
+
qlisttbl->debug() : Print out stored elements for debugging purpose.
Parameters
tbl qlisttbl container pointer.
@@ -1356,14 +1358,14 @@
-
qlisttbl->lock() : Enter critical section.
+
qlisttbl->lock() : Enter critical section.
Parameters
tbl qlisttbl container pointer.
-
Note Normally explicit locking is only needed when traverse all the elements with qlisttbl->getnext() .
+
Note Normally explicit locking is only needed when traverse all the elements with qlisttbl->getnext() .
Definition at line 1049 of file qlisttbl.c .
@@ -1391,7 +1393,7 @@
-
qlisttbl->unlock() : Leave critical section.
+
qlisttbl->unlock() : Leave critical section.
Parameters
tbl qlisttbl container pointer.
@@ -1445,7 +1447,7 @@
containers qlisttbl.c
+ 1.8.6
diff --git a/doc/html/qlisttbl_8c_source.html b/doc/html/qlisttbl_8c_source.html
index 257187e7..494c4f7d 100644
--- a/doc/html/qlisttbl_8c_source.html
+++ b/doc/html/qlisttbl_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qlisttbl.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -182,37 +184,37 @@
118 #ifndef _DOXYGEN_SKIP
- 120 static bool put (qlisttbl_t *tbl,
const char *name,
const void *data,
size_t size );
- 121 static bool putstr (qlisttbl_t *tbl,
const char *name,
const char *str);
- 122 static bool putstrf (qlisttbl_t *tbl,
const char *name,
const char *format, ...);
- 123 static bool putint (qlisttbl_t *tbl,
const char *name, int64_t num);
+ 120 static bool put (qlisttbl_t *tbl,
const char *name,
const void *data,
size_t size );
+ 121 static bool putstr (qlisttbl_t *tbl,
const char *name,
const char *str);
+ 122 static bool putstrf (qlisttbl_t *tbl,
const char *name,
const char *format, ...);
+ 123 static bool putint (qlisttbl_t *tbl,
const char *name, int64_t num);
- 125 static void *
get (qlisttbl_t *tbl,
const char *name,
size_t *
size ,
bool newmem);
- 126 static char *
getstr (qlisttbl_t *tbl,
const char *name,
bool newmem);
- 127 static int64_t
getint (qlisttbl_t *tbl,
const char *name);
+ 125 static void *
get (qlisttbl_t *tbl,
const char *name,
size_t *
size ,
bool newmem);
+ 126 static char *
getstr (qlisttbl_t *tbl,
const char *name,
bool newmem);
+ 127 static int64_t
getint (qlisttbl_t *tbl,
const char *name);
- 129 static qobj_t *
getmulti (qlisttbl_t *tbl,
const char *name,
bool newmem,
size_t *numobjs);
-
- 131 static bool getnext (qlisttbl_t *tbl, qdlnobj_t *obj,
const char *name,
bool newmem);
+ 129 static qobj_t *
getmulti (qlisttbl_t *tbl,
const char *name,
bool newmem,
size_t *numobjs);
+
+ 131 static bool getnext (qlisttbl_t *tbl, qdlnobj_t *obj,
const char *name,
bool newmem);
- 133 static size_t remove_ (qlisttbl_t *tbl,
const char *name);
- 134 static bool removeobj (qlisttbl_t *tbl,
const qdlnobj_t *obj);
+ 133 static size_t remove_ (qlisttbl_t *tbl,
const char *name);
+ 134 static bool removeobj (qlisttbl_t *tbl,
const qdlnobj_t *obj);
- 136 static size_t size (qlisttbl_t *tbl);
- 137 static void sort_ (qlisttbl_t *tbl);
- 138 static void clear (qlisttbl_t *tbl);
+ 136 static size_t size (qlisttbl_t *tbl);
+ 137 static void sort_ (qlisttbl_t *tbl);
+ 138 static void clear (qlisttbl_t *tbl);
- 140 static bool save (qlisttbl_t *tbl,
const char *filepath,
char sepchar,
bool encode);
- 141 static ssize_t
load (qlisttbl_t *tbl,
const char *filepath,
char sepchar,
bool decode);
- 142 static bool debug (qlisttbl_t *tbl, FILE *out);
+ 140 static bool save (qlisttbl_t *tbl,
const char *filepath,
char sepchar,
bool encode);
+ 141 static ssize_t
load (qlisttbl_t *tbl,
const char *filepath,
char sepchar,
bool decode);
+ 142 static bool debug (qlisttbl_t *tbl, FILE *out);
- 144 static void lock (qlisttbl_t *tbl);
- 145 static void unlock (qlisttbl_t *tbl);
+ 144 static void lock (qlisttbl_t *tbl);
+ 145 static void unlock (qlisttbl_t *tbl);
- 147 static void free_ (qlisttbl_t *tbl);
+ 147 static void free_ (qlisttbl_t *tbl);
- 150 static qdlnobj_t *_createobj(
const char *name,
const void *data,
size_t size );
+ 150 static qdlnobj_t *_createobj(
const char *name,
const void *data,
size_t size );
151 static bool _insertobj(qlisttbl_t *tbl, qdlnobj_t *obj);
152 static qdlnobj_t *_findobj(qlisttbl_t *tbl,
const char *name, qdlnobj_t *retobj);
@@ -243,7 +245,7 @@
-
+
183 qlisttbl_t *tbl = (qlisttbl_t *)calloc(1,
sizeof (qlisttbl_t));
@@ -252,36 +254,36 @@
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
+
222 tbl->namematch = _namematch;
@@ -343,7 +345,7 @@
- 281 static bool put (qlisttbl_t *tbl,
const char *name,
const void *data,
size_t size )
+ 281 static bool put (qlisttbl_t *tbl,
const char *name,
const void *data,
size_t size )
284 qdlnobj_t *obj = _createobj(name, data, size);
@@ -352,10 +354,10 @@
-
+
- 293 if (tbl->unique ==
true )
remove_ (tbl, name);
+ 293 if (tbl->unique ==
true )
remove_ (tbl, name);
@@ -373,7 +375,7 @@
308 _insertobj(tbl, obj);
-
+
@@ -390,10 +392,10 @@
- 328 static bool putstr (qlisttbl_t *tbl,
const char *name,
const char *str)
+ 328 static bool putstr (qlisttbl_t *tbl,
const char *name,
const char *str)
- 330 size_t size = (str) ? (strlen(str) + 1) : 0;
- 331 return put (tbl, name, (
const void *)str, size);
+ 330 size_t size = (str) ? (strlen(str) + 1) : 0;
+ 331 return put (tbl, name, (
const void *)str, size);
@@ -408,7 +410,7 @@
- 346 static bool putstrf (qlisttbl_t *tbl,
const char *name,
const char *format, ...)
+ 346 static bool putstrf (qlisttbl_t *tbl,
const char *name,
const char *format, ...)
349 DYNAMIC_VSPRINTF(str, format);
@@ -417,7 +419,7 @@
- 355 bool ret =
putstr (tbl, name, str);
+ 355 bool ret =
putstr (tbl, name, str);
@@ -439,11 +441,11 @@
- 377 static bool putint (qlisttbl_t *tbl,
const char *name, int64_t num)
+ 377 static bool putint (qlisttbl_t *tbl,
const char *name, int64_t num)
380 snprintf(str,
sizeof (str),
"%" PRId64, num);
- 381 return putstr (tbl, name, str);
+ 381 return putstr (tbl, name, str);
@@ -485,14 +487,14 @@
- 423 static void *
get (qlisttbl_t *tbl,
const char *name,
size_t *
size ,
bool newmem)
+ 423 static void *
get (qlisttbl_t *tbl,
const char *name,
size_t *
size ,
bool newmem)
-
+
432 qdlnobj_t *obj = _findobj(tbl, name, NULL);
@@ -501,7 +503,7 @@
436 data = malloc(obj->size);
-
+
442 memcpy(data, obj->data, obj->size);
@@ -510,9 +512,9 @@
- 448 if (
size != NULL) *
size = obj->size;
+ 448 if (
size != NULL) *
size = obj->size;
-
+
@@ -535,7 +537,7 @@
- 473 static char *
getstr (qlisttbl_t *tbl,
const char *name,
bool newmem)
+ 473 static char *
getstr (qlisttbl_t *tbl,
const char *name,
bool newmem)
475 return (
char *)
get (tbl, name, NULL, newmem);
@@ -553,10 +555,10 @@
- 491 static int64_t
getint (qlisttbl_t *tbl,
const char *name)
+ 491 static int64_t
getint (qlisttbl_t *tbl,
const char *name)
- 494 char *str =
getstr (tbl, name,
true );
+ 494 char *str =
getstr (tbl, name,
true );
@@ -595,7 +597,7 @@
- 533 static qobj_t *
getmulti (qlisttbl_t *tbl,
const char *name,
bool newmem,
+ 533 static qobj_t *
getmulti (qlisttbl_t *tbl,
const char *name,
bool newmem,
@@ -604,7 +606,7 @@
541 memset((
void *)&obj, 0,
sizeof (obj));
-
+
543 while (tbl->getnext(tbl, &obj, name, newmem) ==
true ) {
@@ -636,7 +638,7 @@
571 memset((
void *)newobj,
'\0' ,
sizeof (qobj_t));
-
+
577 if (numobjs != NULL) {
@@ -664,7 +666,7 @@
-
+
604 if (objs == NULL)
return ;
@@ -722,12 +724,12 @@
- 660 static bool getnext (qlisttbl_t *tbl, qdlnobj_t *obj,
const char *name,
+ 660 static bool getnext (qlisttbl_t *tbl, qdlnobj_t *obj,
const char *name,
663 if (obj == NULL)
return NULL;
-
+
667 qdlnobj_t *cont = NULL;
668 if (obj->size == 0) {
@@ -742,11 +744,11 @@
-
+
- 684 uint32_t hash = (name != NULL) ?
qhashmurmur3_32 (name, strlen(name)) : 0;
+ 684 uint32_t hash = (name != NULL) ?
qhashmurmur3_32 (name, strlen(name)) : 0;
687 while (cont != NULL) {
@@ -778,7 +780,7 @@
714 cont = (tbl->lookupforward) ? cont->next : cont->prev;
-
+
@@ -795,7 +797,7 @@
- 733 static size_t remove_ (qlisttbl_t *tbl,
const char *name)
+ 733 static size_t remove_ (qlisttbl_t *tbl,
const char *name)
735 if (name == NULL)
return false ;
@@ -803,12 +805,12 @@
740 memset((
void *)&obj, 0,
sizeof (obj));
-
- 742 while (
getnext (tbl, &obj, name,
false ) ==
true ) {
-
+
+ 742 while (
getnext (tbl, &obj, name,
false ) ==
true ) {
+
-
+
@@ -838,11 +840,11 @@
- 776 static bool removeobj (qlisttbl_t *tbl,
const qdlnobj_t *obj)
+ 776 static bool removeobj (qlisttbl_t *tbl,
const qdlnobj_t *obj)
778 if (obj == NULL)
return false ;
-
+
783 qdlnobj_t *prev = obj->prev;
@@ -856,7 +858,7 @@
-
+
795 DEBUG(
"qlisttbl->removeobj(): Can't veryfy object." );
@@ -872,7 +874,7 @@
-
+
@@ -889,7 +891,7 @@
- 827 static size_t size (qlisttbl_t *tbl)
+ 827 static size_t size (qlisttbl_t *tbl)
@@ -916,10 +918,10 @@
-
+
-
+
858 qdlnobj_t *obj1, *obj2;
@@ -944,7 +946,7 @@
-
+
@@ -952,9 +954,9 @@
-
+
-
+
894 for (obj = tbl->first; obj != NULL;) {
895 qdlnobj_t *next = obj->next;
@@ -967,7 +969,7 @@
-
+
@@ -985,7 +987,7 @@
- 923 static bool save (qlisttbl_t *tbl,
const char *filepath,
char sepchar,
+ 923 static bool save (qlisttbl_t *tbl,
const char *filepath,
char sepchar,
926 if (filepath == NULL) {
@@ -999,20 +1001,20 @@
-
- 938 qio_printf (fd, -1,
"# %s %s\n" , filepath, gmtstr);
+
+ 938 qio_printf (fd, -1,
"# %s %s\n" , filepath, gmtstr);
-
+
943 for (obj = tbl->first; obj; obj = obj->next) {
- 945 if (encode ==
true ) encval =
qurl_encode (obj->data, obj->size);
+ 945 if (encode ==
true ) encval =
qurl_encode (obj->data, obj->size);
946 else encval = obj->data;
- 947 qio_printf (fd, -1,
"%s%c%s\n" , obj->name, sepchar, encval);
+ 947 qio_printf (fd, -1,
"%s%c%s\n" , obj->name, sepchar, encval);
948 if (encode ==
true ) free(encval);
-
+
@@ -1031,15 +1033,15 @@
- 969 static ssize_t
load (qlisttbl_t *tbl,
const char *filepath,
char sepchar,
+ 969 static ssize_t
load (qlisttbl_t *tbl,
const char *filepath,
char sepchar,
-
+
974 if (str == NULL)
return -1;
-
+
980 for (offset = str; *offset !=
'\0' ; ) {
@@ -1049,7 +1051,7 @@
-
+
990 if ((buf[0] ==
'#' ) || (buf[0] ==
'\0' ))
continue ;
@@ -1057,17 +1059,17 @@
993 char *data = strdup(buf);
994 char *name = _q_makeword(data, sepchar);
-
-
-
+
+
+
- 1000 put (tbl, name, data, strlen(data) + 1);
+ 1000 put (tbl, name, data, strlen(data) + 1);
-
+
@@ -1083,21 +1085,21 @@
- 1021 static bool debug (qlisttbl_t *tbl, FILE *out)
+ 1021 static bool debug (qlisttbl_t *tbl, FILE *out)
-
+
1030 for (obj = tbl->first; obj; obj = obj->next) {
1031 fprintf(out,
"%s=" , obj->name);
1032 _q_humanOut(out, obj->data, obj->size, MAX_HUMANOUT);
1033 fprintf(out,
" (%zu,%4x)\n" , obj->size, obj->hash);
-
+
@@ -1111,7 +1113,7 @@
-
+
1051 Q_MUTEX_ENTER(tbl->qmutex);
@@ -1121,7 +1123,7 @@
-
+
1061 Q_MUTEX_LEAVE(tbl->qmutex);
@@ -1131,9 +1133,9 @@
-
+
-
+
1072 Q_MUTEX_DESTROY(tbl->qmutex);
@@ -1141,7 +1143,7 @@
1076 #ifndef _DOXYGEN_SKIP
- 1079 static qdlnobj_t *_createobj(
const char *name,
const void *data,
size_t size )
+ 1079 static qdlnobj_t *_createobj(
const char *name,
const void *data,
size_t size )
1081 if (name == NULL || data == NULL || size <= 0) {
@@ -1165,7 +1167,7 @@
1101 obj->name = dup_name;
1102 obj->data = dup_data;
-
+
@@ -1174,7 +1176,7 @@
1109 static bool _insertobj(qlisttbl_t *tbl, qdlnobj_t *obj)
-
+
1114 qdlnobj_t *prev = obj->prev;
1115 qdlnobj_t *next = obj->next;
@@ -1203,7 +1205,7 @@
-
+
1142 qdlnobj_t *obj = (tbl->lookupforward) ? tbl->first : tbl->last;
1143 while (obj != NULL) {
@@ -1249,6 +1251,34 @@
+static qobj_t * getmulti(qlisttbl_t *tbl, const char *name, bool newmem, size_t *numobjs)
qlisttbl->getmulti(): Finds all objects with given name and return a array of objects.
+static void clear(qlisttbl_t *tbl)
qlisttbl->clear(): Removes all of the elements from this table.
+char * qtime_gmt_str(time_t utctime)
Get GMT time string formatted like 'Wed, 11-Nov-2007 23:19:25 GMT'.
+ssize_t qio_printf(int fd, int timeoutms, const char *format,...)
Formatted output to a file descriptor.
+static void unlock(qlisttbl_t *tbl)
qlisttbl->unlock(): Leave critical section.
+static bool put(qlisttbl_t *tbl, const char *name, const void *data, size_t size)
qlisttbl->put(): Put an element to this table.
+uint32_t qhashmurmur3_32(const void *data, size_t nbytes)
Get 32-bit Murmur3 hash.
+static char * getstr(qlisttbl_t *tbl, const char *name, bool newmem)
qlisttbl->getstr(): Finds an object with given name and returns as string type.
+size_t qurl_decode(char *str)
Decode URL encoded string.
+static bool save(qlisttbl_t *tbl, const char *filepath, char sepchar, bool encode)
qlisttbl->save(): Save qlisttbl as plain text format Dumping direction is always forward(from the top...
+static bool removeobj(qlisttbl_t *tbl, const qdlnobj_t *obj)
qlisttbl->removeobj(): Remove objects with given object pointer.
+static bool getnext(qlisttbl_t *tbl, qdlnobj_t *obj, const char *name, bool newmem)
qlisttbl->getnext(): Get next element.
+static bool putstrf(qlisttbl_t *tbl, const char *name, const char *format,...)
qlisttbl->putstrf(): Put a formatted string into this table.
+static int64_t getint(qlisttbl_t *tbl, const char *name)
qlisttbl->getint(): Finds an object with given name and returns as integer type.
+qlisttbl_t * qlisttbl(int options)
Create a new Q_LIST linked-list container.
+static bool debug(qlisttbl_t *tbl, FILE *out)
qlisttbl->debug(): Print out stored elements for debugging purpose.
+static void sort_(qlisttbl_t *tbl)
qlisttbl->sort(): Sort keys in this table.
+static size_t size(qlisttbl_t *tbl)
qlisttbl->size(): Returns the number of elements in this table.
+char * qstrtrim(char *str)
Remove white spaces(including CR, LF) from head and tail of the string.
+static size_t remove_(qlisttbl_t *tbl, const char *name)
qlisttbl->remove(): Remove matched objects with given name.
+static void lock(qlisttbl_t *tbl)
qlisttbl->lock(): Enter critical section.
+static void freemulti(qobj_t *objs)
qlisttbl->freemulti(): Deallocate object array returned by getmulti().
+static void free_(qlisttbl_t *tbl)
qlisttbl->free(): Free qlisttbl_t
+static bool putstr(qlisttbl_t *tbl, const char *name, const char *str)
qlisttbl->putstr(): Put a string into this table.
+void * qfile_load(const char *filepath, size_t *nbytes)
Load file into memory.
+static ssize_t load(qlisttbl_t *tbl, const char *filepath, char sepchar, bool decode)
qlisttbl->load(): Load and append entries from given filepath Loading direction is always appending a...
+char * qurl_encode(const void *bin, size_t size)
Encode data using URL encoding(Percent encoding) algorithm.
+static bool putint(qlisttbl_t *tbl, const char *name, int64_t num)
qlisttbl->putInt(): Put an integer into this table as string type.
@@ -1257,7 +1287,7 @@
containers qlisttbl.c
+ 1.8.6
diff --git a/doc/html/qlog_8c.html b/doc/html/qlog_8c.html
index 1586d5ee..25d318b5 100644
--- a/doc/html/qlog_8c.html
+++ b/doc/html/qlog_8c.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qlog.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,29 +76,29 @@
qlog_t * qlog (const char *filepathfmt, mode_t mode, int rotateinterval, int options)
- Open ratating-log file.
+ Open ratating-log file. More...
static bool write_ (qlog_t *log, const char *str)
- qlog->write(): Log messages
+ qlog->write(): Log messages More...
static bool writef (qlog_t *log, const char *format,...)
- qlog->writef() : Log messages
+ qlog->writef() : Log messages More...
static bool duplicate (qlog_t *log, FILE *outfp, bool flush)
- qlog->duplicate() : Duplicate log string into other stream
+ qlog->duplicate() : Duplicate log string into other stream More...
static bool flush_ (qlog_t *log)
- qlog->flush(): Flush buffered log
+ qlog->flush(): Flush buffered log More...
static void free_ (qlog_t *log)
- qlog->free(): Close ratating-log file & de-allocate resources
+ qlog->free(): Close ratating-log file & de-allocate resources More...
Rotating file logger object.
qlog implements a auto-rotating file logger.
-
qlog_t *log =
qlog (
"/tmp/dailylog-%Y%m%d.err" , 0644, 86400,
false );
+
qlog_t *log =
qlog (
"/tmp/dailylog-%Y%m%d.err" , 0644, 86400,
false );
if (log == NULL) return ;
@@ -165,7 +167,7 @@
QLOG_OPT_FLUSH - flush out buffer everytime.
-
qlog_t *log =
qlog (
"/tmp/qdecoder-%Y%m%d.err" , 0644, 86400, QLOG_OPT_THREADSAFE);
+
qlog_t *log =
qlog (
"/tmp/qdecoder-%Y%m%d.err" , 0644, 86400, QLOG_OPT_THREADSAFE);
log->free(log);
Definition at line 105 of file qlog.c .
@@ -256,7 +258,7 @@
-
qlog->writef() : Log messages
+
qlog->writef() : Log messages
Parameters
log a pointer of qlog_t
@@ -308,7 +310,7 @@
-
qlog->duplicate() : Duplicate log string into other stream
+
qlog->duplicate() : Duplicate log string into other stream
Parameters
log a pointer of qlog_t
@@ -403,7 +405,7 @@
extensions qlog.c
+ 1.8.6
diff --git a/doc/html/qlog_8c_source.html b/doc/html/qlog_8c_source.html
index 6ee625b5..f5151d50 100644
--- a/doc/html/qlog_8c_source.html
+++ b/doc/html/qlog_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qlog.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -129,11 +131,11 @@
64 #include "extensions/qlog.h"
- 67 static bool write_ (qlog_t *log,
const char *str);
- 68 static bool writef (qlog_t *log,
const char *format, ...);
- 69 static bool duplicate (qlog_t *log, FILE *outfp,
bool flush);
- 70 static bool flush_ (qlog_t *log);
- 71 static void free_ (qlog_t *log);
+ 67 static bool write_ (qlog_t *log,
const char *str);
+ 68 static bool writef (qlog_t *log,
const char *format, ...);
+ 69 static bool duplicate (qlog_t *log, FILE *outfp,
bool flush);
+ 70 static bool flush_ (qlog_t *log);
+ 71 static void free_ (qlog_t *log);
74 static bool _real_open(qlog_t *log);
@@ -167,7 +169,7 @@
- 105 qlog_t *
qlog (
const char *filepathfmt, mode_t mode,
int rotateinterval,
+ 105 qlog_t *
qlog (
const char *filepathfmt, mode_t mode,
int rotateinterval,
@@ -179,7 +181,7 @@
- 117 qstrcpy (log->filepathfmt,
sizeof (log->filepathfmt), filepathfmt);
+ 117 qstrcpy (log->filepathfmt,
sizeof (log->filepathfmt), filepathfmt);
119 if (rotateinterval > 0)
120 log->rotateinterval = rotateinterval;
@@ -205,11 +207,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -222,7 +224,7 @@
- 160 static bool write_ (qlog_t *log,
const char *str) {
+ 160 static bool write_ (qlog_t *log,
const char *str) {
161 if (log == NULL || log->fp == NULL)
@@ -261,7 +263,7 @@
- 199 static bool writef (qlog_t *log,
const char *format, ...) {
+ 199 static bool writef (qlog_t *log,
const char *format, ...) {
200 if (log == NULL || log->fp == NULL)
@@ -270,7 +272,7 @@
- 208 bool ret =
write_ (log, str);
+ 208 bool ret =
write_ (log, str);
@@ -292,7 +294,7 @@
- 230 static bool duplicate (qlog_t *log, FILE *outfp,
bool flush) {
+ 230 static bool duplicate (qlog_t *log, FILE *outfp,
bool flush) {
@@ -311,7 +313,7 @@
-
+
@@ -331,11 +333,11 @@
-
+
-
+
274 Q_MUTEX_ENTER(log->qmutex);
275 if (log->fp != NULL) {
@@ -367,7 +369,7 @@
304 fchmod(fileno(log->fp), log->mode);
- 305 qstrcpy (log->filepath,
sizeof (log->filepath), newfilepath);
+ 305 qstrcpy (log->filepath,
sizeof (log->filepath), newfilepath);
306 }
else if (strcmp(log->filepath, newfilepath)) {
@@ -377,7 +379,7 @@
312 fchmod(fileno(newfp), log->mode);
- 315 qstrcpy (log->filepath,
sizeof (log->filepath), newfilepath);
+ 315 qstrcpy (log->filepath,
sizeof (log->filepath), newfilepath);
317 DEBUG(
"_real_open: Can't open log file '%s' for rotating." ,
@@ -402,6 +404,13 @@
+static bool write_(qlog_t *log, const char *str)
qlog->write(): Log messages
+static bool flush_(qlog_t *log)
qlog->flush(): Flush buffered log
+qlog_t * qlog(const char *filepathfmt, mode_t mode, int rotateinterval, int options)
Open ratating-log file.
+static bool duplicate(qlog_t *log, FILE *outfp, bool flush)
qlog->duplicate(): Duplicate log string into other stream
+char * qstrcpy(char *dst, size_t size, const char *src)
Copy src string to dst.
+static void free_(qlog_t *log)
qlog->free(): Close ratating-log file & de-allocate resources
+static bool writef(qlog_t *log, const char *format,...)
qlog->writef(): Log messages
@@ -410,7 +419,7 @@
extensions qlog.c
+ 1.8.6
diff --git a/doc/html/qqueue_8c.html b/doc/html/qqueue_8c.html
index d88d0075..ffd30da7 100644
--- a/doc/html/qqueue_8c.html
+++ b/doc/html/qqueue_8c.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qqueue.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,55 +76,55 @@
qqueue_t * qqueue (int options)
- Create new queue container.
+ Create new queue container. More...
static size_t setsize (qqueue_t *queue, size_t max)
- qqueue->setsize() : Sets maximum number of elements allowed in this queue.
+ qqueue->setsize() : Sets maximum number of elements allowed in this queue. More...
static bool push (qqueue_t *queue, const void *data, size_t size )
- qqueue->push() : Pushes an element onto the top of this queue.
+ qqueue->push() : Pushes an element onto the top of this queue. More...
static bool pushstr (qqueue_t *queue, const char *str)
- qqueue->pushstr() : Pushes a string onto the top of this queue.
+ qqueue->pushstr() : Pushes a string onto the top of this queue. More...
static bool pushint (qqueue_t *queue, int64_t num)
- qqueue->pushint() : Pushes a integer onto the top of this queue.
+ qqueue->pushint() : Pushes a integer onto the top of this queue. More...
static void * pop (qqueue_t *queue, size_t *size )
- qqueue->pop() : Removes a element at the top of this queue and returns that element.
+ qqueue->pop() : Removes a element at the top of this queue and returns that element. More...
static char * popstr (qqueue_t *queue)
- qqueue->popstr() : Removes a element at the top of this queue and returns that element.
+ qqueue->popstr() : Removes a element at the top of this queue and returns that element. More...
static int64_t popint (qqueue_t *queue)
- qqueue->popint() : Removes a integer at the top of this queue and returns that element.
+ qqueue->popint() : Removes a integer at the top of this queue and returns that element. More...
static void * popat (qqueue_t *queue, int index, size_t *size )
- qqueue->popat() : Returns and remove the element at the specified position in this queue.
+ qqueue->popat() : Returns and remove the element at the specified position in this queue. More...
static void * get (qqueue_t *queue, size_t *size , bool newmem)
- qqueue->get() : Returns an element at the top of this queue without removing it.
+ qqueue->get() : Returns an element at the top of this queue without removing it. More...
static char * getstr (qqueue_t *queue)
- qqueue->getstr() : Returns an string at the top of this queue without removing it.
+ qqueue->getstr() : Returns an string at the top of this queue without removing it. More...
static int64_t getint (qqueue_t *queue)
- qqueue->getint() : Returns an integer at the top of this queue without removing it.
+ qqueue->getint() : Returns an integer at the top of this queue without removing it. More...
static void * getat (qqueue_t *queue, int index, size_t *size , bool newmem)
- qqueue->getat() : Returns an element at the specified position in this queue without removing it.
+ qqueue->getat() : Returns an element at the specified position in this queue without removing it. More...
static size_t size (qqueue_t *queue)
- qqueue->size() : Returns the number of elements in this queue.
+ qqueue->size() : Returns the number of elements in this queue. More...
static void clear (qqueue_t *queue)
- qqueue->clear() : Removes all of the elements from this queue.
+ qqueue->clear() : Removes all of the elements from this queue. More...
static bool debug (qqueue_t *queue, FILE *out)
- qqueue->debug() : Print out stored elements for debugging purpose.
+ qqueue->debug() : Print out stored elements for debugging purpose. More...
static void free_ (qqueue_t *queue)
- qqueue->free(): Free qqueue_t
+ qqueue->free(): Free qqueue_t More...
@@ -180,15 +182,15 @@
queue->free(queue);
[Output]
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
Definition in file qqueue.c .
@@ -265,7 +267,7 @@
-
qqueue->setsize() : Sets maximum number of elements allowed in this queue.
+
qqueue->setsize() : Sets maximum number of elements allowed in this queue.
Parameters
queue qqueue container pointer.
@@ -317,7 +319,7 @@
-
qqueue->push() : Pushes an element onto the top of this queue.
+
qqueue->push() : Pushes an element onto the top of this queue.
Parameters
queue qqueue container pointer.
@@ -375,7 +377,7 @@
-
qqueue->pushstr() : Pushes a string onto the top of this queue.
+
qqueue->pushstr() : Pushes a string onto the top of this queue.
Parameters
queue qqueue container pointer.
@@ -433,7 +435,7 @@
-
qqueue->pushint() : Pushes a integer onto the top of this queue.
+
qqueue->pushint() : Pushes a integer onto the top of this queue.
Parameters
queue qqueue container pointer.
@@ -489,7 +491,7 @@
-
qqueue->pop() : Removes a element at the top of this queue and returns that element.
+
qqueue->pop() : Removes a element at the top of this queue and returns that element.
Parameters
queue qqueue container pointer.
@@ -535,7 +537,7 @@
-
qqueue->popstr() : Removes a element at the top of this queue and returns that element.
+
qqueue->popstr() : Removes a element at the top of this queue and returns that element.
Parameters
queue qqueue container pointer.
@@ -553,7 +555,7 @@
-
Note The string element should be pushed through pushstr() .
+
Note The string element should be pushed through pushstr() .
Definition at line 295 of file qqueue.c .
@@ -581,7 +583,7 @@
-
qqueue->popint() : Removes a integer at the top of this queue and returns that element.
+
qqueue->popint() : Removes a integer at the top of this queue and returns that element.
Parameters
queue qqueue container pointer.
@@ -599,7 +601,7 @@
-
Note The integer element should be pushed through pushint() .
+
Note The integer element should be pushed through pushint() .
Definition at line 319 of file qqueue.c .
@@ -707,7 +709,7 @@
-
qqueue->get() : Returns an element at the top of this queue without removing it.
+
qqueue->get() : Returns an element at the top of this queue without removing it.
Parameters
queue qqueue container pointer.
@@ -754,7 +756,7 @@
-
qqueue->getstr() : Returns an string at the top of this queue without removing it.
+
qqueue->getstr() : Returns an string at the top of this queue without removing it.
Parameters
queue qqueue container pointer.
@@ -772,7 +774,7 @@
-
Note The string element should be pushed through pushstr() .
+
Note The string element should be pushed through pushstr() .
Definition at line 383 of file qqueue.c .
@@ -800,7 +802,7 @@
-
qqueue->getint() : Returns an integer at the top of this queue without removing it.
+
qqueue->getint() : Returns an integer at the top of this queue without removing it.
Parameters
queue qqueue container pointer.
@@ -818,7 +820,7 @@
-
Note The integer element should be pushed through pushint() .
+
Note The integer element should be pushed through pushint() .
Definition at line 407 of file qqueue.c .
@@ -917,7 +919,7 @@
-
qqueue->size() : Returns the number of elements in this queue.
+
qqueue->size() : Returns the number of elements in this queue.
Parameters
queue qqueue container pointer.
@@ -952,7 +954,7 @@
-
qqueue->clear() : Removes all of the elements from this queue.
+
qqueue->clear() : Removes all of the elements from this queue.
Parameters
queue qqueue container pointer.
@@ -996,7 +998,7 @@
-
qqueue->debug() : Print out stored elements for debugging purpose.
+
qqueue->debug() : Print out stored elements for debugging purpose.
Parameters
queue qqueue container pointer.
@@ -1053,7 +1055,7 @@
containers qqueue.c
+ 1.8.6
diff --git a/doc/html/qqueue_8c_source.html b/doc/html/qqueue_8c_source.html
index f51d2869..54d79b39 100644
--- a/doc/html/qqueue_8c_source.html
+++ b/doc/html/qqueue_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qqueue.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -179,26 +181,26 @@
115 #ifndef _DOXYGEN_SKIP
- 117 static size_t setsize (qqueue_t *queue,
size_t max);
+ 117 static size_t setsize (qqueue_t *queue,
size_t max);
- 119 static bool push (qqueue_t *queue,
const void *data,
size_t size );
- 120 static bool pushstr (qqueue_t *queue,
const char *str);
- 121 static bool pushint (qqueue_t *queue, int64_t num);
+ 119 static bool push (qqueue_t *queue,
const void *data,
size_t size );
+ 120 static bool pushstr (qqueue_t *queue,
const char *str);
+ 121 static bool pushint (qqueue_t *queue, int64_t num);
- 123 static void *
pop (qqueue_t *queue,
size_t *
size );
- 124 static char *
popstr (qqueue_t *queue);
- 125 static int64_t
popint (qqueue_t *queue);
- 126 static void *
popat (qqueue_t *queue,
int index,
size_t *
size );
+ 123 static void *
pop (qqueue_t *queue,
size_t *
size );
+ 124 static char *
popstr (qqueue_t *queue);
+ 125 static int64_t
popint (qqueue_t *queue);
+ 126 static void *
popat (qqueue_t *queue,
int index,
size_t *
size );
- 128 static void *
get (qqueue_t *queue,
size_t *
size ,
bool newmem);
- 129 static char *
getstr (qqueue_t *queue);
- 130 static int64_t
getint (qqueue_t *queue);
- 131 static void *
getat (qqueue_t *queue,
int index,
size_t *
size ,
bool newmem);
+ 128 static void *
get (qqueue_t *queue,
size_t *
size ,
bool newmem);
+ 129 static char *
getstr (qqueue_t *queue);
+ 130 static int64_t
getint (qqueue_t *queue);
+ 131 static void *
getat (qqueue_t *queue,
int index,
size_t *
size ,
bool newmem);
- 133 static size_t size (qqueue_t *queue);
- 134 static void clear (qqueue_t *queue);
- 135 static bool debug (qqueue_t *queue, FILE *out);
- 136 static void free_ (qqueue_t *queue);
+ 133 static size_t size (qqueue_t *queue);
+ 134 static void clear (qqueue_t *queue);
+ 135 static bool debug (qqueue_t *queue, FILE *out);
+ 136 static void free_ (qqueue_t *queue);
@@ -219,7 +221,7 @@
-
+
158 qqueue_t *queue = (qqueue_t *) malloc(
sizeof (qqueue_t));
@@ -227,33 +229,33 @@
164 memset((
void *) queue, 0,
sizeof (qqueue_t));
- 165 queue->list =
qlist (options);
+ 165 queue->list =
qlist (options);
166 if (queue->list == NULL) {
-
+
-
-
-
+
+
+
-
-
-
- 181 queue->popat =
popat ;
+
+
+
+ 181 queue->popat =
popat ;
-
-
- 186 queue->getat =
getat ;
+
+
+ 186 queue->getat =
getat ;
-
- 189 queue->clear =
clear ;
- 190 queue->debug =
debug ;
-
+
+ 189 queue->clear =
clear ;
+ 190 queue->debug =
debug ;
+
@@ -267,7 +269,7 @@
- 205 static size_t setsize (qqueue_t *queue,
size_t max) {
+ 205 static size_t setsize (qqueue_t *queue,
size_t max) {
206 return queue->list->setsize(queue->list, max);
@@ -285,7 +287,7 @@
- 223 static bool push (qqueue_t *queue,
const void *data,
size_t size ) {
+ 223 static bool push (qqueue_t *queue,
const void *data,
size_t size ) {
224 return queue->list->addlast(queue->list, data, size);
@@ -303,7 +305,7 @@
- 241 static bool pushstr (qqueue_t *queue,
const char *str) {
+ 241 static bool pushstr (qqueue_t *queue,
const char *str) {
@@ -323,7 +325,7 @@
- 261 static bool pushint (qqueue_t *queue, int64_t num) {
+ 261 static bool pushint (qqueue_t *queue, int64_t num) {
262 return queue->list->addlast(queue->list, &num,
sizeof (num));
@@ -339,7 +341,7 @@
- 277 static void *
pop (qqueue_t *queue,
size_t *
size ) {
+ 277 static void *
pop (qqueue_t *queue,
size_t *
size ) {
278 return queue->list->popfirst(queue->list, size);
@@ -357,7 +359,7 @@
-
+
297 char *str = queue->list->popfirst(queue->list, &strsize);
@@ -381,7 +383,7 @@
-
+
321 int64_t *pnum = queue->list->popfirst(queue->list, NULL);
@@ -410,7 +412,7 @@
- 348 static void *
popat (qqueue_t *queue,
int index,
size_t *
size ) {
+ 348 static void *
popat (qqueue_t *queue,
int index,
size_t *
size ) {
349 return queue->list->popat(queue->list, index, size);
@@ -427,8 +429,8 @@
- 365 static void *
get (qqueue_t *queue,
size_t *
size ,
bool newmem) {
- 366 return queue->list->getfirst(queue->list,
size , newmem);
+ 365 static void *
get (qqueue_t *queue,
size_t *
size ,
bool newmem) {
+ 366 return queue->list->getfirst(queue->list,
size , newmem);
@@ -445,7 +447,7 @@
-
+
385 char *str = queue->list->getfirst(queue->list, &strsize,
true );
@@ -469,7 +471,7 @@
-
+
409 int64_t *pnum = queue->list->getfirst(queue->list, NULL,
true );
@@ -499,7 +501,7 @@
- 437 static void *
getat (qqueue_t *queue,
int index,
size_t *
size ,
bool newmem) {
+ 437 static void *
getat (qqueue_t *queue,
int index,
size_t *
size ,
bool newmem) {
438 return queue->list->getat(queue->list, index, size, newmem);
@@ -510,7 +512,7 @@
- 448 static size_t size (qqueue_t *queue) {
+ 448 static size_t size (qqueue_t *queue) {
449 return queue->list->size(queue->list);
@@ -519,7 +521,7 @@
- 457 static void clear (qqueue_t *queue) {
+ 457 static void clear (qqueue_t *queue) {
458 queue->list->clear(queue->list);
@@ -531,7 +533,7 @@
- 469 static bool debug (qqueue_t *queue, FILE *out) {
+ 469 static bool debug (qqueue_t *queue, FILE *out) {
470 return queue->list->debug(queue->list, out);
@@ -542,10 +544,27 @@
- 480 static void free_ (qqueue_t *queue) {
+ 480 static void free_ (qqueue_t *queue) {
481 queue->list->free(queue->list);
+static void free_(qqueue_t *queue)
qqueue->free(): Free qqueue_t
+qlist_t * qlist(int options)
Create new qlist_t linked-list container.
+static void * pop(qqueue_t *queue, size_t *size)
qqueue->pop(): Removes a element at the top of this queue and returns that element.
+static size_t setsize(qqueue_t *queue, size_t max)
qqueue->setsize(): Sets maximum number of elements allowed in this queue.
+static bool pushint(qqueue_t *queue, int64_t num)
qqueue->pushint(): Pushes a integer onto the top of this queue.
+static bool push(qqueue_t *queue, const void *data, size_t size)
qqueue->push(): Pushes an element onto the top of this queue.
+static int64_t popint(qqueue_t *queue)
qqueue->popint(): Removes a integer at the top of this queue and returns that element.
+static char * getstr(qqueue_t *queue)
qqueue->getstr(): Returns an string at the top of this queue without removing it. ...
+static bool pushstr(qqueue_t *queue, const char *str)
qqueue->pushstr(): Pushes a string onto the top of this queue.
+qqueue_t * qqueue(int options)
Create new queue container.
+static char * popstr(qqueue_t *queue)
qqueue->popstr(): Removes a element at the top of this queue and returns that element.
+static void clear(qqueue_t *queue)
qqueue->clear(): Removes all of the elements from this queue.
+static void * getat(qqueue_t *queue, int index, size_t *size, bool newmem)
qqueue->getat(): Returns an element at the specified position in this queue without removing it...
+static void * popat(qqueue_t *queue, int index, size_t *size)
qqueue->popat(): Returns and remove the element at the specified position in this queue...
+static bool debug(qqueue_t *queue, FILE *out)
qqueue->debug(): Print out stored elements for debugging purpose.
+static int64_t getint(qqueue_t *queue)
qqueue->getint(): Returns an integer at the top of this queue without removing it.
+static size_t size(qqueue_t *queue)
qqueue->size(): Returns the number of elements in this queue.
@@ -554,7 +573,7 @@
containers qqueue.c
+ 1.8.6
diff --git a/doc/html/qsem_8c.html b/doc/html/qsem_8c.html
index fdcab19e..871a1508 100644
--- a/doc/html/qsem_8c.html
+++ b/doc/html/qsem_8c.html
@@ -3,6 +3,7 @@
+
qlibc: ipc/qsem.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,28 +76,28 @@
int qsem_init (const char *keyfile, int keyid, int nsems, bool recreate)
- Initialize semaphore.
+ Initialize semaphore. More...
int qsem_getid (const char *keyfile, int keyid)
- Get semaphore identifier by keyfile and keyid for the existing semaphore.
+ Get semaphore identifier by keyfile and keyid for the existing semaphore. More...
bool qsem_enter (int semid, int semno)
- Turn on the flag of semaphore then entering critical section.
+ Turn on the flag of semaphore then entering critical section. More...
bool qsem_enter_nowait (int semid, int semno)
- Try to turn on the flag of semaphore.
+ Try to turn on the flag of semaphore. More...
bool qsem_enter_force (int semid, int semno, int maxwaitms, bool *forceflag)
- Force to turn on the flag of semaphore.
+ Force to turn on the flag of semaphore. More...
bool qsem_leave (int semid, int semno)
- Turn off the flag of semaphore then leaving critical section.
+ Turn off the flag of semaphore then leaving critical section. More...
bool qsem_check (int semid, int semno)
- Get the status of semaphore.
+ Get the status of semaphore. More...
bool qsem_free (int semid)
- Release semaphore to system.
+ Release semaphore to system. More...
@@ -104,7 +106,7 @@
#define MAX_SEMAPHORES (2)
-int semid =
qsem_init (
"/some/file/for/generating/unique/key" ,
'q' , MAX_SEMAPHORES,
true );
+int semid =
qsem_init (
"/some/file/for/generating/unique/key" ,
'q' , MAX_SEMAPHORES,
true );
if (semid < 0) {
printf("ERROR: Can't initialize semaphores.\n" );
return -1;
@@ -114,32 +116,32 @@
(... child forking codes ...)
-
+
[forked child]
-
+
(... guaranteed as atomic procedure ...)
-
+
(... some codes ...)
-
+
(... guaranteed as atomic procedure ...)
-
+
[other program which uses resource 1]
-int semid =
qsem_getid (
"/some/file/for/generating/unique/key" ,
'q' );
+int semid =
qsem_getid (
"/some/file/for/generating/unique/key" ,
'q' );
if (semid < 0) {
printf("ERROR: Can't get semaphore id.\n" );
return -1;
}
-
+
(... guaranteed as atomic procedure ...)
-
+
Definition in file qsem.c .
@@ -191,7 +193,7 @@
Returns non-negative shared memory identifier if successful, otherwise returns -1
-
int semid =
qsem_init (
"/tmp/mydaemon.pid" ,
'q' , 10,
true );
+
int semid =
qsem_init (
"/tmp/mydaemon.pid" ,
'q' , 10,
true );
Definition at line 102 of file qsem.c .
@@ -477,7 +479,7 @@
ipc qsem.c
+ 1.8.6
diff --git a/doc/html/qsem_8c_source.html b/doc/html/qsem_8c_source.html
index cc1c09ad..8d1f4ccc 100644
--- a/doc/html/qsem_8c_source.html
+++ b/doc/html/qsem_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: ipc/qsem.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -164,7 +166,7 @@
- 102 int qsem_init (
const char *keyfile,
int keyid,
int nsems,
bool recreate) {
+ 102 int qsem_init (
const char *keyfile,
int keyid,
int nsems,
bool recreate) {
@@ -183,8 +185,8 @@
- 121 if ((semid =
qsem_getid (keyfile, keyid)) >= 0)
-
+ 121 if ((semid =
qsem_getid (keyfile, keyid)) >= 0)
+
123 if ((semid = semget(semkey, nsems, IPC_CREAT | IPC_EXCL | 0666)) == -1)
@@ -201,7 +203,7 @@
138 if (semop(semid, &sbuf, 1) != 0) {
-
+
@@ -217,7 +219,7 @@
-
+
@@ -242,7 +244,7 @@
-
+
@@ -264,7 +266,7 @@
-
+
@@ -294,10 +296,10 @@
-
+
234 for (wait = 0; wait < maxwaitms; wait += 10) {
-
+
236 if (forceflag != NULL)
@@ -307,8 +309,8 @@
243 DEBUG(
"force to unlock semaphore %d-%d" , semid, semno);
-
-
+
+
@@ -325,7 +327,7 @@
-
+
@@ -347,7 +349,7 @@
-
+
286 if (semctl(semid, semno, GETVAL, 0) == 0)
@@ -360,7 +362,7 @@
-
+
301 if (semctl(semid, 0, IPC_RMID, 0) != 0)
@@ -369,6 +371,14 @@
+bool qsem_leave(int semid, int semno)
Turn off the flag of semaphore then leaving critical section.
+bool qsem_enter_force(int semid, int semno, int maxwaitms, bool *forceflag)
Force to turn on the flag of semaphore.
+int qsem_getid(const char *keyfile, int keyid)
Get semaphore identifier by keyfile and keyid for the existing semaphore.
+bool qsem_enter_nowait(int semid, int semno)
Try to turn on the flag of semaphore.
+bool qsem_enter(int semid, int semno)
Turn on the flag of semaphore then entering critical section.
+int qsem_init(const char *keyfile, int keyid, int nsems, bool recreate)
Initialize semaphore.
+bool qsem_free(int semid)
Release semaphore to system.
+bool qsem_check(int semid, int semno)
Get the status of semaphore.
@@ -377,7 +387,7 @@
ipc qsem.c
+ 1.8.6
diff --git a/doc/html/qshm_8c.html b/doc/html/qshm_8c.html
index daf83d0e..fcc7210f 100644
--- a/doc/html/qshm_8c.html
+++ b/doc/html/qshm_8c.html
@@ -3,6 +3,7 @@
+
qlibc: ipc/qshm.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,16 +76,16 @@
int qshm_init (const char *keyfile, int keyid, size_t size , bool recreate)
- Initialize shared-memory.
+ Initialize shared-memory. More...
int qshm_getid (const char *keyfile, int keyid)
- Get shared memory identifier by keyfile and keyid for existing shared memory.
+ Get shared memory identifier by keyfile and keyid for existing shared memory. More...
void * qshm_get (int shmid)
- Get a pointer of shared memory.
+ Get a pointer of shared memory. More...
bool qshm_free (int shmid)
- De-allocate shared memory.
+ De-allocate shared memory. More...
@@ -95,14 +97,14 @@
[shared memory creater]
-int shmid =
qshm_init (
"/some/file/for/generating/unique/key" ,
's' ,
sizeof (
struct SharedData),
true );
+int shmid =
qshm_init (
"/some/file/for/generating/unique/key" ,
's' ,
sizeof (
struct SharedData),
true );
if (shmid < 0) {
printf("ERROR: Can't initialize shared memory.\n" );
return -1;
}
-struct SharedData *sdata = (SharedData *)
qshm_get (shmid);
+struct SharedData *sdata = (SharedData *)
qshm_get (shmid);
if (sdata == NULL) {
printf("ERROR: Can't get shared memory.\n" );
return -1;
@@ -110,14 +112,14 @@
[shared memory user]
-int shmid =
qshm_getid (
"/some/file/for/generating/unique/key" ,
's' );
+int shmid =
qshm_getid (
"/some/file/for/generating/unique/key" ,
's' );
if (shmid < 0) {
printf("ERROR: Can't get shared memory id.\n" );
return -1;
}
-struct SharedData *sdata = (SharedData *)
qshm_get (shmid);
+struct SharedData *sdata = (SharedData *)
qshm_get (shmid);
if (sdata == NULL) {
printf("ERROR: Can't get shared memory.\n" );
return -1;
@@ -278,7 +280,7 @@
ipc qshm.c
+ 1.8.6
diff --git a/doc/html/qshm_8c_source.html b/doc/html/qshm_8c_source.html
index c5a4a73b..12a019e9 100644
--- a/doc/html/qshm_8c_source.html
+++ b/doc/html/qshm_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: ipc/qshm.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -153,7 +155,7 @@
- 91 int qshm_init (
const char *keyfile,
int keyid,
size_t size ,
bool recreate) {
+ 91 int qshm_init (
const char *keyfile,
int keyid,
size_t size ,
bool recreate) {
@@ -172,8 +174,8 @@
- 110 if ((shmid =
qshm_getid (keyfile, keyid)) >= 0)
-
+ 110 if ((shmid =
qshm_getid (keyfile, keyid)) >= 0)
+
112 if ((shmid = shmget(semkey, size, IPC_CREAT | IPC_EXCL | 0666)) == -1)
@@ -189,7 +191,7 @@
-
+
@@ -211,7 +213,7 @@
-
+
@@ -229,7 +231,7 @@
-
+
170 if (shmctl(shmid, IPC_RMID, 0) != 0)
@@ -238,6 +240,11 @@
+static size_t size(qlist_t *list)
qlist->size(): Returns the number of elements in this list.
+int qshm_init(const char *keyfile, int keyid, size_t size, bool recreate)
Initialize shared-memory.
+bool qshm_free(int shmid)
De-allocate shared memory.
+int qshm_getid(const char *keyfile, int keyid)
Get shared memory identifier by keyfile and keyid for existing shared memory.
+void * qshm_get(int shmid)
Get a pointer of shared memory.
@@ -246,7 +253,7 @@
ipc qshm.c
+ 1.8.6
diff --git a/doc/html/qsocket_8c.html b/doc/html/qsocket_8c.html
index 8386dd66..ade760ee 100644
--- a/doc/html/qsocket_8c.html
+++ b/doc/html/qsocket_8c.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qsocket.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,16 +76,16 @@
int qsocket_open (const char *hostname, int port, int timeoutms)
- Create a TCP socket for the remote host and port.
+ Create a TCP socket for the remote host and port. More...
bool qsocket_close (int sockfd, int timeoutms)
- Close socket.
+ Close socket. More...
bool qsocket_get_addr (struct sockaddr_in *addr, const char *hostname, int port)
- Convert hostname to sockaddr_in structure.
+ Convert hostname to sockaddr_in structure. More...
char * qsocket_get_localaddr (char *buf, size_t bufsize)
- Return local IP address.
+ Return local IP address. More...
@@ -258,7 +260,7 @@
utilities qsocket.c
+ 1.8.6
diff --git a/doc/html/qsocket_8c_source.html b/doc/html/qsocket_8c_source.html
index 09b5bea7..96bb8d69 100644
--- a/doc/html/qsocket_8c_source.html
+++ b/doc/html/qsocket_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qsocket.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -127,10 +129,10 @@
-
+
67 struct sockaddr_in addr;
-
+
@@ -149,7 +151,7 @@
84 int status = connect(sockfd, (
struct sockaddr *) &addr,
sizeof (addr));
86 && (errno != EINPROGRESS
-
+
@@ -171,12 +173,12 @@
-
+
111 if (timeoutms >= 0 && shutdown(sockfd, SHUT_WR) == 0) {
- 114 ssize_t read =
qio_read (sockfd, buf,
sizeof (buf), timeoutms);
+ 114 ssize_t read =
qio_read (sockfd, buf,
sizeof (buf), timeoutms);
116 break ;DEBUG(
"Throw %zu bytes from dummy input stream." , read);
@@ -196,7 +198,7 @@
-
+
136 memset((
void *) addr, 0,
sizeof (
struct sockaddr_in));
137 if (!inet_aton(hostname, &addr->sin_addr)) {
@@ -217,7 +219,7 @@
-
+
156 char hostname[63 + 1];
157 if (gethostname(hostname,
sizeof (hostname)) != 0)
@@ -230,11 +232,18 @@
- 168 qstrcpy (buf, bufsize, localip);
+ 168 qstrcpy (buf, bufsize, localip);
+bool qsocket_get_addr(struct sockaddr_in *addr, const char *hostname, int port)
Convert hostname to sockaddr_in structure.
+char * qsocket_get_localaddr(char *buf, size_t bufsize)
Return local IP address.
+int qsocket_open(const char *hostname, int port, int timeoutms)
Create a TCP socket for the remote host and port.
+char * qstrcpy(char *dst, size_t size, const char *src)
Copy src string to dst.
+ssize_t qio_read(int fd, void *buf, size_t nbytes, int timeoutms)
Read from a file descriptor.
+int qio_wait_writable(int fd, int timeoutms)
Test & wait until the file descriptor is ready for writing.
+bool qsocket_close(int sockfd, int timeoutms)
Close socket.
@@ -243,7 +252,7 @@
utilities qsocket.c
+ 1.8.6
diff --git a/doc/html/qstack_8c.html b/doc/html/qstack_8c.html
index 619b97dc..33a99707 100644
--- a/doc/html/qstack_8c.html
+++ b/doc/html/qstack_8c.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qstack.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,55 +76,55 @@
qstack_t * qstack (int options)
- Create a new stack container.
+ Create a new stack container. More...
static size_t setsize (qstack_t *stack, size_t max)
- qstack->setsize() : Sets maximum number of elements allowed in this stack.
+ qstack->setsize() : Sets maximum number of elements allowed in this stack. More...
static bool push (qstack_t *stack, const void *data, size_t size )
- qstack->push() : Pushes an element onto the top of this stack.
+ qstack->push() : Pushes an element onto the top of this stack. More...
static bool pushstr (qstack_t *stack, const char *str)
- qstack->pushstr() : Pushes a string onto the top of this stack.
+ qstack->pushstr() : Pushes a string onto the top of this stack. More...
static bool pushint (qstack_t *stack, int64_t num)
- qstack->pushint() : Pushes a integer onto the top of this stack.
+ qstack->pushint() : Pushes a integer onto the top of this stack. More...
static void * pop (qstack_t *stack, size_t *size )
- qstack->pop() : Removes a element at the top of this stack and returns that element.
+ qstack->pop() : Removes a element at the top of this stack and returns that element. More...
static char * popstr (qstack_t *stack)
- qstack->popstr() : Removes a element at the top of this stack and returns that element.
+ qstack->popstr() : Removes a element at the top of this stack and returns that element. More...
static int64_t popint (qstack_t *stack)
- qstack->popint() : Removes a integer at the top of this stack and returns that element.
+ qstack->popint() : Removes a integer at the top of this stack and returns that element. More...
static void * popat (qstack_t *stack, int index, size_t *size )
- qstack->popat() : Returns and remove the element at the specified position in this stack.
+ qstack->popat() : Returns and remove the element at the specified position in this stack. More...
static void * get (qstack_t *stack, size_t *size , bool newmem)
- qstack->get() : Returns an element at the top of this stack without removing it.
+ qstack->get() : Returns an element at the top of this stack without removing it. More...
static char * getstr (qstack_t *stack)
- qstack->getstr() : Returns an string at the top of this stack without removing it.
+ qstack->getstr() : Returns an string at the top of this stack without removing it. More...
static int64_t getint (qstack_t *stack)
- qstack->getint() : Returns an integer at the top of this stack without removing it.
+ qstack->getint() : Returns an integer at the top of this stack without removing it. More...
static void * getat (qstack_t *stack, int index, size_t *size , bool newmem)
- qstack->getat() : Returns an element at the specified position in this stack without removing it.
+ qstack->getat() : Returns an element at the specified position in this stack without removing it. More...
static size_t size (qstack_t *stack)
- qstack->size() : Returns the number of elements in this stack.
+ qstack->size() : Returns the number of elements in this stack. More...
static void clear (qstack_t *stack)
- qstack->clear() : Removes all of the elements from this stack.
+ qstack->clear() : Removes all of the elements from this stack. More...
static bool debug (qstack_t *stack, FILE *out)
- qstack->debug() : Print out stored elements for debugging purpose.
+ qstack->debug() : Print out stored elements for debugging purpose. More...
static void free_ (qstack_t *stack)
- qstack->free(): Free qstack_t
+ qstack->free(): Free qstack_t More...
@@ -135,7 +137,7 @@
(positive index) 0 1 2
(negative index) -3 -2 -1
-
qstack_t *stack =
qstack (QSTACK_THREADSAFE);
+
qstack_t *stack =
qstack (QSTACK_THREADSAFE);
stack->pushint(stack, 1);
@@ -180,15 +182,15 @@
stack->free(stack);
[Output]
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
Definition in file qstack.c .
@@ -223,7 +225,7 @@
-
qstack_t *stack =
qstack (QSTACK_THREADSAFE);
+
qstack_t *stack =
qstack (QSTACK_THREADSAFE);
Note Available options:
QSTACK_THREADSAFE - make it thread-safe.
@@ -265,7 +267,7 @@
-
qstack->setsize() : Sets maximum number of elements allowed in this stack.
+
qstack->setsize() : Sets maximum number of elements allowed in this stack.
Parameters
stack qstack container pointer.
@@ -317,7 +319,7 @@
-
qstack->push() : Pushes an element onto the top of this stack.
+
qstack->push() : Pushes an element onto the top of this stack.
Parameters
stack qstack container pointer.
@@ -375,7 +377,7 @@
-
qstack->pushstr() : Pushes a string onto the top of this stack.
+
qstack->pushstr() : Pushes a string onto the top of this stack.
Parameters
stack qstack container pointer.
@@ -433,7 +435,7 @@
-
qstack->pushint() : Pushes a integer onto the top of this stack.
+
qstack->pushint() : Pushes a integer onto the top of this stack.
Parameters
stack qstack container pointer.
@@ -489,7 +491,7 @@
-
qstack->pop() : Removes a element at the top of this stack and returns that element.
+
qstack->pop() : Removes a element at the top of this stack and returns that element.
Parameters
stack qstack container pointer.
@@ -535,7 +537,7 @@
-
qstack->popstr() : Removes a element at the top of this stack and returns that element.
+
qstack->popstr() : Removes a element at the top of this stack and returns that element.
Parameters
stack qstack container pointer.
@@ -553,7 +555,7 @@
-
Note The string element should be pushed through pushstr() .
+
Note The string element should be pushed through pushstr() .
Definition at line 295 of file qstack.c .
@@ -581,7 +583,7 @@
-
qstack->popint() : Removes a integer at the top of this stack and returns that element.
+
qstack->popint() : Removes a integer at the top of this stack and returns that element.
Parameters
stack qstack container pointer.
@@ -599,7 +601,7 @@
-
Note The integer element should be pushed through pushint() .
+
Note The integer element should be pushed through pushint() .
Definition at line 319 of file qstack.c .
@@ -707,7 +709,7 @@
-
qstack->get() : Returns an element at the top of this stack without removing it.
+
qstack->get() : Returns an element at the top of this stack without removing it.
Parameters
stack qstack container pointer.
@@ -754,7 +756,7 @@
-
qstack->getstr() : Returns an string at the top of this stack without removing it.
+
qstack->getstr() : Returns an string at the top of this stack without removing it.
Parameters
stack qstack container pointer.
@@ -772,7 +774,7 @@
-
Note The string element should be pushed through pushstr() .
+
Note The string element should be pushed through pushstr() .
Definition at line 383 of file qstack.c .
@@ -800,7 +802,7 @@
-
qstack->getint() : Returns an integer at the top of this stack without removing it.
+
qstack->getint() : Returns an integer at the top of this stack without removing it.
Parameters
stack qstack container pointer.
@@ -818,7 +820,7 @@
-
Note The integer element should be pushed through pushint() .
+
Note The integer element should be pushed through pushint() .
Definition at line 407 of file qstack.c .
@@ -917,7 +919,7 @@
-
qstack->size() : Returns the number of elements in this stack.
+
qstack->size() : Returns the number of elements in this stack.
Parameters
stack qstack container pointer.
@@ -952,7 +954,7 @@
-
qstack->clear() : Removes all of the elements from this stack.
+
qstack->clear() : Removes all of the elements from this stack.
Parameters
stack qstack container pointer.
@@ -996,7 +998,7 @@
-
qstack->debug() : Print out stored elements for debugging purpose.
+
qstack->debug() : Print out stored elements for debugging purpose.
Parameters
stack qstack container pointer.
@@ -1053,7 +1055,7 @@
containers qstack.c
+ 1.8.6
diff --git a/doc/html/qstack_8c_source.html b/doc/html/qstack_8c_source.html
index a2580830..02180013 100644
--- a/doc/html/qstack_8c_source.html
+++ b/doc/html/qstack_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qstack.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -179,26 +181,26 @@
115 #ifndef _DOXYGEN_SKIP
- 117 static size_t setsize (qstack_t *stack,
size_t max);
+ 117 static size_t setsize (qstack_t *stack,
size_t max);
- 119 static bool push (qstack_t *stack,
const void *data,
size_t size );
- 120 static bool pushstr (qstack_t *stack,
const char *str);
- 121 static bool pushint (qstack_t *stack, int64_t num);
+ 119 static bool push (qstack_t *stack,
const void *data,
size_t size );
+ 120 static bool pushstr (qstack_t *stack,
const char *str);
+ 121 static bool pushint (qstack_t *stack, int64_t num);
- 123 static void *
pop (qstack_t *stack,
size_t *
size );
- 124 static char *
popstr (qstack_t *stack);
- 125 static int64_t
popint (qstack_t *stack);
- 126 static void *
popat (qstack_t *stack,
int index,
size_t *
size );
+ 123 static void *
pop (qstack_t *stack,
size_t *
size );
+ 124 static char *
popstr (qstack_t *stack);
+ 125 static int64_t
popint (qstack_t *stack);
+ 126 static void *
popat (qstack_t *stack,
int index,
size_t *
size );
- 128 static void *
get (qstack_t *stack,
size_t *
size ,
bool newmem);
- 129 static char *
getstr (qstack_t *stack);
- 130 static int64_t
getint (qstack_t *stack);
- 131 static void *
getat (qstack_t *stack,
int index,
size_t *
size ,
bool newmem);
+ 128 static void *
get (qstack_t *stack,
size_t *
size ,
bool newmem);
+ 129 static char *
getstr (qstack_t *stack);
+ 130 static int64_t
getint (qstack_t *stack);
+ 131 static void *
getat (qstack_t *stack,
int index,
size_t *
size ,
bool newmem);
- 133 static size_t size (qstack_t *stack);
- 134 static void clear (qstack_t *stack);
- 135 static bool debug (qstack_t *stack, FILE *out);
- 136 static void free_ (qstack_t *stack);
+ 133 static size_t size (qstack_t *stack);
+ 134 static void clear (qstack_t *stack);
+ 135 static bool debug (qstack_t *stack, FILE *out);
+ 136 static void free_ (qstack_t *stack);
@@ -219,7 +221,7 @@
-
+
158 qstack_t *stack = (qstack_t *) malloc(
sizeof (qstack_t));
@@ -227,33 +229,33 @@
164 memset((
void *) stack, 0,
sizeof (qstack_t));
- 165 stack->list =
qlist (options);
+ 165 stack->list =
qlist (options);
166 if (stack->list == NULL) {
-
+
-
-
-
+
+
+
-
-
-
- 181 stack->popat =
popat ;
+
+
+
+ 181 stack->popat =
popat ;
-
-
- 186 stack->getat =
getat ;
+
+
+ 186 stack->getat =
getat ;
-
- 189 stack->clear =
clear ;
- 190 stack->debug =
debug ;
-
+
+ 189 stack->clear =
clear ;
+ 190 stack->debug =
debug ;
+
@@ -267,7 +269,7 @@
- 205 static size_t setsize (qstack_t *stack,
size_t max) {
+ 205 static size_t setsize (qstack_t *stack,
size_t max) {
206 return stack->list->setsize(stack->list, max);
@@ -285,7 +287,7 @@
- 223 static bool push (qstack_t *stack,
const void *data,
size_t size ) {
+ 223 static bool push (qstack_t *stack,
const void *data,
size_t size ) {
224 return stack->list->addfirst(stack->list, data, size);
@@ -303,7 +305,7 @@
- 241 static bool pushstr (qstack_t *stack,
const char *str) {
+ 241 static bool pushstr (qstack_t *stack,
const char *str) {
@@ -323,7 +325,7 @@
- 261 static bool pushint (qstack_t *stack, int64_t num) {
+ 261 static bool pushint (qstack_t *stack, int64_t num) {
262 return stack->list->addfirst(stack->list, &num,
sizeof (
int ));
@@ -339,7 +341,7 @@
- 277 static void *
pop (qstack_t *stack,
size_t *
size ) {
+ 277 static void *
pop (qstack_t *stack,
size_t *
size ) {
278 return stack->list->popfirst(stack->list, size);
@@ -357,7 +359,7 @@
-
+
297 char *str = stack->list->popfirst(stack->list, &strsize);
@@ -381,7 +383,7 @@
-
+
321 int64_t *pnum = stack->list->popfirst(stack->list, NULL);
@@ -410,7 +412,7 @@
- 348 static void *
popat (qstack_t *stack,
int index,
size_t *
size ) {
+ 348 static void *
popat (qstack_t *stack,
int index,
size_t *
size ) {
349 return stack->list->popat(stack->list, index, size);
@@ -427,8 +429,8 @@
- 365 static void *
get (qstack_t *stack,
size_t *
size ,
bool newmem) {
- 366 return stack->list->getfirst(stack->list,
size , newmem);
+ 365 static void *
get (qstack_t *stack,
size_t *
size ,
bool newmem) {
+ 366 return stack->list->getfirst(stack->list,
size , newmem);
@@ -445,7 +447,7 @@
-
+
385 char *str = stack->list->getfirst(stack->list, &strsize,
true );
@@ -469,7 +471,7 @@
-
+
409 int64_t *pnum = stack->list->getfirst(stack->list, NULL,
true );
@@ -499,7 +501,7 @@
- 437 static void *
getat (qstack_t *stack,
int index,
size_t *
size ,
bool newmem) {
+ 437 static void *
getat (qstack_t *stack,
int index,
size_t *
size ,
bool newmem) {
438 return stack->list->getat(stack->list, index, size, newmem);
@@ -510,7 +512,7 @@
- 448 static size_t size (qstack_t *stack) {
+ 448 static size_t size (qstack_t *stack) {
449 return stack->list->size(stack->list);
@@ -519,7 +521,7 @@
- 457 static void clear (qstack_t *stack) {
+ 457 static void clear (qstack_t *stack) {
458 stack->list->clear(stack->list);
@@ -531,7 +533,7 @@
- 469 static bool debug (qstack_t *stack, FILE *out) {
+ 469 static bool debug (qstack_t *stack, FILE *out) {
470 return stack->list->debug(stack->list, out);
@@ -542,10 +544,27 @@
- 480 static void free_ (qstack_t *stack) {
+ 480 static void free_ (qstack_t *stack) {
481 stack->list->free(stack->list);
+static void free_(qstack_t *stack)
qstack->free(): Free qstack_t
+static bool push(qstack_t *stack, const void *data, size_t size)
qstack->push(): Pushes an element onto the top of this stack.
+qlist_t * qlist(int options)
Create new qlist_t linked-list container.
+static size_t size(qstack_t *stack)
qstack->size(): Returns the number of elements in this stack.
+qstack_t * qstack(int options)
Create a new stack container.
+static size_t setsize(qstack_t *stack, size_t max)
qstack->setsize(): Sets maximum number of elements allowed in this stack.
+static void * popat(qstack_t *stack, int index, size_t *size)
qstack->popat(): Returns and remove the element at the specified position in this stack...
+static char * popstr(qstack_t *stack)
qstack->popstr(): Removes a element at the top of this stack and returns that element.
+static char * getstr(qstack_t *stack)
qstack->getstr(): Returns an string at the top of this stack without removing it. ...
+static void * pop(qstack_t *stack, size_t *size)
qstack->pop(): Removes a element at the top of this stack and returns that element.
+static bool pushstr(qstack_t *stack, const char *str)
qstack->pushstr(): Pushes a string onto the top of this stack.
+static int64_t getint(qstack_t *stack)
qstack->getint(): Returns an integer at the top of this stack without removing it.
+static void * getat(qstack_t *stack, int index, size_t *size, bool newmem)
qstack->getat(): Returns an element at the specified position in this stack without removing it...
+static void clear(qstack_t *stack)
qstack->clear(): Removes all of the elements from this stack.
+static bool pushint(qstack_t *stack, int64_t num)
qstack->pushint(): Pushes a integer onto the top of this stack.
+static bool debug(qstack_t *stack, FILE *out)
qstack->debug(): Print out stored elements for debugging purpose.
+static int64_t popint(qstack_t *stack)
qstack->popint(): Removes a integer at the top of this stack and returns that element.
@@ -554,7 +573,7 @@
containers qstack.c
+ 1.8.6
diff --git a/doc/html/qstring_8c.html b/doc/html/qstring_8c.html
index 777407f6..25b22f45 100644
--- a/doc/html/qstring_8c.html
+++ b/doc/html/qstring_8c.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qstring.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,70 +76,70 @@
char * qstrtrim (char *str)
- Remove white spaces(including CR, LF) from head and tail of the string.
+ Remove white spaces(including CR, LF) from head and tail of the string. More...
char * qstrtrim_head (char *str)
- Remove heading white spaces of the string.
+ Remove heading white spaces of the string. More...
char * qstrtrim_tail (char *str)
- Remove tailing white spaces(including CR, LF) of the string.
+ Remove tailing white spaces(including CR, LF) of the string. More...
char * qstrunchar (char *str, char head , char tail)
- Remove character from head and tail of the string.
+ Remove character from head and tail of the string. More...
char * qstrreplace (const char *mode, char *srcstr, const char *tokstr, const char *word)
- Replace string or tokens as word from source string with given mode.
+ Replace string or tokens as word from source string with given mode. More...
char * qstrcpy (char *dst, size_t size , const char *src)
- Copy src string to dst.
+ Copy src string to dst. More...
char * qstrncpy (char *dst, size_t size , const char *src, size_t nbytes)
- Copy src string to dst no more than n bytes.
+ Copy src string to dst no more than n bytes. More...
char * qstrdupf (const char *format,...)
- Duplicate a formatted string.
+ Duplicate a formatted string. More...
char * qstrdup_between (const char *str, const char *start, const char *end)
- Duplicate a substing set.
+ Duplicate a substing set. More...
char * qstrcatf (char *str, const char *format,...)
- Append formatted string to the end of the source str.
+ Append formatted string to the end of the source str. More...
char * qstrgets (char *buf, size_t size , char **offset)
- Get one line from the string offset.
+ Get one line from the string offset. More...
char * qstrrev (char *str)
- Reverse the order of characters in the string.
+ Reverse the order of characters in the string. More...
char * qstrupper (char *str)
- Convert character to bigger character.
+ Convert character to bigger character. More...
char * qstrlower (char *str)
- Convert character to lower character.
+ Convert character to lower character. More...
char * qstrtok (char *str, const char *delimiters, char *retstop, int *offset)
- Split string into tokens.
+ Split string into tokens. More...
qlist_t * qstrtokenizer (const char *str, const char *delimiters)
- String Tokenizer.
+ String Tokenizer. More...
char * qstrunique (const char *seed)
- Generate unique id.
+ Generate unique id. More...
char * qstr_comma_number (int number)
- Convert integer to comma string.
+ Convert integer to comma string. More...
bool qstrtest (int(*testfunc)(int), const char *str)
- Test for an alpha-numeric string.
+ Test for an alpha-numeric string. More...
bool qstr_is_email (const char *email)
- Test for an email-address formatted string.
+ Test for an email-address formatted string. More...
bool qstr_is_ip4addr (const char *str)
- Test for an IPv4 address string.
+ Test for an IPv4 address string. More...
char * qstr_conv_encoding (const char *str, const char *fromcode, const char *tocode, float mag)
- Convert character encoding.
+ Convert character encoding. More...
@@ -271,8 +273,8 @@
Returns a pointer of source string if successful, otherewise returns NULL
Note This modify source string directly.
char *str = strdup(" \"hello world\" " );
-
-
+
+
Definition at line 149 of file qstring.c .
@@ -339,7 +341,7 @@
strcpy(srcstr, "Welcome to The qDecoder Project." );
printf("before %s : srcstr = %s\n" , mode[i], srcstr);
-
+
printf("after %s : srcstr = %s\n" , mode[i], srcstr);
printf(" retstr = %s\n\n" , retstr);
if (mode[i][1] == 'n' ) free(retstr);
@@ -636,7 +638,7 @@
char *offset = text;
char buf[1024];
-while (
qstrgets (buf,
sizeof (buf), &offset) == NULL) {
+while (
qstrgets (buf,
sizeof (buf), &offset) == NULL) {
printf("%s\n" , buf);
}
@@ -778,10 +780,10 @@
char *str = strdup("Hello,world|Thank,you" );
char *token;
int offset = 0;
-
while ((token =
qstrtok (str,
"|," , NULL, &offset)) != NULL) {
+
while ((token =
qstrtok (str,
"|," , NULL, &offset)) != NULL) {
printf("%s\n" , token);
}
-
Note This may modify str argument. The major difference between qstrtok() and standard strtok() is that qstrtok() can returns empty string tokens. If the str is "a:b::d", qstrtok() returns "a", "b", "", "d". But strtok() returns "a","b","d".
+
Note This may modify str argument. The major difference between qstrtok() and standard strtok() is that qstrtok() can returns empty string tokens. If the str is "a:b::d", qstrtok() returns "a", "b", "", "d". But strtok() returns "a","b","d".
Definition at line 554 of file qstring.c .
@@ -919,11 +921,11 @@
Returns true for ok, otherwise returns false
-
if (
qstrtest (isalnum,
"hello1234" ) ==
true ) {
+
if (
qstrtest (isalnum,
"hello1234" ) ==
true ) {
printf("It is alpha-numeric string." );
}
-
if (
qstrtest (isdigit,
"0123456789" ) ==
true ) {
+
if (
qstrtest (isdigit,
"0123456789" ) ==
true ) {
printf("It is alpha-numeric string." );
}
Note Basically you can use below test functios without creating your own version. Make sure <ctype.h> header should be included before using any of these functions. isalnum - checks for an alphanumeric character. isalpha - checks for an alphabetic character. isascii - checks whether c is a 7-bit unsigned char value that fits into the ASCII character set. isblank - checks for a blank character; that is, a space or a tab. iscntrl - checks for a control character. isdigit - checks for a digit (0 through 9). isgraph - checks for any printable character except space. islower - checks for a lower-case character. isprint - checks for any printable character including space. ispunct - checks for any printable character which is not a space or an alphanumeric character. isspace - checks for white-space characters. isupper - checks for an uppercase letter. isxdigit - checks for a hexadecimal digits. Please refer "man isalnum" for more details about these functions.
@@ -981,7 +983,7 @@
Returns true if successful, otherwise returns false
-
+
printf("It is IPv4 address string." );
}
@@ -1050,7 +1052,7 @@
utilities qstring.c
+ 1.8.6
diff --git a/doc/html/qstring_8c_source.html b/doc/html/qstring_8c_source.html
index 602e4d32..7c466a6d 100644
--- a/doc/html/qstring_8c_source.html
+++ b/doc/html/qstring_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qstring.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -117,7 +119,7 @@
-
+
@@ -152,7 +154,7 @@
-
+
@@ -178,7 +180,7 @@
-
+
@@ -211,7 +213,7 @@
-
+
@@ -298,7 +300,7 @@
- 236 char *
qstrreplace (
const char *mode,
char *srcstr,
const char *tokstr,
+ 236 char *
qstrreplace (
const char *mode,
char *srcstr,
const char *tokstr,
238 if (mode == NULL || strlen(mode) != 2 || srcstr == NULL || tokstr == NULL
@@ -382,12 +384,12 @@
-
+
321 if (dst == NULL || size == 0 || src == NULL)
324 size_t nbytes = strlen(src);
- 325 return qstrncpy (dst, size, src, nbytes);
+ 325 return qstrncpy (dst, size, src, nbytes);
@@ -401,7 +403,7 @@
- 339 char *
qstrncpy (
char *dst,
size_t size ,
const char *src,
size_t nbytes) {
+ 339 char *
qstrncpy (
char *dst,
size_t size ,
const char *src,
size_t nbytes) {
340 if (dst == NULL || size == 0 || src == NULL)
@@ -420,7 +422,7 @@
-
+
360 DYNAMIC_VSPRINTF(str, format);
@@ -441,7 +443,7 @@
-
+
381 if ((s = strstr(str, start)) == NULL)
@@ -468,7 +470,7 @@
- 406 char *
qstrcatf (
char *str,
const char *format, ...) {
+ 406 char *
qstrcatf (
char *str,
const char *format, ...) {
408 DYNAMIC_VSPRINTF(buf, format);
@@ -501,7 +503,7 @@
-
+
440 if (offset == NULL || *offset == NULL || **offset ==
'\0' )
@@ -533,7 +535,7 @@
-
+
@@ -556,7 +558,7 @@
-
+
@@ -576,7 +578,7 @@
-
+
@@ -616,7 +618,7 @@
- 554 char *
qstrtok (
char *str,
const char *delimiters,
char *retstop,
int *offset) {
+ 554 char *
qstrtok (
char *str,
const char *delimiters,
char *retstop,
int *offset) {
555 char *tokensp, *tokenep;
557 tokensp = tokenep = (
char *) (str + *offset);
@@ -662,8 +664,8 @@
-
- 601 qlist_t *list =
qlist (0);
+
+ 601 qlist_t *list =
qlist (0);
@@ -671,9 +673,9 @@
606 char *dupstr = strdup(str);
- 609 for (i = 1, token =
qstrtok (dupstr, delimiters, NULL, &offset);
+ 609 for (i = 1, token =
qstrtok (dupstr, delimiters, NULL, &offset);
- 611 token =
qstrtok (dupstr, delimiters, NULL, &offset), i++) {
+ 611 token =
qstrtok (dupstr, delimiters, NULL, &offset), i++) {
612 list->addlast(list, token, strlen(token) + 1);
@@ -693,7 +695,7 @@
-
+
@@ -710,8 +712,8 @@
645 (
unsigned long int ) time(NULL), usec, (seed != NULL) ? seed :
"" );
647 unsigned char md5hash[16];
- 648 qhashmd5 (uniquestr, strlen(uniquestr), md5hash);
-
+ 648 qhashmd5 (uniquestr, strlen(uniquestr), md5hash);
+
@@ -724,7 +726,7 @@
-
+
665 str = strp = (
char *) malloc(
sizeof (
char ) * (14 + 1));
@@ -785,7 +787,7 @@
- 723 bool qstrtest (
int (*testfunc)(
int ),
const char *str) {
+ 723 bool qstrtest (
int (*testfunc)(
int ),
const char *str) {
724 for (; *str; str++) {
725 if (testfunc(*str) == 0)
@@ -800,7 +802,7 @@
-
+
739 int i, alpa, dot, gol;
@@ -858,7 +860,7 @@
-
+
797 char *dupstr = strdup(str);
@@ -868,7 +870,7 @@
- 806 if (
qstrtest (isdigit, s1) ==
false || (n = atoi(s1)) <= 0 || n >= 256) {
+ 806 if (
qstrtest (isdigit, s1) ==
false || (n = atoi(s1)) <= 0 || n >= 256) {
@@ -899,7 +901,7 @@
-
+
838 const char *tocode,
float mag) {
840 if (str == NULL)
return NULL;
@@ -932,6 +934,33 @@
+char * qstrdup_between(const char *str, const char *start, const char *end)
Duplicate a substing set.
+static size_t size(qlist_t *list)
qlist->size(): Returns the number of elements in this list.
+char * qhex_encode(const void *bin, size_t size)
Encode data to Hexadecimal digit format.
+char * qstrcatf(char *str, const char *format,...)
Append formatted string to the end of the source str.
+char * qstrupper(char *str)
Convert character to bigger character.
+char * qstrtrim_tail(char *str)
Remove tailing white spaces(including CR, LF) of the string.
+char * qstrgets(char *buf, size_t size, char **offset)
Get one line from the string offset.
+bool qstr_is_ip4addr(const char *str)
Test for an IPv4 address string.
+qlist_t * qlist(int options)
Create new qlist_t linked-list container.
+char * qstrtrim_head(char *str)
Remove heading white spaces of the string.
+char * qstrdupf(const char *format,...)
Duplicate a formatted string.
+bool qhashmd5(const void *data, size_t nbytes, void *retbuf)
Calculate 128-bit(16-bytes) MD5 hash.
+char * qstr_conv_encoding(const char *str, const char *fromcode, const char *tocode, float mag)
Convert character encoding.
+char * qstrncpy(char *dst, size_t size, const char *src, size_t nbytes)
Copy src string to dst no more than n bytes.
+qlist_t * qstrtokenizer(const char *str, const char *delimiters)
String Tokenizer.
+char * qstrtrim(char *str)
Remove white spaces(including CR, LF) from head and tail of the string.
+char * qstrunchar(char *str, char head, char tail)
Remove character from head and tail of the string.
+char * qstrcpy(char *dst, size_t size, const char *src)
Copy src string to dst.
+char * qstrtok(char *str, const char *delimiters, char *retstop, int *offset)
Split string into tokens.
+bool qstrtest(int(*testfunc)(int), const char *str)
Test for an alpha-numeric string.
+char * qstrrev(char *str)
Reverse the order of characters in the string.
+bool qstr_is_email(const char *email)
Test for an email-address formatted string.
+char * qstrreplace(const char *mode, char *srcstr, const char *tokstr, const char *word)
Replace string or tokens as word from source string with given mode.
+char * qstr_comma_number(int number)
Convert integer to comma string.
+char * qstrlower(char *str)
Convert character to lower character.
+char * qstrunique(const char *seed)
Generate unique id.
+static bool head(qhttpclient_t *client, const char *uri, int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders)
qhttpclient->head(): Sends a HEAD request.
@@ -940,7 +969,7 @@
utilities qstring.c
+ 1.8.6
diff --git a/doc/html/qsystem_8c.html b/doc/html/qsystem_8c.html
index 011fa075..9530bae8 100644
--- a/doc/html/qsystem_8c.html
+++ b/doc/html/qsystem_8c.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qsystem.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,10 +76,10 @@
const char * qgetenv (const char *envname, const char *defstr)
- Get system environment variable.
+ Get system environment variable. More...
char * qsyscmd (const char *cmd )
- Get the result string of external command execution.
+ Get the result string of external command execution. More...
@@ -159,7 +161,7 @@
utilities qsystem.c
+ 1.8.6
diff --git a/doc/html/qsystem_8c_source.html b/doc/html/qsystem_8c_source.html
index 2f91b96e..81df2190 100644
--- a/doc/html/qsystem_8c_source.html
+++ b/doc/html/qsystem_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qsystem.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -116,7 +118,7 @@
- 54 const char *
qgetenv (
const char *envname,
const char *defstr) {
+ 54 const char *
qgetenv (
const char *envname,
const char *defstr) {
55 const char *envstr = getenv(envname);
56 return (envstr) ? envstr : defstr;
@@ -133,11 +135,11 @@
-
+
72 FILE *fp = popen(cmd,
"r" );
-
+
@@ -145,6 +147,10 @@
+const char * qgetenv(const char *envname, const char *defstr)
Get system environment variable.
+static void * cmd(qhttpclient_t *client, const char *method, const char *uri, void *data, size_t size, int *rescode, size_t *contentslength, qlisttbl_t *reqheaders, qlisttbl_t *resheaders)
qhttpclient->cmd(): Sends a custom request(method) to the remote host and reads it's response...
+char * qsyscmd(const char *cmd)
Get the result string of external command execution.
+void * qfile_read(FILE *fp, size_t *nbytes)
Read data from a file stream.
@@ -153,7 +159,7 @@
utilities qsystem.c
+ 1.8.6
diff --git a/doc/html/qtime_8c.html b/doc/html/qtime_8c.html
index 9a26bf16..5cf84df9 100644
--- a/doc/html/qtime_8c.html
+++ b/doc/html/qtime_8c.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qtime.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,28 +76,28 @@
long qtime_current_milli (void)
- Returns the current time in milliseconds.
+ Returns the current time in milliseconds. More...
char * qtime_localtime_strf (char *buf, int size , time_t utctime, const char *format)
- Get custom formmatted local time string.
+ Get custom formmatted local time string. More...
char * qtime_localtime_str (time_t utctime)
- Get local time string formatted like '02-Nov-2007 16:37:39 +0900'.
+ Get local time string formatted like '02-Nov-2007 16:37:39 +0900'. More...
const char * qtime_localtime_staticstr (time_t utctime)
- Get local time string formatted like '02-Nov-2007 16:37:39 +0900'.
+ Get local time string formatted like '02-Nov-2007 16:37:39 +0900'. More...
char * qtime_gmt_strf (char *buf, int size , time_t utctime, const char *format)
- Get custom formmatted GMT time string.
+ Get custom formmatted GMT time string. More...
char * qtime_gmt_str (time_t utctime)
- Get GMT time string formatted like 'Wed, 11-Nov-2007 23:19:25 GMT'.
+ Get GMT time string formatted like 'Wed, 11-Nov-2007 23:19:25 GMT'. More...
const char * qtime_gmt_staticstr (time_t utctime)
- Get GMT time string formatted like 'Wed, 11-Nov-2007 23:19:25 GMT'.
+ Get GMT time string formatted like 'Wed, 11-Nov-2007 23:19:25 GMT'. More...
time_t qtime_parse_gmtstr (const char *gmtstr)
- This parses GMT/Timezone(+/-) formatted time sting like 'Sun, 04 May 2008 18:50:39 GMT', 'Mon, 05 May 2008 03:50:39 +0900' and returns as universal time.
+ This parses GMT/Timezone(+/-) formatted time sting like 'Sun, 04 May 2008 18:50:39 GMT', 'Mon, 05 May 2008 03:50:39 +0900' and returns as universal time. More...
@@ -171,9 +173,9 @@
Returns string pointer of buf
-
+
free(timestr);
-
+
free(timestr);
Definition at line 70 of file qtime.c .
@@ -203,11 +205,11 @@
Returns mallocked string pointer of time string
char *timestr;
-
+
free(timestr);
-
+
free(timestr);
-
+
free(timestr);
Definition at line 100 of file qtime.c .
@@ -236,8 +238,8 @@
Returns internal static string pointer of time string
-
-
+
Definition at line 119 of file qtime.c .
@@ -291,7 +293,7 @@
Returns string pointer of buf
Definition at line 142 of file qtime.c .
@@ -320,11 +322,11 @@
Returns malloced string pointer which points GMT time string.
char *timestr;
-
+
free(timestr);
-
+
free(timestr);
-
+
free(timestr);
Definition at line 168 of file qtime.c .
@@ -353,8 +355,8 @@
Returns internal static string pointer which points GMT time string.
-
-
+
Definition at line 188 of file qtime.c .
@@ -383,10 +385,10 @@
Returns universal time(UTC). in case of conversion error, returns -1.
time_t t = time(NULL);
-
+
printf("%d\n" , t);
printf("%s\n" , s);
-
+
free(s);
Definition at line 214 of file qtime.c .
@@ -401,7 +403,7 @@
utilities qtime.c
+ 1.8.6
diff --git a/doc/html/qtime_8c_source.html b/doc/html/qtime_8c_source.html
index f2b4c87c..2e9b7efc 100644
--- a/doc/html/qtime_8c_source.html
+++ b/doc/html/qtime_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: utilities/qtime.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -108,7 +110,7 @@
-
+
48 gettimeofday(&tv, NULL);
49 long time = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
@@ -132,7 +134,7 @@
-
+
@@ -162,10 +164,10 @@
-
- 101 int size =
sizeof (char) * (CONST_STRLEN(
"00-Jan-0000 00:00:00 +0000" ) + 1);
+
+ 101 int size =
sizeof (char) * (CONST_STRLEN(
"00-Jan-0000 00:00:00 +0000" ) + 1);
102 char *timestr = (
char *) malloc(size);
-
+
@@ -181,10 +183,10 @@
-
+
120 static char timestr[
sizeof (char)
121 * (CONST_STRLEN(
"00-Jan-0000 00:00:00 +0000" ) + 1)];
-
+
123 "%d-%b-%Y %H:%M:%S %z" );
@@ -204,7 +206,7 @@
-
+
144 utctime = time(NULL);
145 struct tm *gmtm = gmtime(&utctime);
@@ -230,11 +232,11 @@
-
- 169 int size =
sizeof (char)
+
+ 169 int size =
sizeof (char)
170 * (CONST_STRLEN(
"Mon, 00 Jan 0000 00:00:00 GMT" ) + 1);
171 char *timestr = (
char *) malloc(size);
- 172 qtime_gmt_strf (timestr, size, utctime,
"%a, %d %b %Y %H:%M:%S GMT" );
+ 172 qtime_gmt_strf (timestr, size, utctime,
"%a, %d %b %Y %H:%M:%S GMT" );
@@ -250,10 +252,10 @@
-
+
189 static char timestr[
sizeof (char)
190 * (CONST_STRLEN(
"Mon, 00-Jan-0000 00:00:00 GMT" ) + 1)];
-
+
192 "%a, %d %b %Y %H:%M:%S GMT" );
@@ -276,7 +278,7 @@
-
+
216 if (strptime(gmtstr,
"%a, %d %b %Y %H:%M:%S" , &gmtm) == NULL)
@@ -296,6 +298,15 @@
+static size_t size(qlist_t *list)
qlist->size(): Returns the number of elements in this list.
+char * qtime_localtime_strf(char *buf, int size, time_t utctime, const char *format)
Get custom formmatted local time string.
+char * qtime_gmt_str(time_t utctime)
Get GMT time string formatted like 'Wed, 11-Nov-2007 23:19:25 GMT'.
+char * qtime_localtime_str(time_t utctime)
Get local time string formatted like '02-Nov-2007 16:37:39 +0900'.
+const char * qtime_gmt_staticstr(time_t utctime)
Get GMT time string formatted like 'Wed, 11-Nov-2007 23:19:25 GMT'.
+const char * qtime_localtime_staticstr(time_t utctime)
Get local time string formatted like '02-Nov-2007 16:37:39 +0900'.
+long qtime_current_milli(void)
Returns the current time in milliseconds.
+time_t qtime_parse_gmtstr(const char *gmtstr)
This parses GMT/Timezone(+/-) formatted time sting like 'Sun, 04 May 2008 18:50:39 GMT'...
+char * qtime_gmt_strf(char *buf, int size, time_t utctime, const char *format)
Get custom formmatted GMT time string.
@@ -304,7 +315,7 @@
utilities qtime.c
+ 1.8.6
diff --git a/doc/html/qtokenbucket_8c.html b/doc/html/qtokenbucket_8c.html
index ff2b50d0..3961f512 100644
--- a/doc/html/qtokenbucket_8c.html
+++ b/doc/html/qtokenbucket_8c.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qtokenbucket.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,13 +76,13 @@
void qtokenbucket_init (qtokenbucket_t *bucket, int init_tokens, int max_tokens, int tokens_per_sec)
- Initialize the token bucket.
+ Initialize the token bucket. More...
bool qtokenbucket_consume (qtokenbucket_t *bucket, int tokens)
- Consume tokens from the bucket.
+ Consume tokens from the bucket. More...
long qtokenbucket_waittime (qtokenbucket_t *bucket, int tokens)
- Get the estimate time until given number of token is ready.
+ Get the estimate time until given number of token is ready. More...
@@ -88,11 +90,11 @@
Current implementation is not thread-safe.
More information about token-bucket: http://en.wikipedia.org/wiki/Token_bucket
diff --git a/doc/html/qtokenbucket_8c_source.html b/doc/html/qtokenbucket_8c_source.html
index 79d9b091..c930c2bc 100644
--- a/doc/html/qtokenbucket_8c_source.html
+++ b/doc/html/qtokenbucket_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: extensions/qtokenbucket.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -118,7 +120,7 @@
-
+
58 #include "utilities/qtime.h"
59 #include "qinternal.h"
@@ -138,13 +140,13 @@
-
+
- 78 bzero(bucket,
sizeof (qtokenbucket_t));
+ 78 memset(bucket, 0,
sizeof (qtokenbucket_t));
79 bucket->tokens = init_tokens;
80 bucket->max_tokens = max_tokens;
81 bucket->tokens_per_sec = tokens_per_sec;
-
+
@@ -155,7 +157,7 @@
-
+
94 refill_tokens(bucket);
95 if (bucket->tokens < tokens) {
@@ -171,7 +173,7 @@
-
+
110 refill_tokens(bucket);
111 if (bucket->tokens >= tokens) {
@@ -187,7 +189,7 @@
124 static void refill_tokens(qtokenbucket_t *bucket) {
-
+
126 if (bucket->tokens < bucket->max_tokens) {
127 double new_tokens = (now - bucket->last_fill) * 0.001
128 * bucket->tokens_per_sec;
@@ -198,6 +200,10 @@
133 bucket->last_fill = now;
135 #endif // _DOXYGEN_SKIP
+long qtokenbucket_waittime(qtokenbucket_t *bucket, int tokens)
Get the estimate time until given number of token is ready.
+bool qtokenbucket_consume(qtokenbucket_t *bucket, int tokens)
Consume tokens from the bucket.
+long qtime_current_milli(void)
Returns the current time in milliseconds.
+void qtokenbucket_init(qtokenbucket_t *bucket, int init_tokens, int max_tokens, int tokens_per_sec)
Initialize the token bucket.
@@ -206,7 +212,7 @@
extensions qtokenbucket.c
+ 1.8.6
diff --git a/doc/html/qvector_8c.html b/doc/html/qvector_8c.html
index 3b6c4dfc..c5c6bbb9 100644
--- a/doc/html/qvector_8c.html
+++ b/doc/html/qvector_8c.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qvector.c File Reference
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -74,44 +76,44 @@
qvector_t * qvector (int options)
- Initialize vector.
+ Initialize vector. More...
static bool add (qvector_t *vector, const void *data, size_t size )
- qvector->add() : Stack object
+ qvector->add() : Stack object More...
static bool addstr (qvector_t *vector, const char *str)
- qvector->addstr() : Stack string
+ qvector->addstr() : Stack string More...
static bool addstrf (qvector_t *vector, const char *format,...)
- qvector->addstrf() : Stack formatted string
+ qvector->addstrf() : Stack formatted string More...
static void * toarray (qvector_t *vector, size_t *size )
- qvector->toarray() : Returns the serialized chunk containing all the elements in this vector.
+ qvector->toarray() : Returns the serialized chunk containing all the elements in this vector. More...
static char * tostring (qvector_t *vector)
- qvector->tostring() : Returns a string representation of this vector, containing string representation of each element.
+ qvector->tostring() : Returns a string representation of this vector, containing string representation of each element. More...
static size_t size (qvector_t *vector)
- qvector->size() : Returns the number of elements in this vector.
+ qvector->size() : Returns the number of elements in this vector. More...
static size_t datasize (qvector_t *vector)
- qvector->datasize() : Returns the sum of total element size in this vector.
+ qvector->datasize() : Returns the sum of total element size in this vector. More...
static void clear (qvector_t *vector)
- qvector->clear() : Removes all of the elements from this vector.
+ qvector->clear() : Removes all of the elements from this vector. More...
static bool debug (qvector_t *vector, FILE *out)
- qvector->debug() : Print out stored elements for debugging purpose.
+ qvector->debug() : Print out stored elements for debugging purpose. More...
static void free_ (qvector_t *vector)
- qvector->free(): De-allocate vector
+ qvector->free(): De-allocate vector More...
Vector implementation.
qvector container is a vector implementation. It implements a growable array of objects and it extends qlist container that allow a linked-list to be treated as a vector.
[Code sample - Object]
-
qvector_t *vector =
qvector (QVECTOR_THREADSAFE);
+
qvector_t *vector =
qvector (QVECTOR_THREADSAFE);
vector->addstr(vector, "AB" );
@@ -140,7 +142,7 @@
};
-
+
int i;
@@ -208,7 +210,7 @@
-
qvector_t *vector =
qvector (QVECTOR_THREADSAFE);
+
qvector_t *vector =
qvector (QVECTOR_THREADSAFE);
vector->free(vector);
Note Available options:
QVECTOR_THREADSAFE - make it thread-safe.
@@ -257,7 +259,7 @@
-
qvector->add() : Stack object
+
qvector->add() : Stack object
Parameters
vector qvector_t container pointer.
@@ -314,7 +316,7 @@
-
qvector->addstr() : Stack string
+
qvector->addstr() : Stack string
Parameters
vector qvector_t container pointer.
@@ -376,7 +378,7 @@
-
qvector->addstrf() : Stack formatted string
+
qvector->addstrf() : Stack formatted string
Parameters
vector qvector_t container pointer.
@@ -524,7 +526,7 @@
-
qvector->size() : Returns the number of elements in this vector.
+
qvector->size() : Returns the number of elements in this vector.
Parameters
vector qvector_t container pointer.
@@ -559,7 +561,7 @@
-
qvector->datasize() : Returns the sum of total element size in this vector.
+
qvector->datasize() : Returns the sum of total element size in this vector.
Parameters
vector qvector_t container pointer.
@@ -594,7 +596,7 @@
-
qvector->clear() : Removes all of the elements from this vector.
+
qvector->clear() : Removes all of the elements from this vector.
Parameters
vector qvector_t container pointer.
@@ -638,7 +640,7 @@
-
qvector->debug() : Print out stored elements for debugging purpose.
+
qvector->debug() : Print out stored elements for debugging purpose.
Parameters
vector qvector_t container pointer.
@@ -703,7 +705,7 @@
containers qvector.c
+ 1.8.6
diff --git a/doc/html/qvector_8c_source.html b/doc/html/qvector_8c_source.html
index f6df6248..acd94c41 100644
--- a/doc/html/qvector_8c_source.html
+++ b/doc/html/qvector_8c_source.html
@@ -3,6 +3,7 @@
+
qlibc: containers/qvector.c Source File
@@ -12,6 +13,7 @@
@@ -30,7 +32,7 @@
-
+
Main Page
@@ -181,16 +183,16 @@
118 #ifndef _DOXYGEN_SKIP
- 119 static bool add (qvector_t *vector,
const void *
object ,
size_t size );
- 120 static bool addstr (qvector_t *vector,
const char *str);
- 121 static bool addstrf (qvector_t *vector,
const char *format, ...);
- 122 static void *
toarray (qvector_t *vector,
size_t *
size );
- 123 static char *
tostring (qvector_t *vector);
- 124 static size_t size (qvector_t *vector);
- 125 static size_t datasize (qvector_t *vector);
- 126 static void clear (qvector_t *vector);
- 127 static bool debug (qvector_t *vector, FILE *out);
- 128 static void free_ (qvector_t *vector);
+ 119 static bool add (qvector_t *vector,
const void *
object ,
size_t size );
+ 120 static bool addstr (qvector_t *vector,
const char *str);
+ 121 static bool addstrf (qvector_t *vector,
const char *format, ...);
+ 122 static void *
toarray (qvector_t *vector,
size_t *
size );
+ 123 static char *
tostring (qvector_t *vector);
+ 124 static size_t size (qvector_t *vector);
+ 125 static size_t datasize (qvector_t *vector);
+ 126 static void clear (qvector_t *vector);
+ 127 static bool debug (qvector_t *vector, FILE *out);
+ 128 static void free_ (qvector_t *vector);
@@ -212,14 +214,14 @@
-
+
151 qvector_t *vector = (qvector_t *) calloc(1,
sizeof (qvector_t));
152 if (vector == NULL) {
- 157 vector->list =
qlist (options);
+ 157 vector->list =
qlist (options);
158 if (vector->list == NULL) {
@@ -227,18 +229,18 @@
-
-
-
+
+
+
-
-
+
+
-
-
- 174 vector->clear =
clear ;
- 175 vector->debug =
debug ;
- 176 vector->free =
free_ ;
+
+
+ 174 vector->clear =
clear ;
+ 175 vector->debug =
debug ;
+ 176 vector->free =
free_ ;
@@ -255,7 +257,7 @@
- 193 static bool add (qvector_t *vector,
const void *data,
size_t size ) {
+ 193 static bool add (qvector_t *vector,
const void *data,
size_t size ) {
194 return vector->list->addlast(vector->list, data, size);
@@ -270,7 +272,7 @@
- 208 static bool addstr (qvector_t *vector,
const char *str) {
+ 208 static bool addstr (qvector_t *vector,
const char *str) {
209 return vector->list->addlast(vector->list, str, strlen(str));
@@ -285,7 +287,7 @@
- 223 static bool addstrf (qvector_t *vector,
const char *format, ...) {
+ 223 static bool addstrf (qvector_t *vector,
const char *format, ...) {
225 DYNAMIC_VSPRINTF(str, format);
@@ -293,7 +295,7 @@
- 231 bool ret =
addstr (vector, str);
+ 231 bool ret =
addstr (vector, str);
@@ -312,7 +314,7 @@
-
+
251 return vector->list->toarray(vector->list, size);
@@ -330,7 +332,7 @@
-
+
269 return vector->list->tostring(vector->list);
@@ -341,7 +343,7 @@
- 279 static size_t size (qvector_t *vector) {
+ 279 static size_t size (qvector_t *vector) {
280 return vector->list->size(vector->list);
@@ -353,7 +355,7 @@
-
+
292 return vector->list->datasize(vector->list);
@@ -362,7 +364,7 @@
- 300 static void clear (qvector_t *vector) {
+ 300 static void clear (qvector_t *vector) {
301 vector->list->clear(vector->list);
@@ -376,7 +378,7 @@
- 314 static bool debug (qvector_t *vector, FILE *out) {
+ 314 static bool debug (qvector_t *vector, FILE *out) {
315 return vector->list->debug(vector->list, out);
@@ -385,10 +387,22 @@
- 323 static void free_ (qvector_t *vector) {
+ 323 static void free_ (qvector_t *vector) {
324 vector->list->free(vector->list);
+static void * toarray(qvector_t *vector, size_t *size)
qvector->toarray(): Returns the serialized chunk containing all the elements in this vector...
+static size_t datasize(qvector_t *vector)
qvector->datasize(): Returns the sum of total element size in this vector.
+qlist_t * qlist(int options)
Create new qlist_t linked-list container.
+static size_t size(qvector_t *vector)
qvector->size(): Returns the number of elements in this vector.
+static bool add(qvector_t *vector, const void *data, size_t size)
qvector->add(): Stack object
+static bool addstr(qvector_t *vector, const char *str)
qvector->addstr(): Stack string
+static bool debug(qvector_t *vector, FILE *out)
qvector->debug(): Print out stored elements for debugging purpose.
+static bool addstrf(qvector_t *vector, const char *format,...)
qvector->addstrf(): Stack formatted string
+static void clear(qvector_t *vector)
qvector->clear(): Removes all of the elements from this vector.
+static void free_(qvector_t *vector)
qvector->free(): De-allocate vector
+static char * tostring(qvector_t *vector)
qvector->tostring(): Returns a string representation of this vector, containing string representation...
+qvector_t * qvector(int options)
Initialize vector.
@@ -397,7 +411,7 @@
containers qvector.c
+ 1.8.6
diff --git a/doc/html/resize.js b/doc/html/resize.js
index 9fe82ba9..304fcb6b 100644
--- a/doc/html/resize.js
+++ b/doc/html/resize.js
@@ -37,8 +37,8 @@ function writeCookie(cookie, val, expiration)
function resizeWidth()
{
var windowWidth = $(window).width() + "px";
- var sidenavWidth = $(sidenav).width();
- content.css({marginLeft:parseInt(sidenavWidth)+6+"px"}); //account for 6px-wide handle-bar
+ var sidenavWidth = $(sidenav).outerWidth();
+ content.css({marginLeft:parseInt(sidenavWidth)+"px"});
writeCookie('width',sidenavWidth, null);
}
@@ -51,8 +51,8 @@ function restoreWidth(navWidth)
function resizeHeight()
{
- var headerHeight = header.height();
- var footerHeight = footer.height();
+ var headerHeight = header.outerHeight();
+ var footerHeight = footer.outerHeight();
var windowHeight = $(window).height() - headerHeight - footerHeight;
content.css({height:windowHeight + "px"});
navtree.css({height:windowHeight + "px"});
@@ -77,15 +77,19 @@ function initResizable()
var _preventDefault = function(evt) { evt.preventDefault(); };
$("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault);
$(document).bind('touchmove',function(e){
- try {
- var target = e.target;
- while (target) {
- if ($(target).css('-webkit-overflow-scrolling')=='touch') return;
- target = target.parentNode;
+ var device = navigator.userAgent.toLowerCase();
+ var ios = device.match(/(iphone|ipod|ipad)/);
+ if (ios) {
+ try {
+ var target = e.target;
+ while (target) {
+ if ($(target).css('-webkit-overflow-scrolling')=='touch') return;
+ target = target.parentNode;
+ }
+ e.preventDefault();
+ } catch(err) {
+ e.preventDefault();
}
- e.preventDefault();
- } catch(err) {
- e.preventDefault();
}
});
}
diff --git a/doc/html/tab_b.png b/doc/html/tab_b.png
index 5f6601a813b57d522fb8e3d83a94db3c11bd004b..e2b4a8638cb3496a016eaed9e16ffc12846dea18 100644
GIT binary patch
delta 141
zcmV;80CNAT0jU9yB!6&8L_t(|0qxyQ4uc>RMd8Q0(A2oN4s~GSz_eB{&>x`2eL8dp
zT|~jMkaNG}u7bAx%XOvre3E$i74E&jKK~gPF}n{Y8=!5(I0xKQ+0l61Ou$w991{_m
v-m(zHX%0n}isespgrbrefo^!<(&``6OBznHeiUi|0000~sYDvSRWp+$+LO5&al3JOi2`pmhuTb?;|lyBT%TdJ_>`
w%g$7lQj_e!n4+jgvI}=i~1Nl00000Ne4wvM6N<$f&{8VkN^Mx