diff --git a/src/HighballConfig.pp b/src/HighballConfig.pp index a28c060..e54cbb7 100644 --- a/src/HighballConfig.pp +++ b/src/HighballConfig.pp @@ -3,42 +3,42 @@ interface type THighballConfig = record - ServerPort : Integer; - ServerURL : String; - ServerName : String; - ServerDescription : String; - UserAllowRegister : Boolean; - DatabasePath : String; - DatabaseHostname : String; - DatabaseUsername : String; - DatabasePassword : String; - DatabaseDatabase : String; + ServerPort: Integer; + ServerURL: String; + ServerName: String; + ServerDescription: String; + UserAllowRegister: Boolean; + DatabasePath: String; + DatabaseHostname: String; + DatabaseUsername: String; + DatabasePassword: String; + DatabaseDatabase: String; end; var - HighballParsedConfig : THighballConfig = ( - ServerPort : -1; - ServerURL : ''; - ServerName : ''; - ServerDescription : ''; - UserAllowRegister : False; - DatabasePath : ''; - DatabaseHostname : ''; - DatabaseUsername : ''; - DatabasePassword : ''; - DatabaseDatabase : ''; + HighballParsedConfig: THighballConfig = ( + ServerPort: -1; + ServerURL: ''; + ServerName: ''; + ServerDescription: ''; + UserAllowRegister: False; + DatabasePath: ''; + DatabaseHostname: ''; + DatabaseUsername: ''; + DatabasePassword: ''; + DatabaseDatabase: ''; ); -function HighballParseConfig(ConfPath : String) : Integer; -function HighballCheckConfig() : Integer; +function HighballParseConfig(ConfPath: String): Integer; +function HighballCheckConfig(): Integer; implementation uses IniFiles; -function HighballParseConfig(ConfPath : String) : Integer; +function HighballParseConfig(ConfPath: String): Integer; var - INI : TINIFile; + INI: TINIFile; begin HighballParseConfig := 0; INI := TINIFile.Create(ConfPath); @@ -60,7 +60,7 @@ function HighballParseConfig(ConfPath : String) : Integer; INI.Free(); end; -function HighballCheckConfig() : Integer; +function HighballCheckConfig(): Integer; begin HighballCheckConfig := -1; if HighballParsedConfig.ServerPort = -1 then diff --git a/src/HighballDatabase.pp b/src/HighballDatabase.pp index 5795316..b3c6bdd 100644 --- a/src/HighballDatabase.pp +++ b/src/HighballDatabase.pp @@ -9,7 +9,7 @@ implementation procedure HighballDatabaseInit(); var - DB : THighballDB; + DB: THighballDB; begin DB := THighballDB.Create(); DB.ExecuteDirect('CREATE TABLE IF NOT EXISTS users(username text, password text, created_at bigint, updated_at bigint, admin boolean)'); diff --git a/src/HighballServer.pp b/src/HighballServer.pp index 2e4b852..0878de0 100644 --- a/src/HighballServer.pp +++ b/src/HighballServer.pp @@ -1,7 +1,7 @@ unit HighballServer; interface -function HighballServerStart() : Integer; +function HighballServerStart(): Integer; implementation uses @@ -14,7 +14,7 @@ implementation HBWellKnown, HBNodeinfo; -function HighballServerStart() : Integer; +function HighballServerStart(): Integer; begin HighballServerStart := 0; diff --git a/src/HighballUtils.pp b/src/HighballUtils.pp index a394b0d..b9f4cbf 100644 --- a/src/HighballUtils.pp +++ b/src/HighballUtils.pp @@ -1,20 +1,20 @@ unit HighballUtils; interface -function HighballIsArg(Argument : String; ExpShort : String; ExpLong : String) : Boolean; -function HighballHasArgPrefix(Argument : String) : Boolean; -function HighballJSONEmpty(JSON : String) : Boolean; +function HighballIsArg(Argument: String; ExpShort: String; ExpLong: String): Boolean; +function HighballHasArgPrefix(Argument: String): Boolean; +function HighballJSONEmpty(JSON: String): Boolean; implementation uses Sysutils; -function HighballIsArg(Argument: String; ExpShort: String; ExpLong: String) : Boolean; +function HighballIsArg(Argument: String; ExpShort: String; ExpLong: String): Boolean; begin HighballIsArg := (('-' + ExpShort) = Argument) or (('--' + ExpLong) = Argument); end; -function HighballHasArgPrefix(Argument: String) : Boolean; +function HighballHasArgPrefix(Argument: String): Boolean; begin HighballHasArgPrefix := False; if Length(Argument) > 0 then begin @@ -24,7 +24,7 @@ function HighballHasArgPrefix(Argument: String) : Boolean; end; end; -function HighballJSONEmpty(JSON : String) : Boolean; +function HighballJSONEmpty(JSON: String) : Boolean; begin HighballJSONEmpty := Length(Trim(JSON)) = 2; end; diff --git a/src/HighballVersion.pp b/src/HighballVersion.pp index 3ebe44c..e56e6cd 100644 --- a/src/HighballVersion.pp +++ b/src/HighballVersion.pp @@ -3,26 +3,26 @@ interface type THighballVersion = record - Major : Integer; - Minor : Integer; - Patch : Integer; + Major: Integer; + Minor: Integer; + Patch: Integer; end; const - HighballVersionRaw : THighballVersion = ( + HighballVersionRaw: THighballVersion = ( (* DO NOT REMOVE COMMENTS!! - THEY ARE USED INTERNALLY *) Major : 0; (* MAJOR *) Minor : 0; (* MINOR *) Patch : 0; (* PATCH *) ); -function HighballGetVersion() : String; +function HighballGetVersion(): String; implementation uses Sysutils; -function HighballGetVersion() : String; +function HighballGetVersion(): String; begin HighballGetVersion := IntToStr(HighballVersionRaw.Major) + '.' + IntToStr(HighballVersionRaw.Minor) + '.' diff --git a/src/class/HBDatabase.pp b/src/class/HBDatabase.pp index 90f67c8..b57b198 100644 --- a/src/class/HBDatabase.pp +++ b/src/class/HBDatabase.pp @@ -20,13 +20,13 @@ interface {$endif} THighballDB = class protected - Connection : THighballDBConnection; - Transaction : TSQLTransaction; + Connection: THighballDBConnection; + Transaction: TSQLTransaction; public constructor Create(); destructor Destroy(); override; - procedure ExecuteDirect(Query : String); + procedure ExecuteDirect(Query: String); end; THighballDBPointer = ^THighballDB; @@ -59,7 +59,7 @@ destructor THighballDB.Destroy(); inherited; end; -procedure THighballDB.ExecuteDirect(Query : String); +procedure THighballDB.ExecuteDirect(Query: String); begin Connection.ExecuteDirect(Query); Transaction.Commit(); diff --git a/src/class/HBRoute.pp b/src/class/HBRoute.pp index 5498632..096bd57 100644 --- a/src/class/HBRoute.pp +++ b/src/class/HBRoute.pp @@ -8,10 +8,10 @@ interface type TRouteBase = class protected - RouteReq : TRequest; - RouteRes : TResponse; - RouteJSON : TJSONObject; - DefaultProcess : Boolean; + RouteReq: TRequest; + RouteRes: TResponse; + RouteJSON: TJSONObject; + DefaultProcess: Boolean; procedure Before(); procedure Job(); virtual; abstract; diff --git a/src/highball.pp b/src/highball.pp index 502b5b9..3ab049d 100644 --- a/src/highball.pp +++ b/src/highball.pp @@ -15,9 +15,9 @@ HighballDatabase, HighballPathnames; -function ParseArgs() : Integer; +function ParseArgs(): Integer; var - ArgI : Integer; + ArgI: Integer; begin ParseArgs := -1; for ArgI := 1 to ParamCount do @@ -35,7 +35,7 @@ function ParseArgs() : Integer; end; var - ResultFunc : Integer; + ResultFunc: Integer; begin WriteLn('Highball - ActivityPub server in Pascal, version ' + HighballGetVersion()); WriteLn('Copyright (c) 2025 Nishi & Contributors'); diff --git a/src/route/HBDefault.pp b/src/route/HBDefault.pp index 721ff35..9f96708 100644 --- a/src/route/HBDefault.pp +++ b/src/route/HBDefault.pp @@ -11,7 +11,7 @@ TRouteDefault = class(TRouteBase) end; var - RouteDefault : TRouteDefault; + RouteDefault: TRouteDefault; implementation uses diff --git a/src/route/HBNodeinfo.pp b/src/route/HBNodeinfo.pp index 0936533..49680a5 100644 --- a/src/route/HBNodeinfo.pp +++ b/src/route/HBNodeinfo.pp @@ -11,7 +11,7 @@ TRouteNodeinfo = class(TRouteBase) end; var - RouteNodeinfo : TRouteNodeinfo; + RouteNodeinfo: TRouteNodeinfo; implementation uses @@ -21,7 +21,7 @@ implementation procedure TRouteNodeinfo.Job(); var - EPName : String; + EPName: String; begin EPName := RouteReq.RouteParams['name']; if (EPName = '2.0') or (EPName = '2.1') then diff --git a/src/route/HBWellKnown.pp b/src/route/HBWellKnown.pp index 7a34126..ec52b31 100644 --- a/src/route/HBWellKnown.pp +++ b/src/route/HBWellKnown.pp @@ -11,7 +11,7 @@ TRouteWellKnown = class(TRouteBase) end; var - RouteWellKnown : TRouteWellKnown; + RouteWellKnown: TRouteWellKnown; implementation uses @@ -20,7 +20,7 @@ implementation procedure TRouteWellKnown.Job(); var - EPName : String; + EPName: String; begin EPName := RouteReq.RouteParams['name']; if EPName = 'nodeinfo' then