annotate osdep/setenv.c @ 18911:89af7441989b

Modifies behavior of -edlout Now it creates a new file and writes edit decision list (EDL) records to it just as it did before but instead of making pas-2-seconds blocks for each 'i' keystroke lets the user hits 'i' to mark the start or end of a block.
author reynaldo
date Wed, 05 Jul 2006 22:47:44 +0000
parents 44c24de55f9d
children d0d487227d60
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17245
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
1 /* setenv implementation for systems lacking it. */
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
2
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
3 #include "../config.h"
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
4
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
5 #ifndef HAVE_SETENV
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
6
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
7 #include <stdlib.h>
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
8 #include <string.h>
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
9 #ifndef MP_DEBUG
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
10 #define NDEBUG
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
11 #endif
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
12 #include <assert.h>
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
13
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
14 int setenv(const char *name, const char *val, int overwrite)
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
15 {
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
16 int len = strlen(name) + strlen(val) + 2;
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
17 char *env = malloc(len);
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
18 if (!env) { return -1; }
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
19
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
20 assert(overwrite != 0);
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
21
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
22 strcpy(env, name);
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
23 strcat(env, "=");
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
24 strcat(env, val);
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
25 putenv(env);
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
26
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
27 return 0;
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
28 }
44c24de55f9d - move our setenv() fallback implementation to osdep
al
parents:
diff changeset
29 #endif