Annotation of embedtools/src/ub_env.c, revision 1.1.2.4

1.1.2.1   misho       1: #include "global.h"
                      2: #include "ub_env.h"
                      3: 
                      4: 
1.1.2.4 ! misho       5: env_t *env;
        !             6: 
        !             7: 
1.1.2.3   misho       8: static int
                      9: ub_flash_io(env_t * __restrict e, int mode)
                     10: {
                     11:        int f, ret = 0;
                     12: 
                     13:        FTRACE(4);
                     14: 
                     15:        f = open(DRV_UB_ENV_MAP, mode);
                     16:        if (f == -1) {
                     17:                printf("Error:: Can't access u-boot-env device %s\n", DRV_UB_ENV_MAP);
                     18:                return -1;
                     19:        }
                     20: 
                     21:        if (mode & O_RDWR) {
                     22:        } else {
                     23:        }
                     24: 
                     25:        close(f);
                     26:        return ret;
                     27: }
                     28: 
1.1.2.4 ! misho      29: int
        !            30: ub_load(const char *csSec)
        !            31: {
        !            32:        const char *str;
        !            33:        size_t siz;
        !            34: 
        !            35:        str = cfg_getAttribute(&cfg, csSec, "size");
        !            36:        siz = strtol(str, NULL, 0);
        !            37:        if (!siz)
        !            38:                return -1;
        !            39: 
        !            40:        env = e_malloc(siz);
        !            41:        if (!env) {
        !            42:                ELIBERR(elwix);
        !            43:                return -1;
        !            44:        }
        !            45: 
        !            46:        return 0;
        !            47: }
        !            48: 
        !            49: void
        !            50: ub_unload()
        !            51: {
        !            52:        if (env)
        !            53:                e_free(env);
        !            54: }
        !            55: 
1.1.2.2   misho      56: const char*
                     57: ub_getenv(const char *csName)
                     58: {
                     59:        const char *str = NULL;
                     60: 
1.1.2.3   misho      61:        FTRACE(3);
                     62: 
1.1.2.2   misho      63:        return str;
                     64: }
                     65: 
                     66: int
                     67: ub_setenv(const char *csName, const char *csValue)
                     68: {
1.1.2.3   misho      69:        FTRACE(3);
                     70: 
1.1.2.2   misho      71:        return 0;
                     72: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>