Skip to main content

Module epics_string

Module epics_string 

Source
Expand description

C libCom epicsString.c — the escape-translation half.

raw_from_escaped is epicsStrnRawFromEscaped (epicsString.c:49-118), which is also all that the deprecated dbTranslateEscape (:41-47) does. It is the SINGLE owner of \-escape translation, because C has exactly one: every caller that must turn a source-text escape into the byte it denotes goes through it —

  • the .db loader, for field and info VALUES (dbLexRoutines.c:1398-1403 and :1435-1440, both dbTranslateEscape(value, value)), and
  • iocsh echo (libComRegister.c:84-91).

Record/alias NAMES are deliberately NOT translated: the .db lexer reads them with a different rule (dbLex.l:88-92), which strips the quotes and keeps the escape bytes raw. Do not route a name through here.

Verified against softIoc 7.0.10.1-DEV (dbgf re-escapes on print, so these are the STORED bytes):

field(DESC, "hex\x41end")  -> hexAend
field(VAL,  "d:\q.")       -> d:q.        (unknown escape: the char itself)
field(VAL,  "u:A.")   -> u:u0041.    (C has no \u here — the lexer
                                           accepts it, the translation does
                                           not implement it)

Functions§

raw_from_escaped
Translate C escape sequences to the bytes they denote — C epicsStrnRawFromEscaped (epicsString.c:49-118).
raw_from_escaped_bytes
raw_from_escaped on bytes — C takes a char *, and so does this.