Skip to content

Commit

Permalink
Whatlang: fixes for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gluschenko committed Nov 8, 2024
1 parent b7fe3c6 commit fc6e296
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
"profiles": {
"Docker": {
"commandName": "Docker"
},
"WSL": {
"commandName": "WSL2",
"distributionName": ""
},
"Project": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
1 change: 1 addition & 0 deletions src/LanguageIdentification.Whatlang.Native/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
libwhatlang.so
libwhatlang.arm64.dylib
libwhatlang.x86_64.dylib
whatlang.dll
build_temp/**
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,42 @@ internal static class WhatlangDetectorWrapper
{
[DllImport(WhatlangNativeLibrary.Name, EntryPoint = "whatlang_detect", CallingConvention = CallingConvention.Cdecl)]
public static extern WhatlangStatus WhatlangDetect(
string text,
[MarshalAs(UnmanagedType.LPUTF8Str)] string text,
out WhatlangPredictionResult result
);

[DllImport(WhatlangNativeLibrary.Name, EntryPoint = "whatlang_detectn", CallingConvention = CallingConvention.Cdecl)]
public static extern WhatlangStatus WhatlangDetectN(
string text,
[MarshalAs(UnmanagedType.LPUTF8Str)] string text,
int len,
out WhatlangPredictionResult info
);

[DllImport(WhatlangNativeLibrary.Name, EntryPoint = "whatlang_lang_code", CallingConvention = CallingConvention.Cdecl)]
public static extern int WhatlangLangCode(
WhatlangLanguage lang,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder buffer,
[MarshalAs(UnmanagedType.LPUTF8Str)] StringBuilder buffer,
UIntPtr bufferSize
);

[DllImport(WhatlangNativeLibrary.Name, EntryPoint = "whatlang_lang_eng_name", CallingConvention = CallingConvention.Cdecl)]
public static extern int WhatlangLangEngName(
WhatlangLanguage lang,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder buffer,
[MarshalAs(UnmanagedType.LPUTF8Str)] StringBuilder buffer,
UIntPtr bufferSize
);

[DllImport(WhatlangNativeLibrary.Name, EntryPoint = "whatlang_lang_name", CallingConvention = CallingConvention.Cdecl)]
public static extern int WhatlangLangName(
WhatlangLanguage lang,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder buffer,
[MarshalAs(UnmanagedType.LPUTF8Str)] StringBuilder buffer,
UIntPtr bufferSize
);

[DllImport(WhatlangNativeLibrary.Name, EntryPoint = "whatlang_script_name", CallingConvention = CallingConvention.Cdecl)]
public static extern int WhatlangScriptName(
WhatlangScript script,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder buffer,
[MarshalAs(UnmanagedType.LPUTF8Str)] StringBuilder buffer,
UIntPtr bufferSize
);
}
Expand Down

0 comments on commit fc6e296

Please sign in to comment.