Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
correction to compile with warning and th indentation in my files
[simgrid.git] / src / simix / smx_host.c
index 35aceeb..9a19d08 100644 (file)
@@ -1,7 +1,5 @@
-/*     $Id$     */
-
-/* Copyright (c) 2007 Arnaud Legrand, Bruno Donassolo.
-   All rights reserved.                                          */
+/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -41,7 +39,7 @@ smx_host_t __SIMIX_host_create(const char *name,
  *     \param data User data
  *
  */
-void SIMIX_host_set_data(smx_host_t host, void *data)
+XBT_INLINE void SIMIX_host_set_data(smx_host_t host, void *data)
 {
   xbt_assert0((host != NULL), "Invalid parameters");
   xbt_assert0((host->data == NULL), "Data already set");
@@ -58,7 +56,7 @@ void SIMIX_host_set_data(smx_host_t host, void *data)
  * This functions checks whether \a host is a valid pointer or not and return the user data associated to \a host if it is possible.
  * \param host SIMIX host
  */
-void *SIMIX_host_get_data(smx_host_t host)
+XBT_INLINE void *SIMIX_host_get_data(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters");
 
@@ -72,7 +70,7 @@ void *SIMIX_host_get_data(smx_host_t host)
  * This functions checks whether \a host is a valid pointer or not and return its name.
  * \param host SIMIX host
  */
-const char *SIMIX_host_get_name(smx_host_t host)
+XBT_INLINE const char *SIMIX_host_get_name(smx_host_t host)
 {
 
   xbt_assert0((host != NULL), "Invalid parameters");
@@ -87,7 +85,7 @@ const char *SIMIX_host_get_name(smx_host_t host)
  * Return the host,  more details in #SIMIX_process_get_host
  * \return SIMIX host
  */
-smx_host_t SIMIX_host_self(void)
+XBT_INLINE smx_host_t SIMIX_host_self(void)
 {
   return SIMIX_process_get_host(SIMIX_process_self());
 }
@@ -131,7 +129,7 @@ void __SIMIX_host_destroy(void *h)
  *
  * \return Number of hosts
  */
-int SIMIX_host_get_number(void)
+XBT_INLINE int SIMIX_host_get_number(void)
 {
   return (xbt_dict_size(simix_global->host));
 }
@@ -161,7 +159,7 @@ smx_host_t *SIMIX_host_get_table(void)
  *
  * \return List of all hosts (as a #xbt_dict_t)
  */
-xbt_dict_t SIMIX_host_get_dict(void)
+XBT_INLINE xbt_dict_t SIMIX_host_get_dict(void)
 {
   return simix_global->host;
 }
@@ -173,7 +171,7 @@ xbt_dict_t SIMIX_host_get_dict(void)
  * \param host SIMIX host
  * \return Speed
  */
-double SIMIX_host_get_speed(smx_host_t host)
+XBT_INLINE double SIMIX_host_get_speed(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters");
 
@@ -187,7 +185,7 @@ double SIMIX_host_get_speed(smx_host_t host)
  * Return the available speed (in Mflop/s).
  * \return Speed
  */
-double SIMIX_host_get_available_speed(smx_host_t host)
+XBT_INLINE double SIMIX_host_get_available_speed(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters");
 
@@ -202,7 +200,7 @@ double SIMIX_host_get_available_speed(smx_host_t host)
  * \param name The name of an host.
  * \return The corresponding host
  */
-smx_host_t SIMIX_host_get_by_name(const char *name)
+XBT_INLINE smx_host_t SIMIX_host_get_by_name(const char *name)
 {
   xbt_assert0(((simix_global != NULL)
                && (simix_global->host != NULL)), "Environment not set yet");
@@ -216,9 +214,9 @@ smx_host_t SIMIX_host_get_by_name(const char *name)
  * \param host a host
  * \return the dynamic array consisting of property names
  */
-xbt_dict_t SIMIX_host_get_properties(smx_host_t host)
+XBT_INLINE xbt_dict_t SIMIX_host_get_properties(smx_host_t host)
 {
-  xbt_assert0((host != NULL), "Invalid parameters");
+  xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
 
   return surf_workstation_model->extension.workstation.get_properties(host->host);
 }
@@ -231,9 +229,9 @@ xbt_dict_t SIMIX_host_get_properties(smx_host_t host)
  * \param host The SIMIX host
  * \return 1 if host is available or 0 if not.
  */
-int SIMIX_host_get_state(smx_host_t host)
+XBT_INLINE int SIMIX_host_get_state(smx_host_t host)
 {
-  xbt_assert0((host != NULL), "Invalid parameters");
+  xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
 
   return (surf_workstation_model->extension.workstation.
           get_state(host->host));