diff --git a/app/api/device-status.prg b/app/api/device-status.prg index d581a77..d0ebcc7 100644 --- a/app/api/device-status.prg +++ b/app/api/device-status.prg @@ -63,7 +63,7 @@ FUNCTION Main() AP_JSONRESPONSE(hOut) RETURN NIL -FUNCTION device_status_fn_hget(h, k, xDefault) +STATIC FUNCTION fn_HGet(h, k, xDefault) IF xDefault == NIL ; xDefault := "" ; ENDIF IF HB_ISHASH(h) .AND. hb_HHasKey(h, k) .AND. h[k] != NIL RETURN h[k] diff --git a/app/api/record-detail.prg b/app/api/record-detail.prg index 8150630..c6c1396 100644 --- a/app/api/record-detail.prg +++ b/app/api/record-detail.prg @@ -20,6 +20,6 @@ FUNCTION Main() }) RETURN NIL -FUNCTION record_detail_fn_hget(h, k) +STATIC FUNCTION fn_HGet(h, k) IF HB_ISHASH(h) .AND. hb_HHasKey(h, k) ; RETURN h[k] ; ENDIF RETURN "" diff --git a/app/api/records-list.prg b/app/api/records-list.prg index 891cea3..eca32cf 100644 --- a/app/api/records-list.prg +++ b/app/api/records-list.prg @@ -47,6 +47,6 @@ FUNCTION Main() }) RETURN NIL -FUNCTION records_list_fn_hget(h, k) +STATIC FUNCTION fn_HGet(h, k) IF HB_ISHASH(h) .AND. hb_HHasKey(h, k) ; RETURN h[k] ; ENDIF RETURN "" diff --git a/app/api/session-detail.prg b/app/api/session-detail.prg index 05c41d1..6036238 100644 --- a/app/api/session-detail.prg +++ b/app/api/session-detail.prg @@ -26,6 +26,6 @@ FUNCTION Main() }) RETURN NIL -FUNCTION session_detail_fn_hget(h, k) +STATIC FUNCTION fn_HGet(h, k) IF HB_ISHASH(h) .AND. hb_HHasKey(h, k) ; RETURN h[k] ; ENDIF RETURN "" diff --git a/app/api/session-export.prg b/app/api/session-export.prg index b0eaf73..c5f34a1 100644 --- a/app/api/session-export.prg +++ b/app/api/session-export.prg @@ -74,7 +74,7 @@ FUNCTION Main() AP_RPUTS(cBOM + fn_Join(aLines, cCRLF)) RETURN NIL -FUNCTION session_export_fn_hget(h, k) +STATIC FUNCTION fn_HGet(h, k) IF HB_ISHASH(h) .AND. hb_HHasKey(h, k) ; RETURN h[k] ; ENDIF RETURN "" diff --git a/app/api/session-stats.prg b/app/api/session-stats.prg index 91f64e3..fb2cb26 100644 --- a/app/api/session-stats.prg +++ b/app/api/session-stats.prg @@ -129,6 +129,6 @@ FUNCTION Main() RETURN NIL -FUNCTION session_stats_fn_hget(h, k) +STATIC FUNCTION fn_HGet(h, k) IF HB_ISHASH(h) .AND. hb_HHasKey(h, k) ; RETURN h[k] ; ENDIF RETURN NIL diff --git a/app/api/sessions-list.prg b/app/api/sessions-list.prg index 123347e..20b49e2 100644 --- a/app/api/sessions-list.prg +++ b/app/api/sessions-list.prg @@ -41,7 +41,7 @@ FUNCTION Main() RETURN NIL // Safe hash get (returns "" for missing key) -FUNCTION sessions_list_fn_hget(hHash, cKey) +STATIC FUNCTION fn_HGet(hHash, cKey) IF HB_ISHASH(hHash) .AND. hb_HHasKey(hHash, cKey) RETURN hHash[ cKey ] ENDIF diff --git a/app/bridge/bridge_request.prg b/app/bridge/bridge_request.prg index 59c9e37..9ed3f39 100644 --- a/app/bridge/bridge_request.prg +++ b/app/bridge/bridge_request.prg @@ -108,26 +108,37 @@ RETURN AP_HEADERSOUTSET( "Content-Type", cType ) // ── Output ── -// fivenode_go patch: collapsed (...) -> single arg. Five's PValue returns -// the caller's LOCALs rather than the actual variadic args (declared -// params are 0 for `(...)`, so the runtime never copies args into the -// locals slot PValue reads). Every call site in this codebase passes -// exactly one value, so the collapse is behaviour-preserving. -// TODO: revert once Five gains true variadic PValue support. -FUNCTION AP_RPUTS( u ) - IF ValType( u ) == "C" - bridge_output_append( u ) - ELSE - bridge_output_append( fn_ValToChar( u ) ) - ENDIF +FUNCTION AP_RPUTS( ... ) + + LOCAL n, u + + FOR n := 1 TO PCount() + u := PValue( n ) + IF ValType( u ) == "C" + bridge_output_append( u ) + ELSE + bridge_output_append( fn_ValToChar( u ) ) + ENDIF + NEXT + RETURN NIL -FUNCTION AP_ECHO( u ) - IF ValType( u ) == "C" - bridge_output_append( u ) - ELSEIF ValType( u ) != "U" - bridge_output_append( fn_ValToChar( u ) ) - ENDIF +FUNCTION AP_ECHO( ... ) + + LOCAL n, u + + FOR n := 1 TO PCount() + u := PValue( n ) + IF ValType( u ) == "C" + bridge_output_append( u ) + ELSEIF ValType( u ) != "U" + bridge_output_append( fn_ValToChar( u ) ) + ENDIF + IF n < PCount() + bridge_output_append( " " ) + ENDIF + NEXT + RETURN NIL // ── Parameter Parsing ──