Skip to content

Commit

Permalink
thcrap_configure_v3: Remove ThcrapJanssonDll
Browse files Browse the repository at this point in the history
  • Loading branch information
32th-System committed Dec 22, 2024
1 parent 5812515 commit 12c6a54
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions thcrap_configure_v3/ThcrapDll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ public static T stack_json_resolve<T>(string fn)
if (janssonObj == IntPtr.Zero)
return default;

uint bufferSize = ThcrapJanssonDll.json_dumpb(janssonObj, IntPtr.Zero, 0, 0);
uint bufferSize = ThcrapDll.json_dumpb(janssonObj, IntPtr.Zero, 0, 0);
IntPtr bufferPtr = Marshal.AllocHGlobal((int)bufferSize);
ThcrapJanssonDll.json_dumpb(janssonObj, bufferPtr, bufferSize, 0);
ThcrapJanssonDll.json_delete(janssonObj);
ThcrapDll.json_dumpb(janssonObj, bufferPtr, bufferSize, 0);
ThcrapDll.json_delete(janssonObj);

byte[] bufferArray = new byte[bufferSize];
Marshal.Copy(bufferPtr, bufferArray, 0, (int)bufferSize);
Expand Down Expand Up @@ -359,11 +359,6 @@ public static extern int update_filter_global_wrapper(
public static extern int update_filter_games_wrapper(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ThcrapHelper.UTF8StringMarshaler))] string fn,
IntPtr games);
}

class ThcrapJanssonDll
{
public const string DLL = ThcrapDll.THCRAP_DLL_PATH + "jansson" + ThcrapDll.DEBUG_OR_RELEASE + ".dll";
[DllImport(DLL, CallingConvention = CallingConvention.Cdecl)]
public static extern uint json_dumpb(IntPtr /* json_t * */ json, IntPtr /* char* */ buffer, uint size, uint flags);
// Not part of the public jansson API, but json_decref is defined as an inline function
Expand Down

0 comments on commit 12c6a54

Please sign in to comment.