text stringlengths 0 234 |
|---|
-- If inode is moved to outside watched directory, |
-- then there will never be a Moved_To or Moved_Self |
-- if instance is not recursive |
when Moved_To => |
declare |
Cursor : Move_Vectors.Cursor := Find_Move (Event.Cookie); |
use type Move_Vectors.Cursor; |
begin |
if Cursor /= Move_Vectors.No_Element then |
-- It's a rename |
Move_Handle |
(Subject => (Watch => Event.Watch), |
Is_Directory => Mask.Is_Directory, |
From => SU.To_String |
(Object.Moves (Cursor).Value.From), |
To => Directory & "/" & Name); |
Object.Moves.Delete (Cursor); |
else |
Move_Handle |
(Subject => (Watch => Event.Watch), |
Is_Directory => Mask.Is_Directory, |
From => "", |
To => Directory & "/" & Name); |
end if; |
Function Definition: procedure Main is |
Function Body: task type Sieve is |
entry Pass_On(Int: Integer); |
end Sieve; |
type Sieve_Ptr is access Sieve; |
function Get_New_Sieve return Sieve_Ptr is |
begin |
return new Sieve; |
end Get_New_Sieve; |
task Odd; |
task body Odd is |
Limit : constant Positive := 1000; |
Num: Positive; |
S: Sieve_Ptr := Get_New_Sieve; |
begin |
Num := 3; |
while Num < Limit loop |
S.Pass_On(Num); |
Num := Num + 2; |
end loop; |
end Odd; |
task body Sieve is |
New_Sieve : Sieve_Ptr; |
Prime, Num: Natural; |
begin |
accept Pass_On(Int : Integer) do |
Prime := Int; |
end Pass_On; |
Text_IO.Put(Prime'Img & ", "); |
-- Prime is a prime number, which coud be output |
loop |
accept Pass_On(Int : Integer) do |
Num := Int; |
end Pass_On; |
exit when Num rem Prime /= 0; |
end loop; |
New_Sieve := Get_New_Sieve; |
New_Sieve.Pass_On(Num); |
loop |
accept Pass_On (Int : Integer) do |
Num := Int; |
end Pass_On; |
if Num rem Prime /= 0 then |
New_Sieve.Pass_On(Num); |
end if; |
end loop; |
end Sieve; |
begin |
null; |
Function Definition: procedure Toggle_LedR is |
Function Body: begin |
null; |
Function Definition: procedure Toggle_LedL is |
Function Body: begin |
null; |
Function Definition: procedure Off_LedR is |
Function Body: begin |
null; |
Function Definition: procedure Off_LedL is |
Function Body: begin |
null; |
Function Definition: procedure Main is |
Function Body: --pragma Priority(Priority'Last); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.