Mercurial > mplayer.hg
annotate osdep/setenv.c @ 19950:e99cd69dd08e
Patch by Karolina Lindqvist <karolina.lindqvist@kramnet.se>
"This patch is the MMX optimizations for the zrmjpeg filter, which is used by
the zr2 video output driver."
With some small changes by me:
- column width=80
- kept jpeg_enc_* functions static because they confuse the current vo_zr.c
- did not include jpeg_enc.h because jpeg_enc functions are still static
author | rik |
---|---|
date | Sat, 23 Sep 2006 15:31:21 +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 |