Returns now GNUNET_SYSERR
[oweals/gnunet.git] / src / util / os_installation.c
index 19469e81e38bd5d509528addd9b55904181946ae..cbbc614334bf38762fffdf4c0386d83d7673d746 100644 (file)
  * @brief get paths used by the program
  * @author Milan
  */
-
-#ifdef __cplusplus
-extern "C"
-{
-#if 0                           /* keep Emacsens' auto-indent happy */
-}
-#endif
-#endif
-
 #include <sys/stat.h>
 #include <stdlib.h>
 #include <string.h>
@@ -218,10 +209,10 @@ get_path_from_PATH ()
   buf = GNUNET_malloc (strlen (path) + 20);
   pos = path;
 
-  while (NULL != (end = strchr (pos, ':')))
+  while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
     {
       *end = '\0';
-      sprintf (buf, "%s/%s", pos, "gnunetd");
+      sprintf (buf, "%s/%s", pos, "gnunet-arm");
       if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
         {
           pos = GNUNET_strdup (pos);
@@ -231,7 +222,7 @@ get_path_from_PATH ()
         }
       pos = end + 1;
     }
-  sprintf (buf, "%s/%s", pos, "gnunetd");
+  sprintf (buf, "%s/%s", pos, "gnunet-arm");
   if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
     {
       pos = GNUNET_strdup (pos);
@@ -296,7 +287,8 @@ os_get_gnunet_path ()
   /* other attempts here */
   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
               _
-              ("Could not determine installation path for GNUnet.  Set `%s' environment variable.\n"),
+              ("Could not determine installation path for %s.  Set `%s' environment variable.\n"),
+             "GNUnet",
               "GNUNET_PREFIX");
   return NULL;
 }
@@ -424,6 +416,10 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
         DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "locale"
         DIR_SEPARATOR_STR;
       break;
+    case GNUNET_OS_IPK_ICONDIR:
+      dirname =
+        DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "icons" DIR_SEPARATOR_STR;
+      break;
     default:
       GNUNET_free (execpath);
       return NULL;
@@ -434,10 +430,4 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
   return tmp;
 }
 
-#if 0                           /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
 /* end of os_installation.c */