baseline

yet another open-source distributed versioning control system
Log | Files | Refs

session.h (1354B)


      1 /*
      2  * Copyright (c) 2014 Mohamed Aslan <maslan@sce.carleton.ca>
      3  *
      4  * Permission to use, copy, modify, and distribute this software for any
      5  * purpose with or without fee is hereby granted, provided that the above
      6  * copyright notice and this permission notice appear in all copies.
      7  *
      8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
      9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     15  */
     16 
     17 #ifndef _SESSION_H_
     18 #define _SESSION_H_
     19 
     20 #include <limits.h>
     21 
     22 #include "objdb.h"
     23 #include "dircache.h"
     24 #include "common.h"
     25 
     26 #define	SESSION_NONINIT		(1 << 0)
     27 
     28 
     29 struct session {
     30 	/* operation */
     31 	struct objdb_ops *db_ops;
     32 	struct dircache_ops *dc_ops;
     33 	/* context */
     34 	struct objdb_ctx *db_ctx;
     35 	struct dircache_ctx *dc_ctx;
     36 	/* other */
     37 	const char *repo_rootdir;
     38 	const char *repo_baselinedir;
     39 	const char cwd[PATH_MAX+1];
     40 	const char *branch;
     41 };
     42 
     43 int baseline_session_begin(struct session *, u_int8_t);
     44 int baseline_session_end(struct session *);
     45 
     46 #endif