[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] E CVS: apps/e englebass (FreeBSD Breakage?)



On 12/15/2006 02:32, Enlightenment CVS wrote:
Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/temperature


Modified Files:
e_mod_config.c e_mod_main.c e_mod_main.h

I think the patch below has broken me. Using a fresh cvsup, I can not build apps/e and the associated temperature module. Attached is a patch that allows it to build on my machine, and the temperature module still seems to function. Though honestly I'm not sure if I've patched it properly.

Additionally, cpufreq would not build (though no fault of this commit). I've patched it and attached that patch to this as well. It too seems to still run now. Please review. I've seen no commit regarding cpufreq recently so... dunno. Maybe something wron on my end.

I'm a bit new so, if I simply had bad bits on my machine please excuse. Also, I do not usually use those modules, and happen to have a bit of an odd setup... so please take my "testing" of them with a grain of salt.

Regards.



Log Message:
Only check the type of sensor on init and when changing config.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/temperature/e_mod_config.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- e_mod_config.c	14 Dec 2006 15:04:15 -0000	1.25
+++ e_mod_config.c	15 Dec 2006 08:32:31 -0000	1.26
@@ -29,7 +29,7 @@
    int high_temp;
int sensor;
-   int acpizone;
+   Ecore_List *sensors;
 };
/* Protos */
@@ -67,8 +67,9 @@
 static void
_fill_data(E_Config_Dialog_Data *cfdata) {
-   double p;
+   double      p;
    Ecore_List *therms;
+   char       *name;
cfdata->units = temperature_config->units; if (temperature_config->units == CELCIUS) @@ -110,34 +111,46 @@
      cfdata->high_method = TEMP_HIGH_HIGH;
cfdata->sensor = 0;
-   if (temperature_config->sensor_name)
-     {
- if (!strcmp(temperature_config->sensor_name, "temp1")) - cfdata->sensor = 0; - else if (!strcmp(temperature_config->sensor_name, "temp2")) - cfdata->sensor = 1; - else if (!strcmp(temperature_config->sensor_name, "temp3")) - cfdata->sensor = 2;
-     }
-   cfdata->acpizone = 0;
-   if (temperature_config->acpi_sel)
+   switch (temperature_config->sensor_type)
      {
-       therms = ecore_file_ls("/proc/acpi/thermal_zone");
-       if (therms)
-	 {
-	    char *tzone;
-	    int n = 0;
-	    while ((tzone = ecore_list_next(therms)))
-	      {
-		 if (!strcmp(temperature_config->acpi_sel, tzone))
-		   {
-		      cfdata->acpizone = n;
-		      break;
-		   }
-		 else n++;
-	      }
-	    ecore_list_destroy(therms);
-	 }
+      case SENSOR_TYPE_NONE:
+	 break;
+      case SENSOR_TYPE_FREEBSD:
+	 break;
+      case SENSOR_TYPE_OMNIBOOK:
+	 break;
+      case SENSOR_TYPE_LINUX_MACMINI:
+	 break;
+      case SENSOR_TYPE_LINUX_I2C:
+	 ecore_list_append(cfdata->sensors, strdup("temp1"));
+	 ecore_list_append(cfdata->sensors, strdup("temp2"));
+	 ecore_list_append(cfdata->sensors, strdup("temp3"));
+	 ecore_list_goto_first(cfdata->sensors);
+	 while ((name = ecore_list_next(cfdata->sensors)))
+	   {
+ if (!strcmp(temperature_config->sensor_name, name)) + break;
+	      cfdata->sensor++;
+	   }
+	 break;
+      case SENSOR_TYPE_LINUX_ACPI:
+	 therms = ecore_file_ls("/proc/acpi/thermal_zone");
+	 if (therms)
+	   {
+	      int n = 0;
+
+	      while ((name = ecore_list_next(therms)))
+		{
+		   ecore_list_append(cfdata->sensors, strdup(name));
+		   if (!strcmp(temperature_config->sensor_name, name))
+		     {
+			cfdata->sensor = n;
+		     }
+		   n++;
+		}
+	      ecore_list_destroy(therms);
+	   }
+	 break;
      }
 }
