ACPI/PMU procfs HAL test program. Version 002.

Richard Hughes ee21rh at surrey.ac.uk
Mon Jan 24 15:55:54 PST 2005


On Tue, 25 Jan 2005 00:42:28 +0200, Paul Ionescu wrote:
> I made a patch to add some more battery values, and I now need a 
> function to parse a string like "present rate: 14547 mW" and
> extract the integer from the string.

14547 mW, what about searching for a space and then doing a g_ascii_strtod
on the string? 

It might be worth writing a generic function, give me a shout if you get
stuck.
 
> --- procfs.c.1  2005-01-24 09:36:16.000000000 +0200 +++ procfs.c
> 2005-01-25 00:28:21.677673358 +0200

Brilliant, thanks. I've patched the file. I think the small test file
idea is working well, I'm looking at merging some of the main
functionality in soon.

-- 

http://www.hughsie.com/PUBLIC-KEY


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list