1
0
mirror of https://github.com/aziascreations/BakaShrot.git synced 2026-11-23 20:58:46 +01:00

Moved the PureBasic version to OldSource/, Started the Rust rewrite in Source/

The rewrite's plan and decisions are in revamp.md. Steps 0 to 10 are done:
the workspace and checks, bakashrot-proto, bakashrot-pki and
bakashrot-cert, bakashrot-config, bakashrot-storage (schema v9), the
server and the client library (every request but replication's,
attachments and retention included), the C DLL with its C, PureBasic and
Python bindings, and the bakashrot tool. Step 11 (replication) is next.

OldSource/ is the old implementation, kept building and passing as the
reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RwFeVTGs2SsufaH6zquzcb
This commit is contained in:
2026-11-14 12:47:40 +01:00
parent d0048b17c8
commit e044fcf359
225 changed files with 21849 additions and 123 deletions
@@ -0,0 +1,86 @@
;{- Code Header
; ==- Basic Info -================================
; Name: BakaShrotResolveIds.pb
; Version: 0.0.1
; Author: Herwin Bozet (NibblePoker)
;
; ==- Compatibility -=============================
; Tested compiler versions:
; * PureBasic 5.73 LTS (Windows x64, Linux x64)
; * PureBasic 6.40 C Backend (Windows x64)
; * PureBasic 6.41 (Linux x64)
; * PureBasic 6.41 C Backend (Linux x64)
;
; ==- Links -=====================================
; GitHub: https://github.com/aziascreations/BakaShrot
;}
; ============================================================================
; BakaShrotResolveIds
;
; Usage: BakaShrotResolveIds <topic|node> <NameOrId> [ClientIni]
; topic|node What to look up.
; NameOrId A name, to get its id on the server, or an id, to get its name.
; ClientIni Identity and server to use, defaults to "client.ini".
;
; Prints the server's id and name for it, as "topic logs = 1". Each server
; can have different ids for the same names. The server only resolves the
; topics the client may push to or read, unless it may query.
; Compile as a console program, exits with 0 on success, 1 on failure.
; ============================================================================
EnableExplicit
XIncludeFile "../Common/ToolClient.pbi"
XIncludeFile "../../Commons/Networking/Names.pbi"
Define Kind.s, Ref.s, IniPath.s, Id.l, Name.s
OpenConsole()
If CountProgramParameters() < 2
PrintN("Usage: BakaShrotResolveIds <topic|node> <NameOrId> [ClientIni]")
ToolConsole_End(1)
EndIf
Kind = LCase(ProgramParameter(0))
If Kind <> "topic" And Kind <> "node"
PrintN("Expected 'topic' or 'node', not '" + ProgramParameter(0) + "'")
ToolConsole_End(1)
EndIf
Ref = ProgramParameter(1)
If Not BakaShrot_IsValidRef(Ref)
PrintN("Invalid " + Kind + " '" + Ref + "', expected a name or an id 0-65535")
ToolConsole_End(1)
EndIf
IniPath = "client.ini"
If CountProgramParameters() > 2
IniPath = ProgramParameter(2)
EndIf
If Not ToolClient_Connect(IniPath)
ToolConsole_End(1)
EndIf
If Kind = "topic"
Id = BakaShrot_ResolveTopic(Ref)
Else
Id = BakaShrot_ResolveNode(Ref)
EndIf
If Id < 0
ToolClient_PrintFailure()
ToolClient_Close()
ToolConsole_End(1)
EndIf
Name = BakaShrot_GetResolvedNameString()
If Name = ""
Name = "(unnamed)"
EndIf
PrintN(Kind + " " + Name + " = " + Str(Id))
ToolClient_Close()
ToolConsole_End(0)
@@ -0,0 +1,5 @@
IDE Options = PureBasic 6.41 (Windows - x64)
CursorPosition = 7
EnableXP
DPIAware
CompileSourceDirectory