@@ -147,6 +160,8 @@
    E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
+   cfdata->sensors = ecore_list_new();
+   ecore_list_set_free_cb(cfdata->sensors, free);
    _fill_data(cfdata);
    return cfdata;
 }
@@ -155,6 +170,8 @@
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) {
    temperature_config->config_dialog = NULL;
+   if (cfdata->sensors) ecore_list_destroy(cfdata->sensors);
+   cfdata->sensors = NULL;
    free(cfdata);
 }
@@ -276,57 +293,24 @@
    e_widget_framelist_object_append(of, ob);
    e_widget_list_object_append(o, of, 1, 1, 0.5);
-#ifndef __FreeBSD__
-   Ecore_List *therms;
-
-   therms = ecore_file_ls("/proc/acpi/thermal_zone");
-   if ((!therms) || (ecore_list_is_empty(therms)))
+   if (!ecore_list_is_empty(cfdata->sensors))
      {
-	FILE *f;
-	
-	if (therms)
-	  {
-	     ecore_list_destroy(therms);
-	     therms = NULL;
-	  }
-
-	f = fopen("/sys/devices/temperatures/cpu_temperature", "rb");
-	if (f) fclose(f);
-	
-	if (!f)
+	/* TODO: Notify user which thermal system is in use */
+	/* TODO: Let the user choose the wanted thermal system */
+	char *name;
+	int   n = 0;
+
+	of = e_widget_framelist_add(evas, _("Sensors"), 0);
+	rg = e_widget_radio_group_new(&(cfdata->sensor));
+	ecore_list_goto_first(cfdata->sensors);
+	while ((name = ecore_list_next(cfdata->sensors)))
 	  {
-	     therms = ecore_file_ls("/sys/bus/i2c/devices");
-	     if ((therms) && (!ecore_list_is_empty(therms)))
-	       {
-		  of = e_widget_framelist_add(evas, _("Sensors"), 0);
-		  rg = e_widget_radio_group_new(&(cfdata->sensor));
-		  ob = e_widget_radio_add(evas, _("Temp 1"), 0, rg);
-		  e_widget_framelist_object_append(of, ob);
-		  ob = e_widget_radio_add(evas, _("Temp 2"), 1, rg);
-		  e_widget_framelist_object_append(of, ob);
-		  ob = e_widget_radio_add(evas, _("Temp 3"), 2, rg);
- e_widget_framelist_object_append(of, ob); - e_widget_list_object_append(o, of, 1, 1, 0.5);
-	       }
-	     if (therms) ecore_list_destroy(therms);
-	  }
-     }
-   else
-     {
-	of = e_widget_framelist_add(evas, _("ACPI Temperature"), 0);
-	rg = e_widget_radio_group_new(&(cfdata->acpizone));
-	char *tzone;
-	int n = 0;
-	while ((tzone = ecore_list_next(therms)))
-	  {
-	     ob = e_widget_radio_add(evas, _(tzone), n, rg);
+	     ob = e_widget_radio_add(evas, _(name), n, rg);
 	     e_widget_framelist_object_append(of, ob);
 	     n++;
 	  }
 	e_widget_list_object_append(o, of, 1, 1, 0.5);
-	ecore_list_destroy(therms);
      }
-#endif
of = e_widget_framelist_add(evas, _("Check Interval"), 0);
    ob = e_widget_slider_add(evas, 1, 0, _("%1.1f seconds"), 0.5, 1000.0, 0.5, 0, &(cfdata->poll_time), NULL, 200);
