solaris-file 0.3.7 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/ext/solaris/sfile.h DELETED
@@ -1,87 +0,0 @@
1
- #define SOLARIS_VERSION "0.3.7"
2
- #define MAX_STRING 512
3
-
4
- VALUE cSolarisFileError;
5
- VALUE sACLStruct;
6
-
7
- /*
8
- * Converts a numeric ACL type into a human readable string.
9
- */
10
- static VALUE acl_type_string(int acl_type){
11
- VALUE v_acl_type;
12
-
13
- switch(acl_type){
14
- case USER: case USER_OBJ:
15
- v_acl_type = rb_str_new2("user");
16
- break;
17
- case GROUP: case GROUP_OBJ:
18
- v_acl_type = rb_str_new2("group");
19
- break;
20
- case OTHER_OBJ:
21
- v_acl_type = rb_str_new2("other");
22
- break;
23
- case CLASS_OBJ:
24
- v_acl_type = rb_str_new2("mask");
25
- break;
26
- case DEF_USER: case DEF_USER_OBJ:
27
- v_acl_type = rb_str_new2("defaultuser");
28
- break;
29
- case DEF_GROUP: case DEF_GROUP_OBJ:
30
- v_acl_type = rb_str_new2("defaultgroup");
31
- break;
32
- case DEF_OTHER_OBJ:
33
- v_acl_type = rb_str_new2("defaultother");
34
- break;
35
- case DEF_CLASS_OBJ:
36
- v_acl_type = rb_str_new2("defaultmask");
37
- break;
38
- default:
39
- v_acl_type = rb_str_new2("unknown");
40
- }
41
-
42
- return v_acl_type;
43
- }
44
-
45
- /*
46
- * Helper function used by the acl_write_text class and instance methods.
47
- */
48
- void do_acl_check(int aclcheck_val, int which){
49
- char err[MAX_STRING];
50
-
51
- switch(aclcheck_val){
52
- case 0:
53
- break; // Nothing wrong
54
- case USER_ERROR:
55
- sprintf(err,"Invalid ACL entry: %i; Multiple user entries", which);
56
- rb_raise(cSolarisFileError, err);
57
- break;
58
- case GRP_ERROR:
59
- sprintf(err,"Invalid ACL entry: %i; Multiple group entries", which);
60
- rb_raise(cSolarisFileError, err);
61
- break;
62
- case OTHER_ERROR:
63
- sprintf(err,"Invalid ACL entry: %i; Multiple other entries", which);
64
- rb_raise(cSolarisFileError, err);
65
- break;
66
- case CLASS_ERROR:
67
- sprintf(err,"Invalid ACL entry: %i; Multiple mask entries", which);
68
- rb_raise(cSolarisFileError, err);
69
- break;
70
- case DUPLICATE_ERROR:
71
- sprintf(err,"Invalid ACL entry: %i; Multiple user or group entries", which);
72
- rb_raise(cSolarisFileError, err);
73
- break;
74
- case ENTRY_ERROR:
75
- sprintf(err,"Invalid ACL entry: %i; Invalid entry type", which);
76
- rb_raise(cSolarisFileError, err);
77
- break;
78
- case MISS_ERROR:
79
- rb_raise(cSolarisFileError, "Missing ACL entries");
80
- break;
81
- case MEM_ERROR:
82
- rb_raise(cSolarisFileError, "Out of memory!");
83
- break;
84
- default:
85
- rb_raise(cSolarisFileError, "Unknown error");
86
- };
87
- }