예제 #1
0
파일: fskit_fuse.c 프로젝트: jcnelson/fskit
// set up fskit for FUSE
// this is the "easy" method that handles the filesystem initialization for you.
// return 0 on success
// return -ENOMEM on OOM
// return -errno on error
int fskit_fuse_init( struct fskit_fuse_state* state, void* core_state ) {

   int rc = 0;

   // set up library
   rc = fskit_library_init();
   if( rc != 0 ) {
      fskit_error( "fskit_library_init rc = %d\n", rc );
      return rc;
   }

   // set up fskit
   struct fskit_core* core = fskit_core_new();
   if( core == NULL ) {
      return -ENOMEM;
   }

   rc = fskit_core_init( core, core_state );
   if( rc != 0 ) {

      fskit_error( "fskit_core_init rc = %d\n", rc );
      return rc;
   }

   return fskit_fuse_init_fs( state, core );
}
예제 #2
0
파일: common.cpp 프로젝트: jaromil/fskit
// begin a functional test
int fskit_test_begin( struct fskit_core* core, void* test_data ) {

   int rc = 0;

   rc = fskit_library_init();
   if( rc != 0 ) {
      fskit_error("fskit_library_init rc = %d\n", rc );
      return rc;
   }

   rc = fskit_core_init( core, test_data );
   if( rc != 0 ) {
      fskit_error("fskit_core_init rc = %d\n", rc );
   }

   return rc;
}