mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-08-01 08:30:20 +00:00
Place useful parts of the surrounding repos into sica-fondt by layer, per the
body model (Ada = membrane; brain/endocrine/capabilities/knowledge non-Ada):
- brain/ LLM reasoning + providers (dapr, hermes, MoMoA)
- capabilities/ REPRAG sidecars: hermes tools/skills, dapr tools, parallel
dispatch, A51 channels, and the OSINT cluster
- knowledge/ LORAG corpus: 754 cyber-skills, agency personas, secure-coding,
MITRE ATT&CK data
- reference/ defensive threat-reference (C3, shhbruh doc) + AdaYaml parser
License handling: AGPL sources (worldosint, advanced_evolution, mercury,
Reticulum) and GPL DeTTECT are SPEC-only clean-room/port descriptions — no
copyleft code copied. MIT/Apache/data parts copied as working trees.
Safety: shhbruh escape/persistence material and C3 covert-C2 kept as reference
only, not wired into the running organism. See CONSOLIDATION.md.
https://claude.ai/code/session_01UehUqEXXJJCsHoA4voCU5c
79 lines
2.5 KiB
Ada
Executable File
79 lines
2.5 KiB
Ada
Executable File
-- part of AdaYaml, (c) 2017 Felix Krause
|
|
-- released under the terms of the MIT license, see the file "copying.txt"
|
|
|
|
with Ada.Unchecked_Deallocation;
|
|
|
|
package body Yaml.Stacks is
|
|
procedure Adjust (Object : in out Stack) is
|
|
begin
|
|
if Object.Data /= null then
|
|
Object.Data.Refcount := Object.Data.Refcount + 1;
|
|
end if;
|
|
end Adjust;
|
|
|
|
procedure Free_Element_Array is new Ada.Unchecked_Deallocation
|
|
(Element_Array, Element_Array_Access);
|
|
|
|
procedure Finalize (Object : in out Stack) is
|
|
procedure Free_Holder is new Ada.Unchecked_Deallocation
|
|
(Holder, Holder_Access);
|
|
Reference : Holder_Access := Object.Data;
|
|
begin
|
|
Object.Data := null;
|
|
if Reference /= null then
|
|
Reference.Refcount := Reference.Refcount - 1;
|
|
if Reference.Refcount = 0 then
|
|
Free_Element_Array (Reference.Elements);
|
|
Free_Holder (Reference);
|
|
end if;
|
|
end if;
|
|
end Finalize;
|
|
|
|
function New_Stack (Initial_Capacity : Positive) return Stack is
|
|
begin
|
|
return Ret : constant Stack :=
|
|
(Ada.Finalization.Controlled with Data => new Holder) do
|
|
Ret.Data.Elements := new Element_Array (1 .. Initial_Capacity);
|
|
Ret.Data.Length := 0;
|
|
end return;
|
|
end New_Stack;
|
|
|
|
function Top (Object : in out Stack) return access Element_Type is
|
|
(Object.Data.Elements (Object.Data.Length)'Access);
|
|
|
|
function Length (Object : Stack) return Natural is
|
|
(if Object.Data = null then 0 else Object.Data.Length);
|
|
|
|
function Element (Object : Stack; Index : Positive)
|
|
return access Element_Type is
|
|
(Object.Data.Elements (Index)'Access);
|
|
|
|
procedure Pop (Object : in out Stack) is
|
|
begin
|
|
Object.Data.Length := Object.Data.Length - 1;
|
|
end Pop;
|
|
|
|
procedure Push (Object : in out Stack; Value : Element_Type) is
|
|
begin
|
|
if Object.Data = null then
|
|
Object := New_Stack (32);
|
|
end if;
|
|
if Object.Data.Length = Object.Data.Elements.all'Last then
|
|
declare
|
|
New_Array : constant Element_Array_Access :=
|
|
new Element_Array (1 .. Object.Data.Length * 2);
|
|
begin
|
|
New_Array (1 .. Object.Data.Length) := Object.Data.Elements.all;
|
|
Free_Element_Array (Object.Data.Elements);
|
|
Object.Data.Elements := New_Array;
|
|
end;
|
|
end if;
|
|
Object.Data.Length := Object.Data.Length + 1;
|
|
Object.Data.Elements (Object.Data.Length) := Value;
|
|
end Push;
|
|
|
|
function Initialized (Object : Stack) return Boolean is
|
|
(Object.Data /= null);
|
|
|
|
end Yaml.Stacks;
|