1 /* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #include "surf_private.h"
11 #include "surf/surf_resource.h"
13 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf,
14 "Logging specific to the SURF storage module");
16 surf_model_t surf_storage_model = NULL;
18 static surf_action_t storage_action_open(void *workstation, const char* path, const char* mode)
23 static surf_action_t storage_action_close(void *workstation, surf_file_t fp)
28 static surf_action_t storage_action_read(void *workstation, void* ptr, size_t size, size_t nmemb, surf_file_t stream)
33 static surf_action_t storage_action_write(void *workstation, const void* ptr, size_t size, size_t nmemb, surf_file_t stream)
38 static surf_action_t storage_action_stat(void *workstation, int fd, void* buf)
43 static void surf_storage_model_init_internal(void)
45 surf_storage_model = surf_model_init();
47 surf_storage_model->name = "Storage";
49 surf_storage_model->extension.workstation.open = storage_action_open;
50 surf_storage_model->extension.workstation.close = storage_action_close;
51 surf_storage_model->extension.workstation.read = storage_action_read;
52 surf_storage_model->extension.workstation.write = storage_action_write;
53 surf_storage_model->extension.workstation.stat = storage_action_stat;