diff options
author | dos-reis <gdr@axiomatics.org> | 2009-10-25 19:01:37 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2009-10-25 19:01:37 +0000 |
commit | e23e15aa5c1a1e476fb022edaefe95f5fbe9c97e (patch) | |
tree | c790d6930c5a54c1ece2ec21afdcbe9dc6b5fdeb /src/lib | |
parent | 465174ff1bb6292faefe0e047833fa2df5c1c92f (diff) | |
download | open-axiom-e23e15aa5c1a1e476fb022edaefe95f5fbe9c97e.tar.gz |
* 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.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/cfuns-c.c | 18 |
1 files changed, 18 insertions, 0 deletions
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) |