This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 400 for ps


Ignore:
Timestamp:
06/04/04 19:44:56 (21 years ago)
Author:
janwas
Message:

initial code using FAM API. unfinished; one problem remaining is how to convert absolute paths to their VFS equivalent

Location:
ps/trunk/source/lib/res
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/lib/res/res.cpp

    r353 r400  
    22
    33#include "res.h"
     4
     5#ifdef _WIN32
     6#include "sysdep/win/wfam.h"
     7#else
     8#include <fam.h>
     9#endif
     10
    411
    512int res_reload(const char* const fn)
     
    916
    1017
     18static FAMConnection fc;
     19static bool initialized;
    1120
     21
     22int res_watch_dir(const char* const dir)
     23{
     24    if(!initialized)
     25    {
     26        CHECK_ERR(FAMOpen2(&fc, "lib_res"));
     27        atexit2(FAMClose, (uintptr_t)&fc);
     28        initialized = true;
     29    }
     30
     31    //
     32
     33    return 0;
     34}
     35
     36
     37int res_reload_changed_files()
     38{
     39    if(!initialized)
     40        return -1;
     41
     42    FAMEvent e;
     43    while(FAMPending(&fc) > 0)
     44        if(FAMNextEvent(&fc, &e) == 0)
     45        {
     46            const char* sys_fn = e.filename;
     47        }
     48
     49    return 0;
     50}
    1251
    1352
  • ps/trunk/source/lib/res/res.h

    r353 r400  
    44#include "res/mem.h"
    55#include "res/font.h"
    6 #include "res/file.h"
    7 #include "res/zip.h"
     6
    87
    98extern int res_reload(const char* fn);
     9
     10extern int res_watch_dir(const char* dir);
     11
     12extern int res_reload_changed_files();
Note: See TracChangeset for help on using the changeset viewer.