Back to index

texmacs  1.0.7.15
Typedefs | Functions
tmfs.hpp File Reference
#include "disk_table.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef array< stringstrings
typedef array< stringproperty
typedef array< propertyproperties
typedef hashmap< string, stringsolution
typedef array< solutionsolutions

Functions

bool is_unknown (string s)
bool is_identifier (string s)
collection singleton (string s, int eps=1)
string first (collection s)
collection filter (collection c, bool file_flag)
collection simplify (collection c)
collection invert (collection s)
void merge (collection &s1, collection s2)
collection operator* (collection c1, collection c2)
int total_size (collection s)
collection as_collection (strings a)
strings as_strings (collection ss)
transaction atom (string key, collection val)
void add (transaction &t, string key, string val, int eps)
strings seq (string s1)
strings seq (string s1, string s2)
strings seq (string s1, string s2, string s3)
strings seq (string s1, string s2, string s3, string s4)
property_quote(property p)
property_unquote(property p)
string 
property_append (property p)
property_unappend(string s) string properties_encode (properties ps)
properties properties_decode (string s)
bool matches (property p, property q)
properties reset (properties ps, property p)
substitute(property p, string
what, string by) properties 
substitute (properties ps, string what, string by)
substitute(property p,
solution sol) properties 
substitute (property p, solutions sols)
properties exclude_types (properties ps, collection c)
properties widen (properties ps)
collection as_collection (solutions sols, string key)
collection as_collection (solutions sols, property p)
solutions combine (solutions sols1, solutions sols2)
simplify(property p, solutions
sols) void 
tmfs_write (transaction t)
transaction tmfs_read (collection c)
void tmfs_set (string key, collection val)
void tmfs_set (string key, string val)
void tmfs_reset (string key, collection val)
void tmfs_reset (string key, string val)
collection tmfs_get (string key)
void tmfs_save (string key, string val)
void tmfs_remove (string key)
string tmfs_load (string key)
void tmfs_set_property (property p)
void tmfs_set_properties (properties ps)
void tmfs_reset_property (property p)
void tmfs_reset_properties (properties ps)
solutions tmfs_get_solutions (property p)
string tmfs_create_identifier ()
string tmfs_create_ressource ()
string tmfs_create_version (string ressource)
void tmfs_save_version_file (string version, string contents)
void tmfs_save_version_properties (string version, properties props)
string tmfs_load_version_file (string version)
properties tmfs_load_version_properties (string version)
void tmfs_set_head (string ressource, string version)
void tmfs_reset_head (string ressource)
string tmfs_get_head (string ressource)
collection tmfs_get_versions (string ressource)
void tmfs_save_ressource (string ressource, string contents, properties ps)
string tmfs_load_ressource_file (string ressource)
properties tmfs_load_ressource_properties (string ressource)
string tmfs_create_user (string name)
collection tmfs_search_user (string name)
void tmfs_set_user (string user)
string tmfs_get_user ()
bool tmfs_allows (string id, string type)
bool tmfs_allows (property p, string type)
bool tmfs_allows (solution sol, string type)
strings tmfs_filter (strings ss, string type)
void tmfs_set_attributes (string file, properties ps)
properties tmfs_get_attributes (string file)
void tmfs_add_attributes (string file, properties add_ps)
void tmfs_remove_attributes (string file, properties sub_ps)
void tmfs_change_attributes (string file, properties mod_ps)
solutions tmfs_query (property query)
collection tmfs_query (property query, string unknown)
string tmfs_create_file (string name, string c, string user=tmfs_get_user(), properties xps=properties())
string tmfs_create_similar_file (string name, string contents, string old_id)
collection tmfs_search_file (string name)
void tmfs_save_file (string file, string contents)
string tmfs_load_file (string file)
string tmfs_create_project (string name, string user=tmfs_get_user())
collection tmfs_search_project (string name)
collection tmfs_get_file_projects (string file)
collection tmfs_get_project_files (string project)
void tmfs_branch_file (string old_file, string branch)
string tmfs_create_branch (string p, string name, string u=tmfs_get_user())
void tmfs_import (url prj_dir, url u, string prj)
void tmfs_export (url prj_dir, url u, string prj)
void tmfs_set_root (string prj, url u)
url tmfs_get_root (string prj)
collection tmfs_get_projects (url u)
void tmfs_import (url u)
void tmfs_export (url u)
void tmfs_start_server ()
string tmfs_server_read (int fd)
void tmfs_server_write (int fd, string s)
void tmfs_start_client (string host)
string tmfs_client_read ()
void tmfs_client_write (string s)
void tmfs_secure_mode ()

