[go: up one dir, main page]

File: lret.h

package info (click to toggle)
specter 1.3%2B1.4pre2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 728 kB
  • ctags: 531
  • sloc: ansic: 5,060; sh: 267; makefile: 238; perl: 169
file content (32 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

#ifndef _LRET_H
#define _LRET_H

typedef struct {
	char name[SPECTER_IRET_NAME_LEN];
	specter_iret_t *p;
} specter_local_ret_t;


#define GET_VALUE(ret_arr,x)	(ret_arr[x].p->value)
#define GET_FLAGS(ret_arr,x)	(ret_arr[x].p->flags)
#define GET_LEN(ret_arr,x)	(ret_arr[x].p->len)
#define IS_VALID(p)		(p->flags & SPECTER_RETF_VALID)


static inline int fill_local_ret(specter_local_ret_t *lrets, int num)
{
	int ctr;

	for (ctr = 0; ctr < num; ctr++) {
		if ((lrets[ctr].p = find_iret(lrets[ctr].name)) == NULL) {
			specter_log(SPECTER_NOTICE, "iret with name \"%s\" not found.\n", lrets[ctr].name);
			return -1;
		}
	}

	return 0;
}

#endif /* lret.h */