@@ -378,10 +362,6 @@
 static int
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) {
-   int n = 0;
-   Ecore_List *therms;
-   char *tzone;
-
    if (cfdata->unit_method != temperature_config->units)
      {
 	if (cfdata->unit_method == 0)
@@ -404,36 +384,12 @@
    temperature_config->high = cfdata->high_temp;
    if (temperature_config->sensor_name)
      evas_stringshare_del(temperature_config->sensor_name);
-   temperature_config->sensor_name = NULL;
- switch (cfdata->sensor) - {
-      case 0:
-	temperature_config->sensor_name = evas_stringshare_add("temp1");
-	break;
-      case 1:
-	temperature_config->sensor_name = evas_stringshare_add("temp2");
-	break;
-      case 2:
-	temperature_config->sensor_name = evas_stringshare_add("temp3");
-	break;
-     }
-   if (temperature_config->acpi_sel)
-     evas_stringshare_del(temperature_config->acpi_sel);
-   temperature_config->acpi_sel = NULL;
-   therms = ecore_file_ls("/proc/acpi/thermal_zone");
-   if (therms)
-     {
-       while ((tzone = ecore_list_next(therms)))
-         {
-	   if (n == cfdata->acpizone)
-	     {
-		temperature_config->acpi_sel = evas_stringshare_add(tzone);
-		break;
-	     }
-	   n++;
-	 }
- ecore_list_destroy(therms); - } + temperature_config->sensor_name =
+     evas_stringshare_add(ecore_list_goto_index(cfdata->sensors, cfdata->sensor));
+   if (temperature_config->sensor_path)
+     evas_stringshare_del(temperature_config->sensor_path);
+   temperature_config->sensor_path = NULL;
+
    _temperature_face_cb_config_updated();
    e_config_save_queue();
    return 1;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/temperature/e_mod_main.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- e_mod_main.c	14 Dec 2006 15:07:47 -0000	1.72
+++ e_mod_main.c	15 Dec 2006 08:32:31 -0000	1.73
@@ -44,7 +44,8 @@
static void _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
 static void _menu_cb_post(void *data, E_Menu *m);
-static int _temperature_cb_check(void *data);
+static void _temperature_sensor_init(void);
+static int  _temperature_cb_check(void *data);
 static void _temperature_face_level_set(Instance *inst, double level);
 static void _temperature_face_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi);
@@ -169,138 +170,249 @@
    temperature_config->menu = NULL;
 }
