3.2 Manage

When you have already initialed rur, you may get a RurItem list which should contain useful information for your application. For example, you may use the uri member of the list's item to let user select and open them again and jump to the page number last time visited. This subsection is concentrate on the management of the RurItem list. You can do the following operate on the RurItem list currently:
  1. Add new item
        int rur_opened_file(const char *opend_name, RurItem **list);
    
    Once user opened a [new] file in your application, you can tell rur to manage the opened file's record use the function rur_opened_file(). The opened_name parameter will be stored as the uri member of the new item, the list parameter is the pointer point to the list pointer which is returned on subsection 3.1. The return value of this function described as following:

  2. Remove old item
        int rur_delete_file(RurItem *list, const char *uri);
    
    Once user closed a file or activated the remove one file's history record function you offered, you can call this function to tell rur do not manage the item no longer which the uri is equal to you offered. This function's return value also worth to be check: Currently, to remove more than one file's records from file ~/.recently-used.xbel(for example: you want to remove all the history record you have made), you must call this function one-by-one. If necessary, you can improve this function to do such things more wiseness.

  3. Change one item's page number
        int rur_save_pagenum(RurItem *list, const char *uri, int pagenum);
    
    If you call this function, it mostly like that your user have select another file to use. So, you want to save the file's page number your user used just now. Or, user want to quit from your application, you need to save current file's page number for next time you visit it.

    The pagenum parameter interpreted by rur as following:

    This function's return value is as the same as remove item function, 0 represent save page number successful.

Refer http://rur.sourceforge.net for more information.