~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/u-boot/include/env_attr.h

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * (C) Copyright 2012
 
3
 * Joe Hershberger, National Instruments, joe.hershberger@ni.com
 
4
 *
 
5
 * SPDX-License-Identifier:     GPL-2.0+
 
6
 */
 
7
 
 
8
#ifndef __ENV_ATTR_H__
 
9
#define __ENV_ATTR_H__
 
10
 
 
11
#define ENV_ATTR_LIST_DELIM     ','
 
12
#define ENV_ATTR_SEP            ':'
 
13
 
 
14
/*
 
15
 * env_attr_walk takes as input an "attr_list" that takes the form:
 
16
 *      attributes = [^,:\s]*
 
17
 *      entry = name[:attributes]
 
18
 *      list = entry[,list]
 
19
 * It will call the "callback" function with the "name" and attribute as "value"
 
20
 * The callback may return a non-0 to abort the list walk.
 
21
 * This return value will be passed through to the caller.
 
22
 * 0 is returned on success.
 
23
 */
 
24
extern int env_attr_walk(const char *attr_list,
 
25
        int (*callback)(const char *name, const char *value));
 
26
 
 
27
/*
 
28
 * env_attr_lookup takes as input an "attr_list" with the same form as above.
 
29
 * It also takes as input a "name" to look for.
 
30
 * If the name is found in the list, it's value is copied into "attributes".
 
31
 * There is no protection on attributes being too small for the value.
 
32
 * It returns -1 if attributes is NULL, 1 if "name" is not found, 2 if
 
33
 * "attr_list" is NULL.
 
34
 * Returns 0 on success.
 
35
 */
 
36
extern int env_attr_lookup(const char *attr_list, const char *name,
 
37
        char *attributes);
 
38
 
 
39
#endif /* __ENV_ATTR_H__ */