All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] sensors.conf syntax: anyone use escape sequences?
@ 2006-11-12 14:01 Mark M. Hoffman
  2006-11-17 10:26 ` Jean Delvare
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark M. Hoffman @ 2006-11-12 14:01 UTC (permalink / raw)
  To: lm-sensors

Hi everyone:

This is a question about sensors.conf syntax:

For a quoted string, libsensors currently accepts C language escape sequences
like '\n' for newline, etc.  It also accepts octal escapes, like '\015', but
for some reason it doesn't accept hex escapes, like '\x20'.

Question: is anyone actually using these escapes?

I wouldn't mind getting rid of them.

Regards,

-- 
Mark M. Hoffman
mhoffman at lightlink.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [lm-sensors] sensors.conf syntax: anyone use escape sequences?
  2006-11-12 14:01 [lm-sensors] sensors.conf syntax: anyone use escape sequences? Mark M. Hoffman
@ 2006-11-17 10:26 ` Jean Delvare
  2006-12-21 12:44 ` Mark M. Hoffman
  2006-12-21 13:29 ` Mark M. Hoffman
  2 siblings, 0 replies; 4+ messages in thread
From: Jean Delvare @ 2006-11-17 10:26 UTC (permalink / raw)
  To: lm-sensors

Hi Mark,

On Sun, 12 Nov 2006 09:01:42 -0500, Mark M. Hoffman wrote:
> This is a question about sensors.conf syntax:
> 
> For a quoted string, libsensors currently accepts C language escape sequences
> like '\n' for newline, etc.  It also accepts octal escapes, like '\015', but
> for some reason it doesn't accept hex escapes, like '\x20'.
> 
> Question: is anyone actually using these escapes?
> 
> I wouldn't mind getting rid of them.

I've never seen them used. I agree that octal escapes don't sound very
useful, assuming libsensors accepts all character values in quoted
strings, and not only the 32-127 range. Same applies to C language
escape sequences, except \n, as I guess there is no other way to
include a newline in a string?

Then the question is, how much does it cost? It's not a totally
unreasonable feature, so we'd need a good reason to get rid of it.

Thanks,
-- 
Jean Delvare


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [lm-sensors] sensors.conf syntax: anyone use escape sequences?
  2006-11-12 14:01 [lm-sensors] sensors.conf syntax: anyone use escape sequences? Mark M. Hoffman
  2006-11-17 10:26 ` Jean Delvare
@ 2006-12-21 12:44 ` Mark M. Hoffman
  2006-12-21 13:29 ` Mark M. Hoffman
  2 siblings, 0 replies; 4+ messages in thread
From: Mark M. Hoffman @ 2006-12-21 12:44 UTC (permalink / raw)
  To: lm-sensors

Hi Jean:

(resurrecting an old thread here)

* Jean Delvare <khali at linux-fr.org> [2006-11-17 11:26:16 +0100]:
> Hi Mark,
> 
> On Sun, 12 Nov 2006 09:01:42 -0500, Mark M. Hoffman wrote:
> > This is a question about sensors.conf syntax:
> > 
> > For a quoted string, libsensors currently accepts C language escape sequences
> > like '\n' for newline, etc.  It also accepts octal escapes, like '\015', but
> > for some reason it doesn't accept hex escapes, like '\x20'.
> > 
> > Question: is anyone actually using these escapes?
> > 
> > I wouldn't mind getting rid of them.
> 
> I've never seen them used. I agree that octal escapes don't sound very
> useful, assuming libsensors accepts all character values in quoted
> strings, and not only the 32-127 range. Same applies to C language
> escape sequences, except \n, as I guess there is no other way to
> include a newline in a string?

You raise a good point here.  The existing scanner accepts any characters from
the 'alnum' class for unquoted identifiers.  This corresponds to isalnum() of
the C standard library.  That function changes behavior depending on locale.

The end-result is that the behavior of the scanner depends on the locale
setting at _compile-time_ instead of at run-time.  (That's when flex checks
isalnum() to build its static tables.)  That's just nasty.

Right now, the code does accept everything between quotes, which is good.  For
the unquoted behavior, I think it should accept strictly ASCII (32-127) in
order to avoid having the run-time behavior influenced by the compile-time
locale setting.  Any better ideas?

Regards,

-- 
Mark M. Hoffman
mhoffman at lightlink.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [lm-sensors] sensors.conf syntax: anyone use escape sequences?
  2006-11-12 14:01 [lm-sensors] sensors.conf syntax: anyone use escape sequences? Mark M. Hoffman
  2006-11-17 10:26 ` Jean Delvare
  2006-12-21 12:44 ` Mark M. Hoffman
@ 2006-12-21 13:29 ` Mark M. Hoffman
  2 siblings, 0 replies; 4+ messages in thread
From: Mark M. Hoffman @ 2006-12-21 13:29 UTC (permalink / raw)
  To: lm-sensors

Hi:

* Mark M. Hoffman <mhoffman at lightlink.com> [2006-12-21 07:44:18 -0500]:
> The end-result is that the behavior of the scanner depends on the locale
> setting at _compile-time_ instead of at run-time.  (That's when flex checks
> isalnum() to build its static tables.)  That's just nasty.

As Jean points out on IRC... flex doesn't actually work that way.

Nevermind. ;)

Regards,

-- 
Mark M. Hoffman
mhoffman at lightlink.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-21 13:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-12 14:01 [lm-sensors] sensors.conf syntax: anyone use escape sequences? Mark M. Hoffman
2006-11-17 10:26 ` Jean Delvare
2006-12-21 12:44 ` Mark M. Hoffman
2006-12-21 13:29 ` Mark M. Hoffman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.