/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to env.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-07-23 16:36:04 UTC
  • Revision ID: csa@suren.me-20150723163604-5ot6xjmom62zbosy
Support for new CMOSIS 20MPix camera

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <stdlib.h>
 
3
#include "env.h"
 
4
 
 
5
 
 
6
static const char *env_cache[IPECAMERA_MAX_ENV] = {0};
 
7
 
 
8
const char *ipecamera_getenv(ipecamera_env_t env, const char *var) {
 
9
    if (!env_cache[env]) {
 
10
        const char *var_env = getenv(var);
 
11
        env_cache[env] = var_env?var_env:(void*)-1;
 
12
        return var_env;
 
13
    }
 
14
 
 
15
    return (env_cache[env] == (void*)-1)?NULL:env_cache[env];
 
16
}
 
17