/[pdpsoft]/trunk/grid-mw-security/cgul/gridmapdir/gridmapdir.h
ViewVC logotype

Contents of /trunk/grid-mw-security/cgul/gridmapdir/gridmapdir.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1660 - (show annotations) (download) (as text)
Thu May 6 15:29:04 2010 UTC (11 years, 8 months ago) by aramv
File MIME type: text/x-csrc
File size: 1442 byte(s)
Added some gridmapdir code
1 #ifndef IMAGE_MAP_FILE_H
2 #define IMAGE_MAP_FILE_H
3
4 #define MATCH_NO_WILD_CHARS ((unsigned short)0x0000)
5 #define MATCH_WILD_CHARS ((unsigned short)0x0002)
6
7 typedef struct _charlist {
8 char * value;
9 struct _charlist * next;
10 } charlist_t;
11
12
13 typedef struct _gridmap_line_s {
14 char * match;
15 charlist_t * mappings;
16 } gridmap_line_t;
17
18 typedef struct _gridmap_list {
19 gridmap_line_t * line;
20 struct _gridmap_list * next;
21 } gridmap_list_t;
22
23 void gridmap_list_free(gridmap_list_t * list);
24 int parse_gridmapfile(const char * image_map_file, gridmap_list_t ** list);
25 gridmap_line_t * find_mapping(const gridmap_list_t * list, const char * to_match, unsigned short matching_type);
26
27 /**
28 *adding a string to the list and the list will become the onwer of the string so do not free it manually
29 *@return would return NULL if the machine is out of memory
30 */
31 charlist_t * charlist_add_char_ptr_own(charlist_t * list, const char * str);
32
33 /**
34 *adding a string that is owned by someone else to the list, this will force to copy the stinrg
35 *@param list the current list. Could be NULL to create a list
36 *@param the string to copy and add
37 *@return the list of chars, NULL if the machine is out of memory
38 */
39 charlist_t * charlist_add_char_ptr_owned(charlist_t * list, const char * str);
40
41 /**
42 *free a charlist
43 *@param list the list to free
44 */
45 void charlist_free(charlist_t * list);
46
47
48 #endif /* IMAGE_MAP_FILE_H */
49

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28