-static int
-_temperature_cb_check(void *data)
+static void
+_temperature_sensor_init(void)
 {
-   int ret = 0;
-   Instance *inst;
    Ecore_List *therms;
-   Evas_List *l;
-   int temp = 0;
-   char buf[4096];
+   char        path[PATH_MAX];
 #ifdef __FreeBSD__
-   static int mib[5] = {-1};
-   int len;
+   int         len;
 #endif
-#ifdef __FreeBSD__
-   if (mib[0] == -1)
+   if ((!temperature_config->sensor_type) || (!temperature_config->sensor_name))
      {
-	len = 5;
-	sysctlnametomib("hw.acpi.thermal.tz0.temperature", mib, &len);
-     }
- - if (mib[0] != -1)
-     {
-	len = sizeof(temp);
-        if (sysctl(mib, 5, &temp, &len, NULL, 0) != -1)
-	  {
-	     temp = (temp - 2732) / 10;
-	     ret = 1;
-	  }
-     }
+	if (temperature_config->sensor_name) evas_stringshare_del(temperature_config->sensor_name);
+	if (temperature_config->sensor_path) evas_stringshare_del(temperature_config->sensor_path);
+	temperature_config->sensor_path = NULL;
+#ifdef __FreeBSD__
+	/* TODO: FreeBSD can also have more temperature sensors! */
+	temperature_config->sensor_type = SENSOR_TYPE_FREEBSD;
+	temperature_config->sensor_name = evas_stringshare_add("tz0");
#else # ifdef HAVE_OMNIBOOK
-   FILE *f;
-   char dummy[256];
- - f = fopen("/proc/omnibook/temperature", "r"); - if (f) - {
-	fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
-	if (sscanf(buf, "%s %s %i", dummy, dummy, &temp) == 3)
-	  ret = 1;
-	fclose(f);
-     }
+	/* TODO: This does not have to be a define */
+	temperature_config->sensor_type = SENSOR_TYPE_OMNIBOOK;
+	temperature_config->sensor_name = evas_stringshare_add("dummy");
 # else
-   therms = ecore_file_ls("/proc/acpi/thermal_zone");
-   if ((!therms) || ecore_list_is_empty(therms))
-     {
-	FILE *f;
+	therms = ecore_file_ls("/proc/acpi/thermal_zone");
+	if ((therms) && (!ecore_list_is_empty(therms)))
+	  {
+	     char *name;
- if (therms) ecore_list_destroy(therms);
+	     name = ecore_list_next(therms);
+	     temperature_config->sensor_type = SENSOR_TYPE_LINUX_ACPI;
+	     temperature_config->sensor_name = evas_stringshare_add(name);
- f = fopen("/sys/devices/temperatures/cpu_temperature", "rb");
-	if (f)
-	  {
-	     fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
-	     if (sscanf(buf, "%i", &temp) == 1)
-	       ret = 1;
-	     fclose(f);
+	     ecore_list_destroy(therms);
 	  }
 	else
 	  {
-	     therms = ecore_file_ls("/sys/bus/i2c/devices");
-	     if (therms)
-	       {
-		  const char *name, *sensor;
+	     FILE *f;
- sensor = temperature_config->sensor_name;
-		  if (!sensor) sensor = "temp1";
+	     if (therms) ecore_list_destroy(therms);
- while ((name = ecore_list_next(therms)))
+	     f = fopen("/sys/devices/temperatures/cpu_temperature", "rb");
+	     if (f)
+	       {
+		  temperature_config->sensor_type = SENSOR_TYPE_LINUX_MACMINI;
+		  temperature_config->sensor_name = evas_stringshare_add("dummy");
+	       }
+	     else
+	       {
+		  /* TODO: Is there I2C devices with more than 3 temperature sensors? */
+		  /* TODO: What to do when there is more than one tempX? */
+		  therms = ecore_file_ls("/sys/bus/i2c/devices");
+		  if (therms)
 		    {
-		       char fname[1024];
+		       char *name;
- sprintf(fname, "/sys/bus/i2c/devices/%s/%s_input",
-			       name, sensor);
-		       if (ecore_file_exists(fname))
+		       while ((name = ecore_list_next(therms)))
 			 {
-			    FILE *f;
+			    char *sensors[] = { "temp1", "temp2", "temp3" };
+			    int i;
- f = fopen(fname,"r"); - if (f) + for (i = 0; i < 3; i++)
 			      {
-				 fgets(buf, sizeof(buf), f);
-				 buf[sizeof(buf) - 1] = 0;
-
-				 /* actuallty read the temp */
-				 if (sscanf(buf, "%i", &temp) == 1)
-				   ret = 1;
-				 /* Hack for temp */
-				 temp = temp / 1000;
-				 fclose(f);
+				 sprintf(path, "/sys/bus/i2c/devices/%s/%s_input",
+				       name, sensors[i]);
+				 if (ecore_file_exists(path))
+				   {
+				      temperature_config->sensor_type = SENSOR_TYPE_LINUX_I2C;
+				      temperature_config->sensor_name = evas_stringshare_add(sensors[i]);
+				      break;
+				   }
 			      }
+			    if (temperature_config->sensor_type) break;
 			 }
+		       ecore_list_destroy(therms);
 		    }
-		  ecore_list_destroy(therms);
 	       }
 	  }
      }
-   else
+# endif
+#endif
+   if ((temperature_config->sensor_type) &&
+ (temperature_config->sensor_name) && + (!temperature_config->sensor_path))
      {
-	const char *name;
-
-	ret = 0;
-	name = temperature_config->acpi_sel;
-	if (!name) name = ecore_list_next(therms);
-	if (name)
+	switch (temperature_config->sensor_type)
 	  {
-	     char *p, *q;
-	     FILE *f;
-	     snprintf(buf, sizeof(buf), "/proc/acpi/thermal_zone/%s/temperature", name);
-	     f = fopen(buf, "rb");
-	     if (f)
-	       {
-		  fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
-		  fclose(f);
-		  p = strchr(buf, ':');
-		  if (p)
-		    {
-		       p++;
-		       while (*p == ' ') p++;
-		       q = strchr(p, ' ');
-		       if (q) *q = 0;
-		       temp = atoi(p);
-		       ret = 1;
-		    }
-	       }
+	   case SENSOR_TYPE_NONE:
+	      break;
+	   case SENSOR_TYPE_FREEBSD:
+#ifdef __FreeBSD__
+	      snprintf(path, sizeof(path), "hw.acpi.thermal.%s.temperature",
+		       temperature_config->sensor_name);
+	      temperature_config->sensor_path = evas_stringshare_add(path);
+
+	      len = 5;
+	      sysctlnametomib(temperature_config->sensor_path, temperature_config->mib, &len);
+#endif
+	      break;
+	   case SENSOR_TYPE_OMNIBOOK:
+	      temperature_config->sensor_path = evas_stringshare_add("/proc/omnibook/temperature");
+	      break;
+	   case SENSOR_TYPE_LINUX_MACMINI:
+		  temperature_config->sensor_path = evas_stringshare_add("/sys/devices/temperatures/cpu_temperature");
+	      break;
+	   case SENSOR_TYPE_LINUX_I2C:
+	      therms = ecore_file_ls("/sys/bus/i2c/devices");
+	      if (therms)
+		{
+		   char *name;
+
+		   while ((name = ecore_list_next(therms)))
+		     {
+			sprintf(path, "/sys/bus/i2c/devices/%s/%s_input",
+			      name, temperature_config->sensor_name);
+			if (ecore_file_exists(path))
+			  {
+			     temperature_config->sensor_path = evas_stringshare_add(path);
+			     break;
+			  }
+		     }
+		   ecore_list_destroy(therms);
+		}
+	      break;
+	   case SENSOR_TYPE_LINUX_ACPI:
+	      snprintf(path, sizeof(path), "/proc/acpi/thermal_zone/%s/temperature",
+		       temperature_config->sensor_name);
+	      temperature_config->sensor_path = evas_stringshare_add(path);
+	      break;
 	  }
-	ecore_list_destroy(therms);
      }
-# endif
-#endif - +}
+
+static int
+_temperature_cb_check(void *data)
+{
+   FILE *f;
+   int ret = 0;
+   Instance *inst;
+   Evas_List *l;
+   int temp = 0;
+   char buf[4096];
+#ifdef __FreeBSD__
+   int len;
+#endif
+
+   _temperature_sensor_init();
+
+   /* TODO: Make standard parser. Seems to be two types of temperature string:
+    * - Somename: <temp> C
+    * - <temp>
+    */
+   switch (temperature_config->sensor_type)
+     {
+      case SENSOR_TYPE_NONE:
+	 /* TODO: Slow down timer? */
+	 break;
+      case SENSOR_TYPE_FREEBSD:
+#ifdef __FreeBSD__
+	 len = sizeof(temp);
+	 if (sysctl(mib, 5, &temp, &len, NULL, 0) != -1)
+	   {
+	      temp = (temp - 2732) / 10;
+	      ret = 1;
+	   }
+	 else
+	   goto error;
+#endif
+	 break;
+      case SENSOR_TYPE_OMNIBOOK:
+	 f = fopen(temperature_config->sensor_path, "r");
+ if (f) + {
+	      char dummy[4096];
+
+	      fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
+	      if (sscanf(buf, "%s %s %i", dummy, dummy, &temp) == 3)
+		ret = 1;
+	      else
+		goto error;
+	      fclose(f);
+	   }
+	 else
+	   goto error;
+	 break;
+      case SENSOR_TYPE_LINUX_MACMINI:
+	 f = fopen(temperature_config->sensor_path, "rb");
+	 if (f)
+	   {
+	      fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
+	      if (sscanf(buf, "%i", &temp) == 1)
+		ret = 1;
+	      else
+		goto error;
+	      fclose(f);
+	   }
+	 else
+	   goto error;
+	 break;
+      case SENSOR_TYPE_LINUX_I2C:
+	 f = fopen(temperature_config->sensor_path, "r");
+	 if (f)
+	   {
+	      fgets(buf, sizeof(buf), f);
+	      buf[sizeof(buf) - 1] = 0;
+
+	      /* actuallty read the temp */
+	      if (sscanf(buf, "%i", &temp) == 1)
+		ret = 1;
+	      else
+		goto error;
+	      /* Hack for temp */
+	      temp = temp / 1000;
+	      fclose(f);
+	   }
+	 else
+	   goto error;
+	 break;
+      case SENSOR_TYPE_LINUX_ACPI:
+	 f = fopen(temperature_config->sensor_path, "r");
+	 if (f)
+	   {
+	      char *p, *q;
+	      fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
+	      fclose(f);
+	      p = strchr(buf, ':');
+	      if (p)
+		{
+		   p++;
+		   while (*p == ' ') p++;
+		   q = strchr(p, ' ');
+		   if (q) *q = 0;
+		   temp = atoi(p);
+		   ret = 1;
+		}
+	      else
+		goto error;
+	   }
+	 else
+	   goto error;
+	 break;
+     }
+
    if (temperature_config->units == FAHRENHEIT)
      temp = (temp * 9.0 / 5.0) + 32;
@@ -351,6 +463,17 @@
 	  }
      }
    return 1;
+ +error:
+   /* TODO: Error count? Might be a temporary problem */
+   /* TODO: Error dialog */
+   /* TODO: This should be further up, so that it will affect the gadcon */
+   temperature_config->sensor_type = SENSOR_TYPE_NONE;
+   if (temperature_config->sensor_name) evas_stringshare_del(temperature_config->sensor_name);
+   temperature_config->sensor_name = NULL;
+   if (temperature_config->sensor_path) evas_stringshare_del(temperature_config->sensor_path);
+   temperature_config->sensor_path = NULL;
+   return 1;
 }
static void
@@ -377,8 +500,7 @@
 {
    ecore_timer_del(temperature_config->temperature_check_timer);
temperature_config->temperature_check_timer = - ecore_timer_add(temperature_config->poll_time, _temperature_cb_check, - NULL);
+     ecore_timer_add(temperature_config->poll_time, _temperature_cb_check, NULL);
 }
/***************************************************************************/
@@ -401,9 +523,9 @@
    E_CONFIG_VAL(D, T, poll_time, DOUBLE);
    E_CONFIG_VAL(D, T, low, INT);
    E_CONFIG_VAL(D, T, high, INT);
+   E_CONFIG_VAL(D, T, sensor_type, INT);
    E_CONFIG_VAL(D, T, sensor_name, STR);
    E_CONFIG_VAL(D, T, units, INT);
-   E_CONFIG_VAL(D, T, acpi_sel, STR);
temperature_config = e_config_domain_load("module.temperature", conf_edd);
    if (!temperature_config)
@@ -412,9 +534,10 @@
 	temperature_config->poll_time = 10.0;
 	temperature_config->low = 30;
 	temperature_config->high = 80;
-	temperature_config->sensor_name = evas_stringshare_add("temp1");
+	temperature_config->sensor_type = SENSOR_TYPE_NONE;
+	temperature_config->sensor_name = NULL;
+	temperature_config->sensor_path = NULL;
 	temperature_config->units = CELCIUS;
-	temperature_config->acpi_sel = NULL;
      }
    E_CONFIG_LIMIT(temperature_config->poll_time, 0.5, 1000.0);
    E_CONFIG_LIMIT(temperature_config->low, 0, 100);
