2 Data Structure

Currently, rur only manage some basic information of the record file. e.g. some thing like add, modify, visit time of the bookmark element defined in the DBSS(Desktop Bookmarks Storage Specification) doesn't support now. You can add it yourself or ask me to do that if necessary. Without any Graphic User Interface, rur only offer a timestamp sorted C structure list to developer as follow:

    struct _RurItem {
            RurItem *next;

            /* attribute of bookmark element */
            char   *uri;
            int     page_num;

            /* attribute of metadata children elements */
            char   *app_name;
            char   *mime_type;
            time_t  timestamp;
            int     count;

            unsigned int status : 2;
    };
Every member's responsibility of the structure is defined in table 2.

Table 2: member's responsibility
next point to the next RurItem in the RurItem list
uri file location which this RurItem represent for
page_num the file's page number in last time application visited
app_name application's name visited the target pointed by uri
mime_type MIME Type of the target pointed by uri
timestamp seconds from the system's Epoch last time visited the item
count time counter of the application visited this file last time
status statue of current RurItem: OLD, UPDATE, NEW, DELETE


On the other side, this structure could be better understood with a simple practical ~/.recently-used.xbel file offered:

    <?xml version="1.0" encoding="UTF-8"?>
    <xbel version="1.0"
    xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
    xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info">
      <bookmark href="file:///tmp/test-213.pdf" pagenum="1">
        <info>
          <metadata owner="http://freedesktop.org">
            <mime:mime-type type="application/pdf" />
            <bookmark:applications>
              <bookmark:application name="xpdf" count="2"
               timestamp="1144827204" />
            </bookmark:applications>
          </metadata>
        </info>
      </bookmark>
      <bookmark href="file:///tmp/test-212.pdf" pagenum="1">
        <info>
          <metadata owner="http://freedesktop.org">
            <mime:mime-type type="application/pdf" />
            <bookmark:applications>
              <bookmark:application name="xpdf" count="4"
               timestamp="1144827204" />
            </bookmark:applications>
          </metadata>
        </info>
      </bookmark>
    </xbel>

This file could be more complex, it can store many application's history recorder at once, such as gedit, Evince, openoffice.org, and so on. People who use rur must at first offer his application name and the file's mime-type 8 which he played with to rur, with these information, rur can differentiate many application's history record in one file efficiently.



Footnotes

... mime-type8
http://www.freedesktop.org/standards/shared-mime-info
Refer http://rur.sourceforge.net for more information.