diff options
Diffstat (limited to 'src/logicalfile/file.h')
-rw-r--r-- | src/logicalfile/file.h | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/src/logicalfile/file.h b/src/logicalfile/file.h index d2f573b..a5291ed 100644 --- a/src/logicalfile/file.h +++ b/src/logicalfile/file.h @@ -20,48 +20,27 @@ #ifndef _FILE_H #define _FILE_H -#include <linux/limits.h> #include <sys/stat.h> #include <dirent.h> -#include <stdlib.h> -#include <string.h> -#include <limits.h> #include <libgen.h> -#include <konkret/konkret.h> -#include <assert.h> #include <libudev.h> -#include <errno.h> -#include <unistd.h> +#include <assert.h> #include "LMI_DataFile.h" #include "LMI_UnixDeviceFile.h" #include "LMI_SymbolicLink.h" #include "LMI_UnixDirectory.h" #include "LMI_UnixSocket.h" #include "LMI_FIFOPipeFile.h" -#include "globals.h" - -#ifndef BUFLEN - #define BUFLEN 512 -#endif -#ifndef PATH_MAX - #define PATH_MAX 4096 -#endif +#include "openlmi.h" const ConfigEntry *provider_config_defaults; const char *provider_name; #define FSCREATIONCLASSNAME_LOCAL "LMI_LocalFileSystem" #define FSCREATIONCLASSNAME_TRANSIENT "LMI_TransientFileSystem" -#define GROUP_COMPONENT "GroupComponent" -#define PART_COMPONENT "PartComponent" -#define SAME_ELEMENT "SameElement" -#define SYSTEM_ELEMENT "SystemElement" #define DEVTYPE_BLK 2 #define DEVTYPE_CHR 3 -/* CMPI_RC_ERR_<error> values end at 200. 0xFF should be safe. */ -#define RC_ERR_CLASS_CHECK_FAILED 0xFF - #define sb_permmask(sb) ((sb).st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) #define sb_isreadable(sb) ( \ (sb_permmask(sb) & S_IRUSR) || \ @@ -78,7 +57,6 @@ const char *provider_name; (sb_permmask(sb) & S_IXGRP) || \ (sb_permmask(sb) & S_IXOTH) \ ) -#define stoms(t) ((t)*1000000) #define fill_logicalfile(type, obj, name, fsclassname, fsname, creation_class) \ type##_Set_Name((obj), (name)); \ @@ -96,23 +74,8 @@ const char *provider_name; LMI_##cmpitype##_Set_Writeable(lmi_file, sb_iswriteable(sb)); \ LMI_##cmpitype##_Set_Executable(lmi_file, sb_isexecutable(sb)); \ LMI_##cmpitype##_Set_FileSize(lmi_file, sb.st_size); \ - LMI_##cmpitype##_Set_LastAccessed(lmi_file, CMNewDateTimeFromBinary(b, stoms(sb.st_atime), 0, NULL)); \ - LMI_##cmpitype##_Set_LastModified(lmi_file, CMNewDateTimeFromBinary(b, stoms(sb.st_mtime), 0, NULL)); - -#define check_status(st) \ - if (st.rc != CMPI_RC_OK) { \ - return st; \ - } - -#define check_class_check_status(st) \ - if (st.rc == RC_ERR_CLASS_CHECK_FAILED) { \ - CMReturn(CMPI_RC_OK); \ - } \ - check_status(st); - -#define return_with_status(b, st, code, msg) \ - KSetStatus2(b, st, code, msg); \ - return *(st); + LMI_##cmpitype##_Set_LastAccessed(lmi_file, CMNewDateTimeFromBinary(b, LMI_SECS_TO_MS(sb.st_atime), 0, NULL)); \ + LMI_##cmpitype##_Set_LastModified(lmi_file, CMNewDateTimeFromBinary(b, LMI_SECS_TO_MS(sb.st_mtime), 0, NULL)); typedef struct { union { @@ -125,16 +88,11 @@ typedef struct { } lf; } logicalfile_t; -CMPIStatus lmi_check_required(const CMPIBroker *, const CMPIContext *, const CMPIObjectPath *); void get_class_from_stat(const struct stat *, char *); int get_class_from_path(const char *, char *); CMPIStatus get_fsinfo_from_stat(const CMPIBroker *, const struct stat *, const char *, char **, char **); CMPIStatus get_fsinfo_from_path(const CMPIBroker *, const char *, char **, char **); -const char *get_string_property_from_op(const CMPIObjectPath *, const char *); -const char *get_string_property_from_instance(const CMPIInstance *, const char *); -CMPIStatus check_assoc_class(const CMPIBroker *, const char *, const char *, const char *); CMPIStatus stat_logicalfile_and_fill(const CMPIBroker *, logicalfile_t *, mode_t, const char *); -void _dump_objectpath(const CMPIObjectPath *); #endif /* _FILE_H */ /* vi: set et: */ |