@@ -449,6 +572,8 @@
      ecore_timer_del(temperature_config->temperature_check_timer);
    if (temperature_config->sensor_name)
      evas_stringshare_del(temperature_config->sensor_name);
+   if (temperature_config->sensor_path)
+     evas_stringshare_del(temperature_config->sensor_path);
    free(temperature_config);
    temperature_config = NULL;
    E_CONFIG_DD_FREE(conf_edd);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/temperature/e_mod_main.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- e_mod_main.h	21 Oct 2006 02:32:14 -0000	1.24
+++ e_mod_main.h	15 Dec 2006 08:32:31 -0000	1.25
@@ -12,13 +12,24 @@
    FAHRENHEIT
 } Unit;
+typedef enum _Sensor_Type
+{
+   SENSOR_TYPE_NONE,
+   SENSOR_TYPE_FREEBSD,
+   SENSOR_TYPE_OMNIBOOK,
+   SENSOR_TYPE_LINUX_MACMINI,
+   SENSOR_TYPE_LINUX_I2C,
+   SENSOR_TYPE_LINUX_ACPI
+} Sensor_Type;
+
 struct _Config
 {
    /* saved * loaded config values */
    double           poll_time;
    int              low, high;
+   Sensor_Type      sensor_type;
    const char      *sensor_name;
-   const char	   *acpi_sel;
+   const char      *sensor_path;
    Unit             units;
    /* just config state */
    E_Module        *module;
@@ -27,6 +38,9 @@
    E_Menu          *menu;
    Ecore_Timer     *temperature_check_timer;
    unsigned char    have_temp;
+#ifdef __FreeBSD__
+   int              mib[5];
+#endif
 };
