Mercurial > mplayer.hg
annotate osdep/setenv.c @ 21155:e0a600f0bcaf
r21152: typo: Bitrate is printed in kb/s, not Mb/s on the status line.
r21153: Miscellaneous updates for the introduction and the requirements section.
r21154: Remove outdated and superfluous sound card section.
r21155: Remove outdated and superfluous video cards section.
r21158: documented :format=pes[12] in -mpegopts
r21168: x264 supports interlaced encoding for some time
author | voroshil |
---|---|
date | Wed, 22 Nov 2006 18:47:46 +0000 |
parents | 44c24de55f9d |
children | d0d487227d60 |
rev | line source |
---|---|
17245 | 1 /* setenv implementation for systems lacking it. */ |
2 | |
3 #include "../config.h" | |
4 | |
5 #ifndef HAVE_SETENV | |
6 | |
7 #include <stdlib.h> | |
8 #include <string.h> | |
9 #ifndef MP_DEBUG | |
10 #define NDEBUG | |
11 #endif | |
12 #include <assert.h> | |
13 | |
14 int setenv(const char *name, const char *val, int overwrite) | |
15 { | |
16 int len = strlen(name) + strlen(val) + 2; | |
17 char *env = malloc(len); | |
18 if (!env) { return -1; } | |
19 | |
20 assert(overwrite != 0); | |
21 | |
22 strcpy(env, name); | |
23 strcat(env, "="); | |
24 strcat(env, val); | |
25 putenv(env); | |
26 | |
27 return 0; | |
28 } | |
29 #endif |