Changeset 35

Show
Ignore:
Timestamp:
11/07/07 20:00:21 (10 months ago)
Author:
nlawren2
Message:

Added write functions to the db api

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vowfsc/db.h

    r34 r35  
    2828}; 
    2929 
     30typedef struct stream stream; 
     31struct stream{ 
     32#define db( type, name ) type name; 
     33#define db_string( name ) char *name; 
     34#include "stream.db" 
     35}; 
    3036 
    3137/* Given a file path, db_get_file_id splits it into 
     
    5965 
    6066 
     67/* Permissions and/or other meta data is stored in 
     68 * the file's stream.  These functions work like 
     69 * db_get_file_data 
     70 */ 
     71char *db_get_file_stream( int file_id ); // TODO 
     72char *db_get_file_stream( int file_id, int revision ); // TODO 
     73 
     74 
     75/* Sets the delete flag in the file 
     76 */ 
     77int db_remove_file(int file_id); // TODO 
     78 
     79 
     80/* This creates a blank file for writing.  If the file 
     81 * allready exists, then it removes the delete flag and 
     82 * revisions it.   
     83 */ 
     84int db_create_file(char *file_name, char *file_path, stream data); // TODO 
     85 
     86 
     87/* Branches a file by creating a new file based on a 
     88 * given revision and a file_id.  This is used for  
     89 * moving files to new directories, etc.  If either 
     90 * new_file_name OR new_file_path is NULL, 
     91 * db_branch_file uses the name OR path of the old  
     92 * file.  YOU CANNOT PASS NULL FOR BOTH. 
     93 * 
     94 * db_branch_file returns the file_id of the new 
     95 * file or NULL in the case of a failture. 
     96 */ 
     97int db_branch_file(int file_id, int revision, char *new_file_name, char *new_file_path ); // TODO 
     98 
     99/* For revisioning an existing file, this function 
     100 * modifies the data in an existing file given by  
     101 * file_id 
     102 */ 
     103int db_modify_file_data(int file_id, char *data); // TODO 
     104 
     105 
     106/* For changing the permissions on an existing file 
     107 * modifies the stream in an existing file given by  
     108 * file_id.   
     109 */ 
     110int db_modify_file_stream(int file_id, stream data); // TODO 
    61111 
    62112