EAPI extern E_Module_Api e_modapi;



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs



--
Regards,
  Ravenlock
Index: e17/apps/e/src/modules/cpufreq/freqset.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/modules/cpufreq/freqset.c,v
retrieving revision 1.5
diff -u -r1.5 freqset.c
--- e17/apps/e/src/modules/cpufreq/freqset.c	14 Dec 2006 19:36:59 -0000	1.5
+++ e17/apps/e/src/modules/cpufreq/freqset.c	15 Dec 2006 19:41:51 -0000
@@ -32,8 +32,10 @@
 #ifdef __FreeBSD__
    if (!strcmp(argv[1], "frequency"))
      {
+        int new_frequency;
         new_frequency = atoi(argv[2]);
-	int len = 4;	
+	     
+        int len = 4;	
         if (sysctlbyname("dev.cpu.0.freq", NULL, 0, &new_frequency, &len) == -1)
           {
              fprintf(stderr, "Unable to open frequency interface for writing.\n");
Index: e17/apps/e/src/modules/temperature/e_mod_main.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/modules/temperature/e_mod_main.c,v
retrieving revision 1.73
diff -u -r1.73 e_mod_main.c
--- e17/apps/e/src/modules/temperature/e_mod_main.c	15 Dec 2006 08:32:31 -0000	1.73
+++ e17/apps/e/src/modules/temperature/e_mod_main.c	15 Dec 2006 19:40:30 -0000
@@ -251,6 +251,7 @@
      }
 # endif
 #endif
+     }
    if ((temperature_config->sensor_type) &&
        (temperature_config->sensor_name) && 
        (!temperature_config->sensor_path))
@@ -330,7 +331,7 @@
       case SENSOR_TYPE_FREEBSD:
 #ifdef __FreeBSD__
 	 len = sizeof(temp);
-	 if (sysctl(mib, 5, &temp, &len, NULL, 0) != -1)
+	 if (sysctl(temperature_config->mib, 5, &temp, &len, NULL, 0) != -1)
 	   {
 	      temp = (temp - 2732) / 10;
 	      ret = 1;