annotate dgl/dgl-common.c.patch @ 21:453278a81371

Add tablerecent() so recent.cgi will work as before. Port the tablerecent() function, which reads the most recent games directly from the logfile instead of the database. This allows recent.cgi to show games immediately without waiting for the recorder to put them in the database.
author John "Elwin" Edwards <elwin@sdf.org>
date Mon, 17 Sep 2012 13:41:10 -0700
parents 9945b472aac2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
1 504c504
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
2 < int fd, len, n, is_nhext, pid;
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
3 ---
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
4 > int fd, len, n, is_nhext, is_node, pid;
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
5 538a539
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
6 > is_node = strchr(pdirent->d_name, ':') && !strncmp(strchr(pdirent->d_name, ':'), ":node:", 6);
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
7 550c551
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
8 < if (fd >= 0 && (is_nhext || fcntl (fd, F_SETLK, &fl) == -1))
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
9 ---
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
10 > if (fd >= 0 && (is_nhext || is_node || fcntl (fd, F_SETLK, &fl) == -1))
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
11 567a569,576
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
12 > if (is_node) {
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
13 > replacestr = strchr(replacestr, ':');
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
14 > if (!replacestr) {
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
15 > debug_write("inprogress-filename does not have ':', 1a");
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
16 > graceful_exit(145);
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
17 > }
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
18 > replacestr++;
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
19 > }
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
20 589a599,602
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
21 > if (is_node) {
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
22 > replacestr++;
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
23 > replacestr = strchr(replacestr, ':');
9945b472aac2 Add dgamelaunch configuration to the project.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff changeset
24 > }