Lines Matching refs:projent

134 # Reads and parses a project(4) file, and returns a list of projent hashes.
146 # Returns a ref to a list of projent hashes. See projent_parse() for a
147 # description of a projent hash.
154 my $projent;
188 $projent = $ref;
194 $projent->{'line'} = $origline;
195 $projent->{'modified'} = 'false';
196 $projent->{'linenum'} = $linenum;
198 push(@projents, $projent);
217 # projf_write(filehandle, projent list)
219 # Write a list of projent hashes to a file handle.
220 # projent's with key "modified" => false will be
221 # written using the "line" key. projent's with
230 my $projent;
233 foreach $projent (@$projents) {
235 if ($projent->{'modified'} eq 'false') {
236 $string = $projent->{'line'};
238 $string = projent_2string($projent) . "\n";
247 # Functions for parsing the project file lines into projent hashes.
251 # (0, ref to projent hash)
258 # A projent hash contains the keys:
275 my $projent = {};
299 $projent->{'name'} = $projname;
306 $projent->{'projid'} = $projid;
313 $projent->{'comment'} = $comment;
320 $projent->{'users'} = $users;
325 $projent->{'userlist'} = $ref;
329 $projent->{'groups'} = $groups;
334 $projent->{'grouplist'} = $ref;
338 $projent->{'attributes'} = $attributes;
343 $projent->{'attributelist'} = $ref;
351 return (0, $projent);
980 # Converts a ref to a projent hash (as returned by projent_parse()) to
985 my ($projent) = @_;
989 foreach $attribute (@{$projent->{'attributelist'}}) {
992 return (join(':', ($projent->{'name'},
993 $projent->{'projid'},
994 $projent->{'comment'},
995 join(',', @{$projent->{'userlist'}}),
996 join(',', @{$projent->{'grouplist'}}),
1003 # For each projent hash ref in the list, checks that users, groups, and pools
1016 my $projent;
1026 foreach $projent (@$projents) {
1030 $seennames{$projent->{'name'}}++;
1031 $seenids{$projent->{'projid'}}++;
1033 if ($seennames{$projent->{'name'}} > 1) {
1036 $projent->{'name'}]);
1040 if ($seenids{$projent->{'projid'}} > 1) {
1043 $projent->{'projid'}]);
1046 ($ret, $ref) = projent_validate($projent, $flags);
1055 $projent->{'linenum'}], \@lineerr);
1068 # ref to projent hash, ref to list of projent hashes)
1070 # Verifies that projid of the projent hash only exists once in the list of
1071 # projent hashes.
1075 my ($projent, $projf, $idhash) = @_;
1078 my $projid = $projent->{'projid'};
1091 # ref to projent hash, ref to list of projent hashes)
1093 # Verifies that project name of the projent hash only exists once in the list
1094 # of projent hashes.
1100 my ($projent, $projf, $namehash) = @_;
1103 my $pname = $projent->{'name'};
1128 my ($projent, $flags) = @_;
1134 projent_validate_name($projent->{'name'}, $flags);
1139 projent_validate_projid($projent->{'projid'}, $flags);
1144 projent_validate_comment($projent->{'comment'}, $flags);
1149 projent_validate_users($projent->{'userlist'}, $flags);
1154 projent_validate_groups($projent->{'grouplist'}, $flags);
1159 $projent->{'attributelist'}, $flags);
1164 my $string = projent_2string($projent);
1166 push(@err, [3, gettext('projent line too long')]);
1172 return (0, $projent);