diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-09-20 11:38:00 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-09-20 11:38:00 +1000 |
commit | f8251749be64b4cebc4cef3c7b73c025fe9c8c54 (patch) | |
tree | ae345e5bba025647f6288e3c3c273be1221a2fab /examples | |
parent | 9a4dd135ac8c1c2aafa622731ff72eeeef418caa (diff) | |
download | mongo-f8251749be64b4cebc4cef3c7b73c025fe9c8c54.tar.gz |
Check for long lines in example code.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c/ex_all.c | 8 | ||||
-rw-r--r-- | examples/c/ex_call_center.c | 3 | ||||
-rw-r--r-- | examples/c/ex_thread.c | 9 |
3 files changed, 13 insertions, 7 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c index e4bbe31cad9..7ece60d2950 100644 --- a/examples/c/ex_all.c +++ b/examples/c/ex_all.c @@ -79,11 +79,13 @@ session_ops(WT_SESSION *session) int ret; WT_CURSOR *cursor; - ret = session->open_cursor(session, "table:mytable", NULL, NULL, &cursor); + ret = session->open_cursor(session, "table:mytable", + NULL, NULL, &cursor); cursor_ops(cursor); - ret = session->create(session, "table:mytable", "key_format=S,value_format=S"); + ret = session->create(session, "table:mytable", + "key_format=S,value_format=S"); ret = session->rename(session, "table:old", "table:new", NULL); @@ -279,7 +281,7 @@ int main(void) const char *home = "WT_TEST"; ret = wiredtiger_open(home, NULL, "create,transactional", &conn); - fprintf(stderr, "Error during operation: %s\n", wiredtiger_strerror(ret)); + fprintf(stderr, "An error occurred: %s\n", wiredtiger_strerror(ret)); } { diff --git a/examples/c/ex_call_center.c b/examples/c/ex_call_center.c index 6091f687e1c..6f57b5a7b4d 100644 --- a/examples/c/ex_call_center.c +++ b/examples/c/ex_call_center.c @@ -25,7 +25,8 @@ const char *home = "WT_TEST"; * CREATE INDEX CustomersPhone ON Customers(phone) * * CREATE TABLE Calls(id INTEGER PRIMARY KEY, call_date DATE, - * cust_id INTEGER, emp_id INTEGER, call_type VARCHAR(12), notes VARCHAR(25)) + * cust_id INTEGER, emp_id INTEGER, call_type VARCHAR(12), + * notes VARCHAR(25)) * CREATE INDEX CallsCustDate ON Calls(cust_id, call_date) * * In this example, both tables will use record numbers for their IDs, which diff --git a/examples/c/ex_thread.c b/examples/c/ex_thread.c index 4438d865084..580184e0a56 100644 --- a/examples/c/ex_thread.c +++ b/examples/c/ex_thread.c @@ -5,7 +5,8 @@ * All rights reserved. * * ex_thread.c - * This is an example demonstrating how to create and access a simple table. + * This is an example demonstrating how to create and access a simple + * table from multiple threads. */ #include <stdio.h> @@ -29,7 +30,8 @@ void *scan_thread(void *arg) int ret; ret = conn->open_session(conn, NULL, NULL, &session); - ret = session->open_cursor(session, "table:access", NULL, NULL, &cursor); + ret = session->open_cursor(session, "table:access", + NULL, NULL, &cursor); /* Show all records. */ while ((ret = cursor->next(cursor)) == 0) { @@ -49,7 +51,8 @@ int main(void) pthread_t threads[NUM_THREADS]; int i, ret; - if ((ret = wiredtiger_open(home, NULL, "create", &conn)) != 0) + if ((ret = wiredtiger_open(home, NULL, + "create,multithread", &conn)) != 0) fprintf(stderr, "Error connecting to %s: %s\n", home, wiredtiger_strerror(ret)); /* Note: further error checking omitted for clarity. */ |