Typedef Documentation

Definition at line 18 of file tmfs.hpp.

typedef array<string> property

Definition at line 17 of file tmfs.hpp.

Definition at line 19 of file tmfs.hpp.

Definition at line 20 of file tmfs.hpp.

typedef array<string> strings

Definition at line 16 of file tmfs.hpp.


Function Documentation

void add ( transaction t,
string  key,
string  val,
int  eps 
)

Definition at line 26 of file transaction.cpp.

                                                      {
  //cout << "Add " << key << ", " << val << ", " << eps << "\n";
  if (!t->contains (key)) t (key)= collection ();
  t (key) (val)= eps;
}

Here is the caller graph for this function:

Definition at line 108 of file collection.cpp.

                          {
  collection s;
  for (int i=0; i<N(a); i++)
    s(a[i])= 1;
  return s;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 19 of file solutions.cpp.

                                           {
  collection c;
  for (int i=0; i<N(sols); i++)
    if (sols[i]->contains (key))
      c (sols[i][key])= 1;
  return c;
}

Here is the call graph for this function:

Definition at line 28 of file solutions.cpp.

                                           {
  int i, n= N(p);
  for (i=0; i<n; i++)
    if (is_unknown (p[i])) return as_collection (sols, p[i]);
  return collection ();
}

Here is the call graph for this function:

Definition at line 116 of file collection.cpp.

                          {
  strings a;
  iterator<string> it= iterate (c);
  while (it->busy ()) {
    string s= it->next ();
    if (c[s] > 0) a << s;
  }
  return a;
}

Here is the call graph for this function:

Here is the caller graph for this function:

transaction atom ( string  key,
collection  val 
)

Definition at line 19 of file transaction.cpp.

                                  {
  transaction t;
  t(key)= val;
  return t;
}

Here is the caller graph for this function:

solutions combine ( solutions  sols1,
solutions  sols2 
)

Definition at line 40 of file solutions.cpp.

                                           {
  solutions sols;
  int i1, i2, n1= N(sols1), n2= N(sols2);
  for (i1=0; i1<n1; i1++)
    for (i2=0; i2<n2; i2++) {
      bool ok= true;
      solution sol= copy (sols1[i1]);
      iterator<string> it= iterate (sols2[i2]);
      while (it->busy ()) {
       string s= it->next ();
       if (sol->contains (s)) {
         ok= (sol[s] == sols2[i2][s]);
         if (!ok) break;
       }
       else sol(s)= sols2[i2][s];
      }
      if (ok) sols << sol;
    }
  return sols;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 187 of file properties.cpp.

                                            {
  properties r;
  for (int i=0; i<N(ps); i++)
    if (N(ps[i])>0 && !c->contains (ps[i][0]))
      r << ps[i];
  return r;
}

Here is the call graph for this function:

collection filter ( collection  c,
bool  file_flag 
)

Definition at line 41 of file collection.cpp.

                                      {
  collection r;
  iterator<string> it= iterate (c);
  while (it->busy ()) {
    string s= it->next ();
    int eps= c[s];
    if ((eps > -3 && eps < 3) ^ file_flag) r(s)= eps;
  }
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 35 of file collection.cpp.

                     {
  iterator<string> it= iterate (c);
  return it->next ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 65 of file collection.cpp.

                      {
  collection r;
  iterator<string> it= iterate (c);
  while (it->busy ()) {
    string s= it->next ();
    r(s)= -c[s];
  }
  return r;
}

Here is the call graph for this function:

bool is_identifier ( string  s) [inline]

Definition at line 23 of file tmfs.hpp.

{ return N(s)>1 && s[0] == '+'; }

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_unknown ( string  s) [inline]

Definition at line 22 of file tmfs.hpp.

{ return N(s)>1 && s[0] == '?'; }

Here is the call graph for this function:

Here is the caller graph for this function:

bool matches ( property  p,
property  q 
)

Definition at line 117 of file properties.cpp.

                                 {
  if (N(p) != N(q)) return false;
  solution sol;
  for (int i=0; i<N(p); i++)
    if (is_unknown (q[i])) {
      if (!sol->contains (q[i])) sol(q[i])= p[i];
      else if (sol[q[i]] != p[i]) return false;
    }
    else if (q[i] != p[i]) return false;
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void merge ( collection s1,
collection  s2 
)

Definition at line 76 of file collection.cpp.

                                      {
  //cout << "Merge " << c1 << ", " << c2 << "\n";
  iterator<string> it= iterate (c2);
  while (it->busy ()) {
    string s= it->next ();
    int eps= c2[s];
    if (eps < -1 || eps > 1) c1= collection ();
    c1(s)= c2[s];
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

collection operator* ( collection  c1,
collection  c2 
)

Definition at line 88 of file collection.cpp.

                                          {
  collection r;
  merge (r, c1);
  merge (r, c2);
  return r;
}

Here is the call graph for this function:

Definition at line 102 of file properties.cpp.

                             {
  properties ps;
  for (int i=0; i<N(s); i++) {
    int start= i;
    while (i<N(s) && s[i] != '\n') i++;
    ps << property_unquote (property_unappend (s (start, i)));
  }
  return ps;
}

Here is the call graph for this function:

Here is the caller graph for this function:

property_unappend( string s) string properties_encode ( properties  ps)

Definition at line 94 of file properties.cpp.

                                  {
  string r;
  for (int i=0; i<N(ps); i++)
    r << property_append (property_quote (ps[i])) << '\n';
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

property_quote( property p) property_unquote( property p) string property_append ( property  p)

Definition at line 71 of file properties.cpp.

                             {
  if (N(p) == 0) return "";
  string r= copy (p[0]);
  for (int i=1; i<N(p); i++) r << ',' << p[i];
  return r;
}

Definition at line 130 of file properties.cpp.

                                  {
  properties r;
  for (int i=0; i<N(ps); i++)
    if (!matches (ps[i], p))
      r << ps[i];
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

strings seq ( string  s1)

Definition at line 19 of file properties.cpp.

                {
  strings a; a << s1; return a;
}

Here is the caller graph for this function:

strings seq ( string  s1,
string  s2 
)

Definition at line 24 of file properties.cpp.

                           {
  strings a; a << s1 << s2; return a;
}
strings seq ( string  s1,
string  s2,
string  s3 
)

Definition at line 29 of file properties.cpp.

                                      {
  strings a; a << s1 << s2 << s3; return a;
}
strings seq ( string  s1,
string  s2,
string  s3,
string  s4 
)

Definition at line 34 of file properties.cpp.

                                                 {
  strings a; a << s1 << s2 << s3 << s4; return a;
}

Definition at line 53 of file collection.cpp.

                        {
  collection r;
  iterator<string> it= iterate (c);
  while (it->busy ()) {
    string s= it->next ();
    int eps= c[s];
    if (eps > 0) r(s)= eps;
  }
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

collection singleton ( string  s,
int  eps = 1 
)

Definition at line 28 of file collection.cpp.

                              {
  collection c;
  c (s)= eps;
  return c;
}
substitute( property p, string what, string by) properties substitute ( properties  ps,
string  what,
string  by 
)

Definition at line 158 of file properties.cpp.

                                                   {
  properties qs;
  for (int i=0; i<N(ps); i++)
    qs << substitute (ps[i], what, by);
  return qs;
}

Here is the call graph for this function:

Definition at line 175 of file properties.cpp.

                                        {
  properties r;
  for (int i=0; i<N(sols); i++)
    r << substitute (p, sols[i]);
  return r;
}

Here is the call graph for this function:

void tmfs_add_attributes ( string  file,
properties  add_ps 
)

Definition at line 180 of file tmfs_permissions.cpp.

                                                          {
  properties ps= tmfs_get_attributes (ressource);
  ps= reset (ps, add_ps);
  ps << add_ps;
  tmfs_set_attributes (ressource, ps);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmfs_allows ( string  id,
string  type 
)

Definition at line 112 of file tmfs_permissions.cpp.

                                     {
  return tmfs_allows (id, type, tmfs_user);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmfs_allows ( property  p,
string  type 
)

Definition at line 117 of file tmfs_permissions.cpp.

                                      {
  for (int i=0; i<N(p); i++)
    if (is_identifier (p[i]) && !tmfs_allows (p[i], type))
      return false;
  return true;
}

Here is the call graph for this function:

bool tmfs_allows ( solution  sol,
string  type 
)

Definition at line 125 of file tmfs_permissions.cpp.

                                        {
  iterator<string> it= iterate (sol);
  while (it->busy ()) {
    string s= sol[it->next ()];
    if (is_identifier (s) && !tmfs_allows (s, type))
      return false;
  }
  return true;
}

Here is the call graph for this function:

void tmfs_branch_file ( string  old_file,
string  branch 
)

Definition at line 104 of file tmfs_file.cpp.

                                                  {
  string contents= tmfs_load_file (old_file);
  properties ps  = tmfs_get_attributes (old_file);
  string new_file= tmfs_create_ressource ();
  ps= substitute (ps, old_file, new_file);
  properties mp;
  mp << seq ("owner", old_file, "?user")
     << seq ("in", old_file, "?user")
     << seq ("read", old_file, "?user")
     << seq ("write", old_file, "?user");
  ps= reset (ps, mp);
  ps << seq ("owner", new_file, branch)
     << seq ("in", new_file, branch)
     << seq ("read", new_file, branch)
     << seq ("write", new_file, branch);
  tmfs_save_ressource (new_file, contents, ps);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_change_attributes ( string  file,
properties  mod_ps 
)

Definition at line 195 of file tmfs_permissions.cpp.

                                                             {
  properties ps= tmfs_get_attributes (ressource);
  ps= reset (ps, widen (mod_ps));
  ps << mod_ps;
  tmfs_set_attributes (ressource, ps);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 123 of file tmfs_file.cpp.

                                                              {
  collection c= tmfs_query (seq ("name", project, "?name"), "?name");
  if (N(c) == 0) return "";
  string full_name= first (c) * " - " * name;
  string branch= tmfs_create_project (full_name, user);
  strings files= as_strings (tmfs_get_project_files (project));
  for (int i=0; i<N(files); i++)
    tmfs_branch_file (files[i], branch);
  return branch;
}

Here is the call graph for this function:

Here is the caller graph for this function:

string tmfs_create_file ( string  name,
string  c,
string  user = tmfs_get_user(),
properties  xps = properties() 
)

Definition at line 19 of file tmfs_file.cpp.

                                                                             {
  string master= tmfs_create_identifier ();
  string file  = tmfs_create_ressource ();
  properties ps;
  ps << seq ("file", file)
     << seq ("name", file, name)
     << seq ("master", file, master)
     << seq ("owner", file, user)
     << seq ("in", file, user)
     << seq ("read", file, user)
     << seq ("write", file, user)
     << substitute (xps, "self", file);
  tmfs_save_ressource (file, contents, ps);
  return file;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 20 of file tmfs_versioning.cpp.

                          {
  return as_string (call ("create-unique-id"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 65 of file tmfs_file.cpp.

                                               {
  string project= tmfs_create_ressource ();
  string home= tmfs_create_file (name * " - home", "", project);
  properties ps;
  ps << seq ("project", project)
     << seq ("name", project, name)
     << seq ("owner", project, user)
     << seq ("in", project, user)
     << seq ("read", project, user)
     << seq ("write", project, user)
     << seq ("home", project, home);
  tmfs_save_ressource (project, "", ps);
  return project;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 25 of file tmfs_versioning.cpp.

                         {
  return tmfs_create_identifier ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

string tmfs_create_similar_file ( string  name,
string  contents,
string  old_id 
)

Definition at line 26 of file tmfs_permissions.cpp.

                               {
  if (N (tmfs_search_user (name)) != 0) return "";
  string user= tmfs_create_ressource ();
  string home= tmfs_create_file (name * " - home", "", user);
  properties ps;
  ps << seq ("user", user)
     << seq ("name", user, name)
     << seq ("owner", user, user)
     << seq ("in", user, user)
     << seq ("read", user, user)
     << seq ("write", user, user)
     << seq ("home", user, home);
  tmfs_save_ressource (user, "", ps);
  return user;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 30 of file tmfs_versioning.cpp.

                                       {
  string id  = tmfs_create_identifier ();
  string head= tmfs_get_head (ressource);
  tmfs_set_property (seq ("version", id, ressource));
  if (head != "") tmfs_set_property (seq ("next", head, id));
  return id;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_export ( url  prj_dir,
url  u,
string  prj 
)

Definition at line 85 of file tmfs_convert.cpp.

                                             {
  properties ps= tmfs_list_heads_inside (u, prj);
  for (int i=0; i<N(ps); i++) {
    url    v = ps[i][0];
    string file= ps[i][1];
    cout << "Process " << (prj_dir * v) << "\n";
    if (!exists (prj_dir * v)) {
      string val= tmfs_load_file (file);
      create_parents (prj_dir * v);
      save_string (prj_dir * v, val);
      cout << "Export " << file << " -> " << (prj_dir * v) << "\n";
    }
    else {
      string val1= load_string (prj_dir * v);
      string val2= tmfs_load_file (file);
      if (val2 != val1) {
       save_string (prj_dir * v, val2);
       cout << "Update " << file << " -> " << (prj_dir * v) << "\n";
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_export ( url  u)

Definition at line 200 of file tmfs_convert.cpp.

                    {
  strings prjs= as_strings (tmfs_get_projects (u));
  if (N(prjs) == 0)
    cerr << "TeXmacs] error: no project for " << u << "\n";
  else if (N(prjs) > 1)
    cerr << "TeXmacs] error: too many projects for " << u << "\n";
  else {
    url prj_dir= tmfs_get_root (prjs[0]);
    tmfs_export (prj_dir, delta_dir (prj_dir, u), prjs[0]);
  }
}

Here is the call graph for this function:

solutions tmfs_filter ( strings  ss,
string  type 
)

Definition at line 145 of file tmfs_permissions.cpp.

                                         {
  properties qs;
  for (int i=0; i<N(ps); i++)
    if (tmfs_allows (ps[i], type))
      qs << ps[i];
  return qs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 63 of file tmfs_table.cpp.

                      {
  transaction t= tmfs_read (singleton (key));
  return simplify (t[key]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 173 of file tmfs_permissions.cpp.

                                       {
  if (tmfs_allows (ressource, "read"))
    return tmfs_load_ressource_properties (ressource);
  return properties ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 87 of file tmfs_file.cpp.

                                     {
  return tmfs_query (seq ("in", file, "?project"), "?project");
}

Here is the call graph for this function:

Here is the caller graph for this function:

string tmfs_get_head ( string  ressource)

Definition at line 80 of file tmfs_versioning.cpp.

                                 {
  solutions sols= tmfs_get_solutions (seq ("head", ressource, "?v"));
  collection c= as_collection (sols, "?v");
  if (N(c) == 0) return "";
  return first (c);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 92 of file tmfs_file.cpp.

                                        {
  properties ps; ps << seq ("in", "?file", project) << seq ("file", "?file");
  collection files= tmfs_query (ps, "?file");
  collection homes= tmfs_query (seq ("home", project, "?home"), "?home");
  return files * invert (homes);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 175 of file tmfs_convert.cpp.

                          {
  collection c= tmfs_query (seq ("root", "?prj", as_string (u)), "?prj");
  if (N(c) != 0 || is_root (u)) return c;
  return tmfs_get_projects (url_parent (u));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 168 of file tmfs_convert.cpp.

                           {
  collection c= tmfs_query (seq ("root", prj, "?url"), "?url");
  if (N(c) != 1) return url_none ();
  return url (first (c));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 107 of file tmfs_properties.cpp.

                                    {
  // cout << "  Query: " << query << "\n";
  property p;
  property v;
  property_wildcards (query, p, v);
  collection c= tmfs_get (property_append (p));
  return decode_solutions (c, v);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 54 of file tmfs_permissions.cpp.

                 {
  return tmfs_user;
}

Here is the caller graph for this function:

Definition at line 88 of file tmfs_versioning.cpp.

                                     {
  solutions sols= tmfs_get_solutions (seq ("version", "?v", ressource));
  return as_collection (sols, "?v");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_import ( url  prj_dir,
url  u,
string  prj 
)

Definition at line 109 of file tmfs_convert.cpp.

                                             {
  cout << "Process " << (prj_dir * u) << "\n";
  if (is_or (u)) {
    tmfs_import (prj_dir, u[1], prj);
    tmfs_import (prj_dir, u[2], prj);
  }
  else if (is_directory (prj_dir * u)) {
    bool flag;
    array<string> a= read_directory (prj_dir * u, flag);
    if (flag) return;
    for (int i=0; i<N(a); i++)
      if (!is_cruft (a[i]) && a[i] != "." && a[i] != "..")
       tmfs_import (prj_dir, u * a[i], prj);
  }
  else if (is_regular (prj_dir * u)) {
    string loc= as_string (u);
    properties ps;
    ps << seq ("mirror", "?file", prj, loc) << seq ("in", "?file", prj);
    collection files= tmfs_query (ps, "?file");
    if (N (files) == 0) {
      properties xps; xps << seq ("mirror", "self", prj, loc);
      string val = load_string (prj_dir * u);
      string name= create_name (as_string (tail (u)), val);
      string file= tmfs_create_file (name, val, prj, xps);
      cout << "Import " << u << " -> " << file << "\n";
    }
    else {
      string file= first (files);
      string val1= tmfs_load_file (file);
      string val2= load_string (prj_dir * u);
      if (val1 == val2) return;
      tmfs_save_file (file, val2);
      cout << "Update " << u << " -> " << file << "\n";
    }
  }

  properties ps= tmfs_list_heads_inside (u, prj);
  for (int i=0; i<N(ps); i++) {
    url    v = ps[i][0];
    string file= ps[i][1];
    if (!exists (prj_dir * v)) {
      tmfs_reset_head (file);
      cout << "Remove " << v << " -> " << file << "\n";
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_import ( url  u)

Definition at line 187 of file tmfs_convert.cpp.

                    {
  strings prjs= as_strings (tmfs_get_projects (u));
  if (N(prjs) == 0)
    cerr << "TeXmacs] error: no project for " << u << "\n";
  else if (N(prjs) > 1)
    cerr << "TeXmacs] error: too many projects for " << u << "\n";
  else {
    url prj_dir= tmfs_get_root (prjs[0]);
    tmfs_import (prj_dir, delta_dir (prj_dir, u), prjs[0]);
  }
}

Here is the call graph for this function:

Definition at line 83 of file tmfs_table.cpp.

                       {
  transaction t= tmfs_read (singleton (key, 3));
  collection  c= simplify (t[key]);
  if (N(c) != 1) return "";
  return first (c);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 54 of file tmfs_file.cpp.

                             {
  if (tmfs_allows (file, "read"))
    return tmfs_load_ressource_file (file);
  return "";
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 102 of file tmfs_versioning.cpp.

                                            {
  string version= tmfs_get_head (ressource);
  if (version == "") return "";
  return tmfs_load_version_file (version);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 109 of file tmfs_versioning.cpp.

                                                  {
  string version= tmfs_get_head (ressource);
  if (version == "") return properties ();
  return tmfs_load_version_properties (version);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 49 of file tmfs_versioning.cpp.

                                        {
  return tmfs_load (version);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 54 of file tmfs_versioning.cpp.

                                              {
  return properties_decode (tmfs_load (version * "!"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 207 of file tmfs_permissions.cpp.

                            {
  if (!tmfs_allows (query, "read")) return solutions ();
  solutions sols= tmfs_get_solutions (query);
  return tmfs_filter (sols, "read");
}

Here is the call graph for this function:

Here is the caller graph for this function:

collection tmfs_query ( property  query,
string  unknown 
)

Definition at line 214 of file tmfs_permissions.cpp.

                                            {
  return as_collection (tmfs_query (query), unknown);
}

Here is the call graph for this function:

Definition at line 33 of file tmfs_table.cpp.

                         {
  tmfs_initialize ();
  return tmfs->read (c);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_remove ( string  key)

Definition at line 78 of file tmfs_table.cpp.

                         {
  tmfs_write (atom (key, singleton ("*", -3)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_remove_attributes ( string  file,
properties  sub_ps 
)

Definition at line 188 of file tmfs_permissions.cpp.

                                                             {
  properties ps= tmfs_get_attributes (ressource);
  ps= reset (ps, sub_ps);
  tmfs_set_attributes (ressource, ps);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_reset ( string  key,
collection  val 
)

Definition at line 53 of file tmfs_table.cpp.

                                        {
  tmfs_write (atom (key, invert (val)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_reset ( string  key,
string  val 
)

Definition at line 58 of file tmfs_table.cpp.

                                    {
  tmfs_write (atom (key, singleton (val, -1)));
}

Here is the call graph for this function:

void tmfs_reset_head ( string  ressource)

Definition at line 75 of file tmfs_versioning.cpp.

                                   {
  tmfs_set_head (ressource, "");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 69 of file tmfs_properties.cpp.

                                      {
  for (int i=0; i<N(ps); i++)
    tmfs_reset_property (ps[i]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 57 of file tmfs_properties.cpp.

                                 {
  for (int i=0; i<N(p); i++)
    if (is_unknown (p[i])) {
      properties ps= substitute (p, tmfs_get_solutions (p));
      for (int j=0; j<N(ps); j++)
       tmfs_write (as_transaction (ps[j], -1));
      return;
    }
  tmfs_write (as_transaction (p, -1));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_save ( string  key,
string  val 
)

Definition at line 73 of file tmfs_table.cpp.

                                   {
  tmfs_write (atom (key, singleton (val, 3)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_save_file ( string  file,
string  contents 
)

Definition at line 48 of file tmfs_file.cpp.

                                          {
  if (tmfs_allows (file, "write"))
    tmfs_save_ressource (file, cont, tmfs_load_ressource_properties (file));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_save_ressource ( string  ressource,
string  contents,
properties  ps 
)

Definition at line 94 of file tmfs_versioning.cpp.

                                                                       {
  string version= tmfs_create_version (ressource);
  tmfs_save_version_file (version, contents);
  tmfs_save_version_properties (version, ps);
  tmfs_set_head (ressource, version);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_save_version_file ( string  version,
string  contents 
)

Definition at line 39 of file tmfs_versioning.cpp.

                                                         {
  if (contents != "") tmfs_save (version, contents);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_save_version_properties ( string  version,
properties  props 
)

Definition at line 44 of file tmfs_versioning.cpp.

                                                                {
  tmfs_save (version * "!", properties_encode (props));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 36 of file tmfs_file.cpp.

                               {
  properties ps; ps << seq ("name", "?file", name) << seq ("file", "?file");
  return tmfs_query (ps, "?file");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 81 of file tmfs_file.cpp.

                                  {
  properties ps; ps << seq ("name", "?p", name) << seq ("project", "?p");
  return tmfs_query (ps, "?p");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 43 of file tmfs_permissions.cpp.

                               {
  properties ps; ps << seq ("name", "?user", name) << seq ("user", "?user");
  return as_collection (tmfs_get_solutions (ps), "?user");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_secure_mode ( )
string tmfs_server_read ( int  fd)
void tmfs_server_write ( int  fd,
string  s 
)
void tmfs_set ( string  key,
collection  val 
)

Definition at line 43 of file tmfs_table.cpp.

                                      {
  tmfs_write (atom (key, val));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_set ( string  key,
string  val 
)

Definition at line 48 of file tmfs_table.cpp.

                                  {
  tmfs_write (atom (key, singleton (val, 1)));
}

Here is the call graph for this function:

void tmfs_set_attributes ( string  file,
properties  ps 
)

Definition at line 167 of file tmfs_permissions.cpp.

                                                      {
  if (tmfs_allows (ressource, "owner"))
    tmfs_save_ressource (ressource, tmfs_load_ressource_file (ressource), ps);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_set_head ( string  ressource,
string  version 
)

Definition at line 59 of file tmfs_versioning.cpp.

                                                 {
  string head= tmfs_get_head (ressource);
  if (ressource == head) return;
  if (head != "") {
    tmfs_reset_property (seq ("head", ressource, head));
    properties props= tmfs_load_version_properties (head);
    tmfs_reset_properties (props);
  }
  if (version != "") {
    tmfs_set_property (seq ("head", ressource, version));
    properties props= tmfs_load_version_properties (version);
    tmfs_set_properties (props);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 51 of file tmfs_properties.cpp.

                                    {
  for (int i=0; i<N(ps); i++)
    tmfs_set_property (ps[i]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 46 of file tmfs_properties.cpp.

                               {
  tmfs_write (as_transaction (p, 1));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_set_root ( string  prj,
url  u 
)

Definition at line 161 of file tmfs_convert.cpp.

                                  {
  properties ps;
  if (!is_none (u)) ps << seq ("root", prj, as_string (u));
  tmfs_change_attributes (prj, ps);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tmfs_set_user ( string  user)

Definition at line 49 of file tmfs_permissions.cpp.

                            {
  tmfs_user= user;
}

Here is the caller graph for this function:

void tmfs_start_client ( string  host)

Definition at line 27 of file tmfs_table.cpp.

                           {
  tmfs_initialize ();
  tmfs->write (t);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int total_size ( collection  s)

Definition at line 96 of file collection.cpp.

                          {
  int sz= 1;
  iterator<string> it= iterate (c);
  while (it->busy ()) sz += (N (it->next ()) + 1);
  return sz;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 196 of file properties.cpp.

                      {
  properties r;
  for (int i=0; i<N(ps); i++) {
    property c= copy (ps[i]);
    if (N(c) > 0) c[N(c)-1]= "?any";
    r << c;
  }
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function: