---
title: "gss_add_buffer_set_member(_:_:_:)"
framework: GSS
role: symbol
role_heading: Function
platforms: [iOS 5.0+, iPadOS 5.0+, Mac Catalyst 13.1+, macOS 10.7+, visionOS 1.0+]
path: "gss/gss_add_buffer_set_member(_:_:_:)"
---

# gss_add_buffer_set_member(_:_:_:)

Copies the contents of a buffer into a buffer set.

## Declaration

```swift
func gss_add_buffer_set_member(_ minor_status: UnsafeMutablePointer<OM_uint32>, _ member_buffer: gss_buffer_t, _ buffer_set: UnsafeMutablePointer<gss_buffer_set_t>) -> OM_uint32
```

## Parameters

- `minor_status`: A pointer to the secondary status result that provides additional information in case of failure. Typically, a failure results from an inability to allocate memory, communicated with minor status doc://com.apple.documentation/documentation/Foundation/POSIXError/ENOMEM.
- `member_buffer`: The buffer to copy into the buffer set.
- `buffer_set`: A pointer to a buffer set descriptor reference that receives a copy of the buffer. You can indicate that the buffer set doesn’t yet exist by setting its reference to doc://com.apple.gss/documentation/GSS/GSS_C_NO_BUFFER_SET. In this case, the function creates it first using doc://com.apple.gss/documentation/GSS/gss_create_empty_buffer_set(_:_:). In any case, the buffer is added to the end of the set, and the buffer set’s count parameter incremented.

## Return Value

Return Value A status code set to GSS_S_COMPLETE on success, or GSS_S_FAILURE otherwise. Inspect the minor_status parameter for additional information on failure.

## Discussion

Discussion The function does not add the member_buffer to the buffer set directly. Rather it allocates new memory for a copy of the buffer, which it includes in the buffer set. When you call gss_release_buffer_set(_:_:) later, you deallocate the memory for the buffer set and all of its buffer copies, but this has no effect on the original member_buffer.

## See Also

### Allocation and Deallocation

- [gss_create_empty_buffer_set(_:_:)](gss/gss_create_empty_buffer_set(_:_:).md)
- [gss_release_buffer(_:_:)](gss/gss_release_buffer(_:_:).md)
- [gss_release_buffer_set(_:_:)](gss/gss_release_buffer_set(_:_:).md)
