Lines Matching refs:xb_size
32 static int nval_find(const char *xb, int xb_size, const YCHAR *name,
39 while (size > 0 && (size < xb_size) && (pos + size < xb_size)) {
47 if (pos < xb_size - sizeof(int))
57 static int nval_used(const char *xb, int xb_size)
63 while (size > 0 && (size < xb_size) && (pos + size < xb_size)) {
65 if (pos < xb_size - sizeof(int))
73 int nval_del(char *xb, int xb_size, const YCHAR *name)
75 int pos = nval_find(xb, xb_size, name, NULL);
78 if (pos < 0 || pos >= xb_size)
84 memcpy(xb + pos, xb + pos + size, xb_size - (pos + size));
85 memset(xb + (xb_size - size), 0, size);
89 int nval_set(char *xb, int xb_size, const YCHAR *name, const char *buf,
93 int namelen = yaffs_strnlen(name, xb_size);
99 pos = nval_find(xb, xb_size, name, &size_exist);
106 start = nval_used(xb, xb_size);
107 space = xb_size - start + size_exist;
115 nval_del(xb, xb_size, name);
116 start = nval_used(xb, xb_size);
129 int nval_get(const char *xb, int xb_size, const YCHAR * name, char *buf,
132 int pos = nval_find(xb, xb_size, name, NULL);
135 if (pos >= 0 && pos < xb_size) {
142 while (xb[pos] && size > 0 && pos < xb_size) {
167 int nval_list(const char *xb, int xb_size, char *buf, int bsize)
177 size <= xb_size &&
178 (pos + size) < xb_size &&
197 if (pos < xb_size - sizeof(int))
205 int nval_hasvalues(const char *xb, int xb_size)
207 return nval_used(xb, xb_size) > 0;