2 * Copyright (c) 2017-2018, De Rais <derais@cock.li>
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
31 const char *program_name
= "rb79-update-recent-page";
33 /* Show usage message, do not exit */
36 printf("Usage: %s\n", program_name
);
43 struct configuration conf
= { 0 };
45 setlocale(LC_ALL
, "");
47 conf
= (struct configuration
) {
49 .static_www_folder
= static_www_folder
, /* */
50 .work_path
= work_path
, /* */
51 .trip_salt
= trip_salt
, /* */
52 .trip_salt_len
= strlen(trip_salt
), /* */
53 .boards
= boards
, /* */
54 .boards_num
= NUM_OF(boards
), /* */
55 .max_form_data_size
= max_form_data_size
, /* */
56 .max_file_size
= max_file_size
, /* */
57 .max_text_len
= max_text_len
, /* */
58 .filetypes
= filetypes
, /* */
59 .filetypes_num
= NUM_OF(filetypes
), /* */
60 .file_description_prog
= file_description_prog
, /* */
61 .headers
= headers
, /* */
62 .headers_num
= NUM_OF(headers
), /* */
63 .challenges
= challenges
, /* */
64 .challenges_num
= NUM_OF(challenges
), /* */
65 .wordfilter_inputs
= wordfilter_inputs
, /* */
66 .wordfilter_inputs_num
= NUM_OF(wordfilter_inputs
), /* */
69 /* Set up a minimal part of the system */
70 if (setup_locks(&conf
) < 0) {
74 if (setup_dbs(&conf
) < 0) {
78 if (setup_write_thread(&conf
) < 0) {
82 if (lock_acquire_recent() < 0) {
86 ret
= wt_write_recent_page();
87 lock_release_recent();