Skip to content

Commit 2391fd3

Browse files
committed
Change capitalization to Zstandard
1 parent 895e9e3 commit 2391fd3

22 files changed

+317
-317
lines changed

src/libraries/Common/src/Interop/Interop.Zstd.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@ internal static partial class Zstd
1212
{
1313
// Compression context management
1414
[LibraryImport(Libraries.CompressionNative)]
15-
internal static partial SafeZStdCompressHandle ZSTD_createCCtx();
15+
internal static partial SafeZstdCompressHandle ZSTD_createCCtx();
1616

1717
[LibraryImport(Libraries.CompressionNative)]
1818
internal static partial nuint ZSTD_freeCCtx(IntPtr cctx);
1919

2020
[LibraryImport(Libraries.CompressionNative)]
21-
internal static partial SafeZStdDecompressHandle ZSTD_createDCtx();
21+
internal static partial SafeZstdDecompressHandle ZSTD_createDCtx();
2222

2323
[LibraryImport(Libraries.CompressionNative)]
2424
internal static partial nuint ZSTD_freeDCtx(IntPtr dctx);
2525

2626
// Dictionary management
2727
[LibraryImport(Libraries.CompressionNative)]
28-
internal static partial SafeZStdCDictHandle ZSTD_createCDict(IntPtr dictBuffer, nuint dictSize, int compressionLevel);
28+
internal static partial SafeZstdCDictHandle ZSTD_createCDict(IntPtr dictBuffer, nuint dictSize, int compressionLevel);
2929

3030
[LibraryImport(Libraries.CompressionNative)]
3131
internal static partial nuint ZSTD_freeCDict(IntPtr cdict);
3232

3333
[LibraryImport(Libraries.CompressionNative)]
34-
internal static partial SafeZStdDDictHandle ZSTD_createDDict(IntPtr dictBuffer, nuint dictSize);
34+
internal static partial SafeZstdDDictHandle ZSTD_createDDict(IntPtr dictBuffer, nuint dictSize);
3535

3636
[LibraryImport(Libraries.CompressionNative)]
3737
internal static partial nuint ZSTD_freeDDict(IntPtr ddict);
@@ -44,40 +44,40 @@ internal static partial class Zstd
4444
internal static partial nuint ZSTD_compress(IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize, int compressionLevel);
4545

4646
[LibraryImport(Libraries.CompressionNative)]
47-
internal static partial nuint ZSTD_compressCCtx(SafeZStdCompressHandle cctx, IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize, int compressionLevel);
47+
internal static partial nuint ZSTD_compressCCtx(SafeZstdCompressHandle cctx, IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize, int compressionLevel);
4848

4949
[LibraryImport(Libraries.CompressionNative)]
50-
internal static partial nuint ZSTD_compress_usingCDict(SafeZStdCompressHandle cctx, IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize, SafeZStdCDictHandle cdict);
50+
internal static partial nuint ZSTD_compress_usingCDict(SafeZstdCompressHandle cctx, IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize, SafeZstdCDictHandle cdict);
5151

5252
// Decompression functions
5353
[LibraryImport(Libraries.CompressionNative)]
5454
internal static partial nuint ZSTD_decompress(IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize);
5555

5656
[LibraryImport(Libraries.CompressionNative)]
57-
internal static partial nuint ZSTD_decompressDCtx(SafeZStdDecompressHandle dctx, IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize);
57+
internal static partial nuint ZSTD_decompressDCtx(SafeZstdDecompressHandle dctx, IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize);
5858

5959
[LibraryImport(Libraries.CompressionNative)]
60-
internal static partial nuint ZSTD_decompress_usingDDict(SafeZStdDecompressHandle dctx, IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize, SafeZStdDDictHandle ddict);
60+
internal static partial nuint ZSTD_decompress_usingDDict(SafeZstdDecompressHandle dctx, IntPtr dst, nuint dstCapacity, IntPtr src, nuint srcSize, SafeZstdDDictHandle ddict);
6161

6262
[LibraryImport(Libraries.CompressionNative)]
6363
internal static partial ulong ZSTD_getFrameContentSize(IntPtr src, nuint srcSize);
6464

6565
// Streaming decompression
6666
[LibraryImport(Libraries.CompressionNative)]
67-
internal static partial nuint ZSTD_decompressStream(SafeZStdDecompressHandle dctx, ref ZStdOutBuffer output, ref ZStdInBuffer input);
67+
internal static partial nuint ZSTD_decompressStream(SafeZstdDecompressHandle dctx, ref ZstdOutBuffer output, ref ZstdInBuffer input);
6868

6969
[LibraryImport(Libraries.CompressionNative)]
70-
internal static partial nuint ZSTD_DCtx_reset(SafeZStdDecompressHandle dctx, ZStdResetDirective reset);
70+
internal static partial nuint ZSTD_DCtx_reset(SafeZstdDecompressHandle dctx, ZstdResetDirective reset);
7171

7272
// Streaming compression
7373
[LibraryImport(Libraries.CompressionNative)]
74-
internal static partial nuint ZSTD_compressStream2(SafeZStdCompressHandle cctx, ref ZStdOutBuffer output, ref ZStdInBuffer input, ZStdEndDirective endOp);
74+
internal static partial nuint ZSTD_compressStream2(SafeZstdCompressHandle cctx, ref ZstdOutBuffer output, ref ZstdInBuffer input, ZstdEndDirective endOp);
7575

7676
[LibraryImport(Libraries.CompressionNative)]
77-
internal static partial nuint ZSTD_CCtx_setParameter(SafeZStdCompressHandle cctx, ZStdCParameter param, int value);
77+
internal static partial nuint ZSTD_CCtx_setParameter(SafeZstdCompressHandle cctx, ZstdCParameter param, int value);
7878

7979
[LibraryImport(Libraries.CompressionNative)]
80-
internal static partial nuint ZSTD_CCtx_reset(SafeZStdCompressHandle cctx, ZStdResetDirective reset);
80+
internal static partial nuint ZSTD_CCtx_reset(SafeZstdCompressHandle cctx, ZstdResetDirective reset);
8181

8282
// Compression level functions
8383
[LibraryImport(Libraries.CompressionNative)]
@@ -98,20 +98,20 @@ internal static partial class Zstd
9898

9999
// Dictionary context functions
100100
[LibraryImport(Libraries.CompressionNative)]
101-
internal static partial nuint ZSTD_DCtx_refDDict(SafeZStdDecompressHandle dctx, SafeZStdDDictHandle ddict);
101+
internal static partial nuint ZSTD_DCtx_refDDict(SafeZstdDecompressHandle dctx, SafeZstdDDictHandle ddict);
102102

103103
[LibraryImport(Libraries.CompressionNative)]
104-
internal static partial nuint ZSTD_CCtx_refCDict(SafeZStdCompressHandle cctx, SafeZStdCDictHandle cdict);
104+
internal static partial nuint ZSTD_CCtx_refCDict(SafeZstdCompressHandle cctx, SafeZstdCDictHandle cdict);
105105

106106
// Enums and structures for streaming
107-
internal enum ZStdEndDirective
107+
internal enum ZstdEndDirective
108108
{
109109
ZSTD_e_continue = 0,
110110
ZSTD_e_flush = 1,
111111
ZSTD_e_end = 2
112112
}
113113

114-
internal enum ZStdCParameter
114+
internal enum ZstdCParameter
115115
{
116116
ZSTD_c_compressionLevel = 100,
117117
ZSTD_c_windowLog = 101,
@@ -123,23 +123,23 @@ internal enum ZStdCParameter
123123
ZSTD_c_strategy = 107
124124
}
125125

126-
internal enum ZStdResetDirective
126+
internal enum ZstdResetDirective
127127
{
128128
ZSTD_reset_session_only = 1,
129129
ZSTD_reset_parameters = 2,
130130
ZSTD_reset_session_and_parameters = 3
131131
}
132132

133133
[StructLayout(LayoutKind.Sequential)]
134-
internal struct ZStdInBuffer
134+
internal struct ZstdInBuffer
135135
{
136136
internal IntPtr src;
137137
internal nuint size;
138138
internal nuint pos;
139139
}
140140

141141
[StructLayout(LayoutKind.Sequential)]
142-
internal struct ZStdOutBuffer
142+
internal struct ZstdOutBuffer
143143
{
144144
internal IntPtr dst;
145145
internal nuint size;
@@ -152,9 +152,9 @@ public ZstdNativeException(string message) : base(message) { }
152152

153153
public static void ThrowIfError(nuint result, string message)
154154
{
155-
if (ZStandardUtils.IsError(result))
155+
if (ZstandardUtils.IsError(result))
156156
{
157-
throw new ZstdNativeException(SR.Format(message, ZStandardUtils.GetErrorMessage(result)));
157+
throw new ZstdNativeException(SR.Format(message, ZstandardUtils.GetErrorMessage(result)));
158158
}
159159
}
160160
}

src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeZStdHandle.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
namespace Microsoft.Win32.SafeHandles
99
{
10-
internal sealed class SafeZStdCompressHandle : SafeHandle
10+
internal sealed class SafeZstdCompressHandle : SafeHandle
1111
{
12-
internal SafeZStdCDictHandle? _dictionary;
13-
public SafeZStdCompressHandle() : base(IntPtr.Zero, true) { }
12+
internal SafeZstdCDictHandle? _dictionary;
13+
public SafeZstdCompressHandle() : base(IntPtr.Zero, true) { }
1414

1515
protected override bool ReleaseHandle()
1616
{
@@ -21,7 +21,7 @@ protected override bool ReleaseHandle()
2121
return true;
2222
}
2323

24-
public void SetDictionary(SafeZStdCDictHandle dictionary)
24+
public void SetDictionary(SafeZstdCDictHandle dictionary)
2525
{
2626
Debug.Assert(dictionary != null);
2727

@@ -32,17 +32,17 @@ public void SetDictionary(SafeZStdCDictHandle dictionary)
3232
nuint result = Interop.Zstd.ZSTD_CCtx_refCDict(this, dictionary);
3333
if (Interop.Zstd.ZSTD_isError(result) != 0)
3434
{
35-
throw new Interop.Zstd.ZstdNativeException(SR.ZStandardEncoder_DictionaryAttachFailed);
35+
throw new Interop.Zstd.ZstdNativeException(SR.ZstandardEncoder_DictionaryAttachFailed);
3636
}
3737
}
3838

3939
public override bool IsInvalid => handle == IntPtr.Zero;
4040
}
4141

42-
internal sealed class SafeZStdDecompressHandle : SafeHandle
42+
internal sealed class SafeZstdDecompressHandle : SafeHandle
4343
{
44-
internal SafeZStdDDictHandle? _dictionary;
45-
public SafeZStdDecompressHandle() : base(IntPtr.Zero, true) { }
44+
internal SafeZstdDDictHandle? _dictionary;
45+
public SafeZstdDecompressHandle() : base(IntPtr.Zero, true) { }
4646

4747
protected override bool ReleaseHandle()
4848
{
@@ -53,7 +53,7 @@ protected override bool ReleaseHandle()
5353
return true;
5454
}
5555

56-
public void SetDictionary(SafeZStdDDictHandle dictionary)
56+
public void SetDictionary(SafeZstdDDictHandle dictionary)
5757
{
5858
Debug.Assert(dictionary != null);
5959

@@ -64,16 +64,16 @@ public void SetDictionary(SafeZStdDDictHandle dictionary)
6464
nuint result = Interop.Zstd.ZSTD_DCtx_refDDict(this, dictionary);
6565
if (Interop.Zstd.ZSTD_isError(result) != 0)
6666
{
67-
throw new Interop.Zstd.ZstdNativeException(SR.ZStandardDecoder_DictionaryAttachFailed);
67+
throw new Interop.Zstd.ZstdNativeException(SR.ZstandardDecoder_DictionaryAttachFailed);
6868
}
6969
}
7070

7171
public override bool IsInvalid => handle == IntPtr.Zero;
7272
}
7373

74-
internal sealed class SafeZStdCDictHandle : SafeHandle
74+
internal sealed class SafeZstdCDictHandle : SafeHandle
7575
{
76-
public SafeZStdCDictHandle() : base(IntPtr.Zero, true) { }
76+
public SafeZstdCDictHandle() : base(IntPtr.Zero, true) { }
7777

7878
protected override bool ReleaseHandle()
7979
{
@@ -86,9 +86,9 @@ protected override bool ReleaseHandle()
8686
public override bool IsInvalid => handle == IntPtr.Zero;
8787
}
8888

89-
internal sealed class SafeZStdDDictHandle : SafeHandle
89+
internal sealed class SafeZstdDDictHandle : SafeHandle
9090
{
91-
public SafeZStdDDictHandle() : base(IntPtr.Zero, true) { }
91+
public SafeZstdDDictHandle() : base(IntPtr.Zero, true) { }
9292

9393
protected override bool ReleaseHandle()
9494
{

src/libraries/System.IO.Compression.ZStandard/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# System.IO.Compression.ZStandard
1+
# System.IO.Compression.Zstandard
22

3-
This library provides support for ZStandard compression and decompression operations in .NET. ZStandard (zstd) is a fast compression algorithm that provides high compression ratios and is particularly effective for real-time compression scenarios.
3+
This library provides support for Zstandard compression and decompression operations in .NET. Zstandard (zstd) is a fast compression algorithm that provides high compression ratios and is particularly effective for real-time compression scenarios.
44

55
## Features
66

7-
- **ZStandardStream**: A stream-based API for compressing and decompressing data using the ZStandard algorithm
8-
- **ZStandardOptions**: Configuration options for controlling compression parameters including compression level
7+
- **ZstandardStream**: A stream-based API for compressing and decompressing data using the Zstandard algorithm
8+
- **ZstandardOptions**: Configuration options for controlling compression parameters including compression level
99
- **High Performance**: Optimized for both compression ratio and speed
1010
- **Wide Compression Level Range**: Supports compression levels from negative values (faster, less compression) to 22 (slower, better compression)
1111

@@ -15,18 +15,18 @@ This library provides support for ZStandard compression and decompression operat
1515
// Compression
1616
using var input = new FileStream("input.txt", FileMode.Open);
1717
using var output = new FileStream("compressed.zst", FileMode.Create);
18-
using var zstdStream = new ZStandardStream(output, CompressionMode.Compress);
18+
using var zstdStream = new ZstandardStream(output, CompressionMode.Compress);
1919
input.CopyTo(zstdStream);
2020

2121
// Decompression
2222
using var compressed = new FileStream("compressed.zst", FileMode.Open);
2323
using var decompressed = new FileStream("output.txt", FileMode.Create);
24-
using var zstdStream = new ZStandardStream(compressed, CompressionMode.Decompress);
24+
using var zstdStream = new ZstandardStream(compressed, CompressionMode.Decompress);
2525
zstdStream.CopyTo(decompressed);
2626

2727
// Using custom options
28-
var options = new ZStandardOptions { CompressionLevel = 9 };
29-
using var zstdStream = new ZStandardStream(output, options, CompressionMode.Compress);
28+
var options = new ZstandardOptions { CompressionLevel = 9 };
29+
using var zstdStream = new ZstandardStream(output, options, CompressionMode.Compress);
3030
```
3131

3232
## Platform Support

src/libraries/System.IO.Compression.ZStandard/System.IO.Compression.ZStandard.slnx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<Build Solution="Checked|x64" Project="false" />
125125
<Build Solution="Checked|x86" Project="false" />
126126
</Project>
127-
<Project Path="ref/System.IO.Compression.ZStandard.csproj">
127+
<Project Path="ref/System.IO.Compression.Zstandard.csproj">
128128
<BuildType Solution="Checked|*" Project="Debug" />
129129
<Build Solution="*|arm" Project="false" />
130130
<Build Solution="*|arm64" Project="false" />
@@ -213,7 +213,7 @@
213213
<Build Solution="Checked|x64" Project="false" />
214214
<Build Solution="Checked|x86" Project="false" />
215215
</Project>
216-
<Project Path="src/System.IO.Compression.ZStandard.csproj">
216+
<Project Path="src/System.IO.Compression.Zstandard.csproj">
217217
<BuildType Solution="Checked|*" Project="Debug" />
218218
<Build Solution="*|arm" Project="false" />
219219
<Build Solution="*|arm64" Project="false" />
@@ -239,7 +239,7 @@
239239
<Build Solution="Checked|x64" Project="false" />
240240
<Build Solution="Checked|x86" Project="false" />
241241
</Project>
242-
<Project Path="tests/System.IO.Compression.ZStandard.Tests.csproj">
242+
<Project Path="tests/System.IO.Compression.Zstandard.Tests.csproj">
243243
<BuildType Solution="Checked|*" Project="Debug" />
244244
<Build Solution="*|arm" Project="false" />
245245
<Build Solution="*|arm64" Project="false" />

0 commit comments

Comments
 (0)