RE: String variable expansion routine wanted

2006-01-22 Thread Alexander Pohoyda
 Well If I understood well you need printf()

No, I am looking for the function which will parse the input string,
find variables and invoke my callback function with the name of the
variable to get it's value.

This functionality is used in all shells and make utilities, so I'm
wondering why there is no common implementation for it.


-- 
Alexander Pohoyda [EMAIL PROTECTED]
PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72  15 54 5F 62 20 23 C6 44
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


String variable expansion routine wanted

2006-01-18 Thread Alexander Pohoyda
Hi folks,

Is there a C-function that does string variable expansion like this:

some text $(VARIABLE) text -- some text VALUE text

I suppose this functionality is useful for many programs, so I'm
looking for a simpe library to link with.

Please CC me on reply.  Thanks a lot!

-- 
Alexander Pohoyda [EMAIL PROTECTED]
PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72  15 54 5F 62 20 23 C6 44
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: String variable expansion routine wanted

2006-01-18 Thread Spiros Papadopoulos
Hi,

Well If I understood well you need printf()
Definitely check the manual page:
#man 3 printf

You can use printf() like this:

vartype Variable = declaration;   /* string or int or double etc */

/* will print your text and the variable in the middle */
printf(some text... %type_of_variable ... more text, variable); 

You can use multiple variables like that if you want of any type:
int = 1;
string = Hello;


.
printf((text)number: %i(int), text: %s, text: %..., text: %... , text:
..., int, string, ..., ..., ...);

Spiros P.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:owner-freebsd-
 [EMAIL PROTECTED] On Behalf Of Alexander Pohoyda
 Sent: Wednesday, January 18, 2006 9:46 AM
 To: freebsd-questions@freebsd.org
 Subject: String variable expansion routine wanted
 
 Hi folks,
 
 Is there a C-function that does string variable expansion like this:
 
 some text $(VARIABLE) text -- some text VALUE text
 
 I suppose this functionality is useful for many programs, so I'm
 looking for a simpe library to link with.
 
 Please CC me on reply.  Thanks a lot!
 
 --
 Alexander Pohoyda [EMAIL PROTECTED]
 PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72  15 54 5F 62 20 23 C6 44
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-
 [EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]