Skip to content
Snippets Groups Projects
Commit b0f2c9be authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Minor tweaks of the manual after review.

parent e2226a57
No related branches found
No related tags found
No related merge requests found
......@@ -165,7 +165,7 @@ Tarantool 1.4.0-69-g45551dd
either redirect its standard out and standard error
streams, or provide <emphasis>logger</emphasis> option
in the configuration file, since otherwise all logging
information will be lost</para></caution>.
information will be lost.</para></caution>
</para>
</listitem>
</itemizedlist>
......@@ -252,8 +252,8 @@ Tarantool 1.4.0-69-g45551dd
<entry>no</entry>
<entry>A directory where database working files will be stored.
The server switches to work_dir with chdir(2) after
start. Can be relative to the configuration file directory.
If not specified, defaults to configuration file directory.</entry>
start. Can be relative to the current directory.
If not specified, defaults to the current directory.</entry>
</row>
<row>
......@@ -377,7 +377,7 @@ Tarantool 1.4.0-69-g45551dd
<programlisting>kostja@shmita:~$ ps -a -o command | grep box
tarantool_box: primary pri: 33013 sec: 33014 adm: 33015</programlisting>
<para>But if the configuration file contains custom_proc_title=sessions then
the output looks like::</para>
the output looks like:</para>
<programlisting>kostja@shmita:~$ ps -a -o command | grep box
tarantool_box: primary@sessions pri: 33013 sec: 33014 adm: 33015</programlisting>
</entry>
......
......@@ -133,59 +133,59 @@ And that is why APIs exist for drivers for C, Perl, Python, PHP, Ruby, and so on
server returned an error, then &mdash; if all is well &mdash; print "Insert succeeded". If the
row already exists, the program will print <quote>Duplicate key exists in unique index 0</quote>.
</para>
<programlisting><code>
<programlisting language="cpp">
#include &lt;arpa/inet.h&gt;
#include &lt;stdio.h&gt;
#include &lt;tp.h&gt; /* the usual Tarantool include */
#include &lt;tp.h&gt; /* the usual Tarantool include */
int main ()
int main()
{
struct tp request; /* area for sending to server */
struct tp reply; /* area for getting server reply */
int fd; /* file descriptor for socket */
struct sockaddr_in tt; /* the usual socket address info */
tp_init(&amp;request, NULL, 0, tp_realloc, NULL); /* initialize request buffer */
tp_insert(&amp;request, 0, 2); /* append INSERT header */
tp_tuple(&amp;request); /* begin appending body */
tp_sz(&amp;request,""); /* append field[0] */
tp_sz(&amp;request,"BB"); /* append field[1] */
if ((fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) &lt;= 0) /* open the socket, abort if failure */
exit(1);
memset(&amp;tt, 0, sizeof(tt)); /* connect to localhost:33013 */
tt.sin_family = AF_INET;
tt.sin_addr.s_addr = inet_addr("127.0.0.1");
tt.sin_port = htons(33013);
if (connect(fd, (struct sockaddr *) &amp;tt, sizeof(tt)) &lt;= 0) /* connect, abort if failure */
exit(1);
int rc = write(fd, tp_buf(&amp;request), tp_used(&amp;request)); /* send the INSERT request */
if (rc != tp_used(&amp;request)) /* abort if send failed */
exit(1);
tp_init(&amp;reply, NULL, 0, tp_realloc, NULL); /* initialize reply buffer */
while (1) {
ssize_t to_read = tp_req(&amp;reply);
if (to_read &lt;= 0)
break;
ssize_t new_size = tp_ensure(&amp;reply, to_read);
if (new_size == -1) /* abort if error e.g. no memory */
exit(1);
ssize_t res = read(fd, reply.p, to_read); /* get reply */
if (res &lt;= 0) /* abort if error e.g. no reply */
exit(1);
tp_use(&amp;reply, res);
struct tp request; /* area for sending to server */
struct tp reply; /* area for getting server reply */
int fd; /* file descriptor for socket */
struct sockaddr_in tt; /* the usual socket address info */
tp_init(&amp;request, NULL, 0, tp_realloc, NULL) /* initialize request buffer */
tp_insert(&amp;request, 0, 2); /* append INSERT header */
tp_tuple(&amp;request); /* begin appending body */
tp_sz(&amp;request,""); /* append field[0] */
tp_sz(&amp;request,"BB"); /* append field[1] */
if ((fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) &lt;= 0) /* open the socket, abort if failure */
exit(1);
memset(&amp;tt, 0, sizeof(tt)); /* connect to localhost:33013 */
tt.sin_family = AF_INET;
tt.sin_addr.s_addr = inet_addr("127.0.0.1");
tt.sin_port = htons(33013);
if (connect(fd, (struct sockaddr *) &amp;tt, sizeof(tt)) &lt;= 0) /* connect, abort if failure */
exit(1);
int rc = write(fd, tp_buf(&amp;request), tp_used(&amp;request)); /* send the INSERT request */
if (rc != tp_used(&amp;request)) /* abort if send failed */
exit(1);
tp_init(&amp;reply, NULL, 0, tp_realloc, NULL); /* initialize reply buffer */
while (1) {
ssize_t to_read = tp_req(&amp;reply);
if (to_read &lt;= 0)
break;
ssize_t new_size = tp_ensure(&amp;reply, to_read);
if (new_size == -1) /* abort if error e.g. no memory */
exit(1);
ssize_t res = read(fd, reply.p, to_read); /* get reply */
if (res &lt;= 0) /* abort if error e.g. no reply */
exit(1);
tp_use(&amp;reply, res);
}
ssize_t server_code = tp_reply(&amp;reply); /* display+abort if error e.g. duplicate key */
if (server_code != 0) {
printf("error: %-.*s\n", tp_replyerrorlen(&amp;reply),
tp_replyerror(&amp;reply));
ssize_t server_code = tp_reply(&amp;reply); /* display+abort if error e.g. duplicate key */
if (server_code != 0) {
printf("error: %-.*s\n", tp_replyerrorlen(&amp;reply),
tp_replyerror(&amp;reply));
tp_free(&amp;reply);
exit(1);
}
tp_free(&amp;request); /* clean up */
tp_free(&amp;reply);
exit(1);
}
tp_free(&amp;request); /* clean up */
tp_free(&amp;reply);
close(fd);
printf("Insert succeeded\n"); /* congratulate self */
close(fd);
printf("Insert succeeded\n"); /* congratulate self */
}
</code></programlisting>
</programlisting>
<para>
The example program only shows one command and does not show all that's necessary for
good practice. For that, please see <link
......
......@@ -7,7 +7,7 @@
<para>
If you tried out the <link linkend="starting"><quote>Starting Tarantool and making your first database</quote></link>
If you tried out the <link linkend="getting-started-start-stop"><quote>Starting Tarantool and making your first database</quote></link>
exercise from the last chapter, then your database looks like this:
<programlisting>
+--------------------------------------------+
......
......@@ -110,7 +110,7 @@
Outside Mail.Ru the software is used by a growing
number of projects in online gaming, digital marketing, and social
media industries. While product development is sponsored by Mail.Ru, the
roadmap and the bugs database and the development process are fully
roadmap, the bugs database and the development process are fully
open. The software incorporates patches from dozens of
community contributors. The Tarantool community writes and maintains
most of the drivers for programming languages.
......@@ -151,17 +151,7 @@
contact developers directly on
<link xlink:href="irc://irc.freenode.net#tarantool">#tarantool</link>
IRC channel or via a mailing list,
<link xlink:href="https://launchpad.net/~tarantool-developers">tarantool-developers@lists.launchpad.net</link>.
</para>
<para>
<emphasis role="strong">Caution:</emphasis> To prevent spam, the Launchpad
mailing-list software silently drops all mail coming from
non-registered email addresses -- so register with Launchpad
before sending emails. Launchpad registration also
allows you to report bugs and create feature requests.
You can check that your mail was delivered by looking at the
mailing list archive, <link
xlink:href="https://lists.launchpad.net/tarantool-developers"/>.
<link xlink:href="https://googlegroups.com/group/tarantool">Tarantool Google group</link>.
</para>
</section>
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment