# I/O

**API Group:** `xmlsec_core_io`

Input/output helper functions.

Input/output functions.

## Macros

### `xmlSecTransformInputURIId`

*Defined as:* `xmlSecTransformInputURIGetKlass()`

*Source:* [include/xmlsec/io.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/io.h#L39)

The Input URI transform id.

---

## Functions

### `xmlSecIOInit`

```c
int xmlSecIOInit(void);
```

*Source:* [include/xmlsec/io.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/io.h#L22)

Initializes the IO subsystem.

The IO initialization (called from `xmlSecInit` function). Applications should not call this function directly. 

**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecIOShutdown`

```c
void xmlSecIOShutdown(void);
```

*Source:* [include/xmlsec/io.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/io.h#L23)

Shuts down the IO subsystem.

The IO cleanup (called from `xmlSecShutdown` function). Applications should not call this function directly.

---

### `xmlSecIOCleanupCallbacks`

```c
void xmlSecIOCleanupCallbacks(void);
```

*Source:* [include/xmlsec/io.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/io.h#L24)

Clears all input callbacks.

Clears the entire input callback table. this includes the compiled-in I/O.

---

### `xmlSecIORegisterDefaultCallbacks`

```c
int xmlSecIORegisterDefaultCallbacks(void);
```

*Source:* [include/xmlsec/io.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/io.h#L25)

Registers the default compiled-in I/O handlers.

**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecIORegisterCallbacks`

```c
int xmlSecIORegisterCallbacks(xmlInputMatchCallback matchFunc, xmlInputOpenCallback openFunc, xmlInputReadCallback readFunc, xmlInputCloseCallback closeFunc);
```

*Source:* [include/xmlsec/io.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/io.h#L26)

Registers I/O callbacks for parser input.

Register a new set of I/O callback for handling parser input. 

**Parameters:**

- `matchFunc` — the protocol match callback.
- `openFunc` — the open stream callback.
- `readFunc` — the read from stream callback.
- `closeFunc` — the close stream callback.


**Returns:** the 0 on success or a negative value if an error occurs.

---

### `xmlSecTransformInputURIGetKlass`

```c
xmlSecTransformId xmlSecTransformInputURIGetKlass(void);
```

*Source:* [include/xmlsec/io.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/io.h#L41)

Gets the input URI transform klass.

The input uri transform klass. Reads binary data from an uri. 

**Returns:** input URI transform id.

---

### `xmlSecTransformInputURIOpen`

```c
int xmlSecTransformInputURIOpen(xmlSecTransformPtr transform, const xmlChar *uri);
```

*Source:* [include/xmlsec/io.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/io.h#L42)

Opens the given `uri` for reading.

**Parameters:**

- `transform` — the pointer to IO transform.
- `uri` — the URL to open.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformInputURIClose`

```c
int xmlSecTransformInputURIClose(xmlSecTransformPtr transform);
```

*Source:* [include/xmlsec/io.h](https://github.com/lsh123/xmlsec/blob/1.3.11/include/xmlsec/io.h#L44)

Closes the given `transform`.

Closes the given `transform` and frees up resources. 

**Parameters:**

- `transform` — the pointer to IO transform.


**Returns:** 0 on success or a negative value otherwise.

---
