From 343670eb2dfcc7984aea856da155a3520b026f29 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 1 Jul 2008 21:23:29 +0200 Subject: rename libatasmart.vapi to atasmart.vapi to follow the header name --- Makefile | 2 +- atasmart.vapi | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ libatasmart.vapi | 140 ------------------------------------------------------- 3 files changed, 141 insertions(+), 141 deletions(-) create mode 100644 atasmart.vapi delete mode 100644 libatasmart.vapi diff --git a/Makefile b/Makefile index d350dec..d75b16c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ all: smartkitd gnome-disk-health gnome-disk-health.ui smartkitd: smartkitd.vala - valac --save-temps -g -o $@ --vapidir=. --pkg=libatasmart --pkg=hal --pkg=dbus-glib-1 --Xcc="$(shell pkg-config --cflags --libs libatasmart)" $^ + valac --save-temps -g -o $@ --vapidir=. --pkg=atasmart --pkg=hal --pkg=dbus-glib-1 --Xcc="$(shell pkg-config --cflags --libs libatasmart)" $^ gnome-disk-health: gnome-disk-health.vala valac --save-temps -g -o $@ --pkg=gtk+-2.0 --pkg=dbus-glib-1 $^ diff --git a/atasmart.vapi b/atasmart.vapi new file mode 100644 index 0000000..3acb02d --- /dev/null +++ b/atasmart.vapi @@ -0,0 +1,140 @@ +/*-*- Mode: C; c-basic-offset: 8 -*-*/ + +/*** + This file is part of SmartKit. + + Copyright 2008 Lennart Poettering + + SmartKit is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 2.1 of the + License, or (at your option) any later version. + + SmartKit is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with SmartKit. If not, If not, see + . +***/ + +using GLib; + +[CCode (cheader_filename="atasmart.h")] +namespace Smart { + + [CCode (cname="SkSmartSelfTest", cprefix="SK_SMART_SELF_TEST_")] + public enum SmartSelfTest { + SHORT, EXTENDED, CONVEYANCE, ABORT + } + + [Immutable] + [CCode (cname="SkIdentifyParsedData")] + public struct IdentifyParsedData { + public string serial; + public string firmware; + public string model; + } + + [CCode (cname="SkSmartOfflineDataCollectionStatus", cprefix="SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_")] + public enum SmartOfflineDataCollectionStatus { + NEVER, SUCCESS, INPROGRESS, SUSPENDED, ABORTED, FATAL, UNKNOWN + } + + [CCode (cname="sk_smart_offline_data_collection_status_to_string")] + public weak string smart_offline_data_collection_status_to_string(SmartOfflineDataCollectionStatus status); + + + [CCode (cname="SkSmartSelfTestExecutionStatus", cprefix="SK_SMART_SELF_TEST_EXECUTION_STATUS_")] + public enum SmartSelfTestExecutionStatus { + SUCCESS_OR_NEVER, ABORTED, INTERRUPTED, FATAL, ERROR_UNKNOWN, ERROR_ELECTRICAL, ERROR_SERVO, ERROR_READ, ERROR_HANDLING, INPROGRESS + } + + [CCode (cname="sk_smart_self_test_execution_status_to_string")] + public weak string smart_self_test_execution_status_to_string(SmartSelfTestExecutionStatus status); + + [Immutable] + [CCode (cname="SkSmartParsedData")] + public struct SmartParsedData { + public SmartOfflineDataCollectionStatus offline_data_collection_status; + public uint total_offline_data_collection_seconds; + public SmartSelfTestExecutionStatus self_test_execution_status; + public uint self_test_execution_percent_remaining; + + public bool conveyance_test_available; + public bool short_and_extended_test_available; + public bool start_test_available; + public bool abort_test_available; + + public uint short_test_polling_minutes; + public uint extended_test_polling_minutes; + public uint conveyance_test_polling_minutes; + + [CCode (cname="sk_smart_self_test_available")] + public bool self_test_available(SmartSelfTest test); + + [CCode (cname="sk_smart_self_test_polling_minutes")] + public uint self_test_polling_minutes(SmartSelfTest test); + } + + [CCode (cname="SkSmartAttributeUnit", cprefix="SK_SMART_ATTRIBUTE_UNIT_")] + public enum SmartAttributeUnit { + UNKNOWN, NONE, MSECONDS, SECTORS, MKELVIN + } + + [CCode (cname="sk_smart_attribute_unit_to_string")] + public weak string smart_attribute_unit_to_string(SmartAttributeUnit unit); + + [Immutable] + [CCode (cname="SkSmartAttributeParsedData")] + public struct SmartAttributeParsedData { + public uint8 id; + public string name; + public SmartAttributeUnit pretty_unit; + public uint16 flags; + public uint8 threshold; + public bool threshold_valid; + public bool online; + public bool prefailure; + public bool good; + public uint8 current_value; + public uint8 worst_value; + public uint64 pretty_value; + public uint8[6] raw; + } + + [CCode (cname="SkSmartAttributeParseCallback")] + public delegate void SmartAttributeParseCallback(void* disk, SmartAttributeParsedData a); + + [Compact] + [CCode (free_function="sk_disk_free", cname="SkDisk", cprefix="sk_disk_")] + public class Disk { + + public static int open(string name, out Disk disk); + + public int get_size(out uint64 bytes); + + public int check_sleep_mode(out bool awake); + + public int identify_is_available(out bool available); + public int identify_parse(out weak IdentifyParsedData* data); + + public int smart_is_available(out bool available); + public int smart_status(out bool good); + public int smart_read_data(); + public int smart_parse_attributes(SmartAttributeParseCallback cb); + public int smart_parse(out weak SmartParsedData* data); + public int smart_self_test(SmartSelfTest test); + + public int dump(); + } + + /* These two should move to an official vala package */ + [CCode (cname="errno", cheader_filename="errno.h")] + public int errno; + + [CCode (cname="g_strerror", cheader_filename="glib.h")] + public weak string strerror(int err); +} diff --git a/libatasmart.vapi b/libatasmart.vapi deleted file mode 100644 index 3acb02d..0000000 --- a/libatasmart.vapi +++ /dev/null @@ -1,140 +0,0 @@ -/*-*- Mode: C; c-basic-offset: 8 -*-*/ - -/*** - This file is part of SmartKit. - - Copyright 2008 Lennart Poettering - - SmartKit is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 2.1 of the - License, or (at your option) any later version. - - SmartKit is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with SmartKit. If not, If not, see - . -***/ - -using GLib; - -[CCode (cheader_filename="atasmart.h")] -namespace Smart { - - [CCode (cname="SkSmartSelfTest", cprefix="SK_SMART_SELF_TEST_")] - public enum SmartSelfTest { - SHORT, EXTENDED, CONVEYANCE, ABORT - } - - [Immutable] - [CCode (cname="SkIdentifyParsedData")] - public struct IdentifyParsedData { - public string serial; - public string firmware; - public string model; - } - - [CCode (cname="SkSmartOfflineDataCollectionStatus", cprefix="SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_")] - public enum SmartOfflineDataCollectionStatus { - NEVER, SUCCESS, INPROGRESS, SUSPENDED, ABORTED, FATAL, UNKNOWN - } - - [CCode (cname="sk_smart_offline_data_collection_status_to_string")] - public weak string smart_offline_data_collection_status_to_string(SmartOfflineDataCollectionStatus status); - - - [CCode (cname="SkSmartSelfTestExecutionStatus", cprefix="SK_SMART_SELF_TEST_EXECUTION_STATUS_")] - public enum SmartSelfTestExecutionStatus { - SUCCESS_OR_NEVER, ABORTED, INTERRUPTED, FATAL, ERROR_UNKNOWN, ERROR_ELECTRICAL, ERROR_SERVO, ERROR_READ, ERROR_HANDLING, INPROGRESS - } - - [CCode (cname="sk_smart_self_test_execution_status_to_string")] - public weak string smart_self_test_execution_status_to_string(SmartSelfTestExecutionStatus status); - - [Immutable] - [CCode (cname="SkSmartParsedData")] - public struct SmartParsedData { - public SmartOfflineDataCollectionStatus offline_data_collection_status; - public uint total_offline_data_collection_seconds; - public SmartSelfTestExecutionStatus self_test_execution_status; - public uint self_test_execution_percent_remaining; - - public bool conveyance_test_available; - public bool short_and_extended_test_available; - public bool start_test_available; - public bool abort_test_available; - - public uint short_test_polling_minutes; - public uint extended_test_polling_minutes; - public uint conveyance_test_polling_minutes; - - [CCode (cname="sk_smart_self_test_available")] - public bool self_test_available(SmartSelfTest test); - - [CCode (cname="sk_smart_self_test_polling_minutes")] - public uint self_test_polling_minutes(SmartSelfTest test); - } - - [CCode (cname="SkSmartAttributeUnit", cprefix="SK_SMART_ATTRIBUTE_UNIT_")] - public enum SmartAttributeUnit { - UNKNOWN, NONE, MSECONDS, SECTORS, MKELVIN - } - - [CCode (cname="sk_smart_attribute_unit_to_string")] - public weak string smart_attribute_unit_to_string(SmartAttributeUnit unit); - - [Immutable] - [CCode (cname="SkSmartAttributeParsedData")] - public struct SmartAttributeParsedData { - public uint8 id; - public string name; - public SmartAttributeUnit pretty_unit; - public uint16 flags; - public uint8 threshold; - public bool threshold_valid; - public bool online; - public bool prefailure; - public bool good; - public uint8 current_value; - public uint8 worst_value; - public uint64 pretty_value; - public uint8[6] raw; - } - - [CCode (cname="SkSmartAttributeParseCallback")] - public delegate void SmartAttributeParseCallback(void* disk, SmartAttributeParsedData a); - - [Compact] - [CCode (free_function="sk_disk_free", cname="SkDisk", cprefix="sk_disk_")] - public class Disk { - - public static int open(string name, out Disk disk); - - public int get_size(out uint64 bytes); - - public int check_sleep_mode(out bool awake); - - public int identify_is_available(out bool available); - public int identify_parse(out weak IdentifyParsedData* data); - - public int smart_is_available(out bool available); - public int smart_status(out bool good); - public int smart_read_data(); - public int smart_parse_attributes(SmartAttributeParseCallback cb); - public int smart_parse(out weak SmartParsedData* data); - public int smart_self_test(SmartSelfTest test); - - public int dump(); - } - - /* These two should move to an official vala package */ - [CCode (cname="errno", cheader_filename="errno.h")] - public int errno; - - [CCode (cname="g_strerror", cheader_filename="glib.h")] - public weak string strerror(int err); -} -- cgit