From e23e15aa5c1a1e476fb022edaefe95f5fbe9c97e Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 25 Oct 2009 19:01:37 +0000 Subject: * lib/cfuns-c.c (oa_concatenate_string): Define. * include/open-axiom.h (openaxiom_ifs): New. (OPENAXIOM_TEXINPUTS_PATH): Likewise. (OPENAXIOM_BIBINPUTS_PATH): Likewise. * driver/main.c (augment_variable): New. (upgrade_environment): Likewise. Call publish_systemdir. (main): Call it instead of publish_systemdir. Handle 'spawn' driver. * driver/utils.h (openaxiom_execute_driver): New kind of driver. * driver/utils.c (openaxiom_preprocess_arguments): Tidy. (openaxiom_execute_core): Likewise. * sman/sman.c (process_arguments): Likewise. (process_options): Likewise. --- src/lib/cfuns-c.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/lib/cfuns-c.c') diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c index 97d85d15..42dce2ed 100644 --- a/src/lib/cfuns-c.c +++ b/src/lib/cfuns-c.c @@ -526,6 +526,24 @@ oa_getpid(void) #endif } +/* Concatenate two strings and return a pointer to the + newly allocate resulting string. */ +OPENAXIOM_EXPORT const char* +oa_concatenate_string(const char* lhs, const char* rhs) +{ + if (lhs == NULL) + return rhs; + else if (rhs == NULL) + return lhs; + else { + const int lhs_length = strlen(lhs); + char* result = (char*) malloc(lhs_length + strlen(rhs) + 1); + strcpy(result, lhs); + strcpy(result + lhs_length, rhs); + return result; + } +} + /* Return the value of an environment variable. */ OPENAXIOM_EXPORT char* oa_getenv(const char* var) -- cgit v1.2.3