---
name: "read_scf"
section: "3"
platform: "linux"
package: "libstaden-read-dev"
version: "1.15.0-1.1+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/read_scf"
---

# read\_scf(3)

Read SCF files

## NAME

**read\_scf**, **fread\_scf**, **read\_scf\_header** - Read SCF files

## SYNOPSIS

```
#include <scf.h>
```

```
Scf *read_scf(
	char *fn);
```

```
Scf *fread_scf(
	FILE *fp);
```

```
int read_scf_header(
	FILE *fp,
	Header *h);
```

## DESCRIPTION

These functions read SCF format trace files. All the functions accepting a **FILE \*** as an argument assume that the file pointer is at the correct offset within the file.

**read\_scf()** reads an entire SCF file into the **Scf** structure (see the **scf**(4) manual page for the details of this structure). The data is read from the specified file name.

**fread\_scf()** reads an entire SCF file into the **Scf** structure (see the **scf**(4) manual page for the details of this structure). The data is read from the specified file pointer, which is neither closed or rewound after the operation.

**read\_scf\_header()** reads the **Header** structure from the specified file pointer.

## RETURN VALUES

On successful completion, the **read\_scf()** and **fread\_scf()** functions return a pointer to a **Scf** structure. Otherwise these functions return a null pointer.

On successful completion, the **read\_scf\_header()** function returns 0. Otherwise the function returns -1.

## SEE ALSO

**scf**(4), [**write\_scf**(3)](/write_scf/3.md)
