---
name: "write_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/write_scf"
---

# write\_scf(3)

Write SCF files

## NAME

**write\_scf**, **fwrite\_scf**, **write\_scf\_header** - Write SCF files

## SYNOPSIS

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

```
int write_scf(
	Scf *scf,
	char *fn);
```

```
int fwrite_scf(
	Scf *scf,
	FILE *fp);
```

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

## DESCRIPTION

These functions write 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, which should be the start.

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

**fwrite\_scf()** writesan entire SCF file into the **Scf** structure (see the **scf**(4) manual page for the details of this structure). The data is written to the specified file pointer, which is neither closed or rewound after the operation.

**write\_scf\_header()** writes the **Header** structure to the specified file pointer.

## RETURN VALUES

On successful completion, the **write\_scf()**, **fwrite\_scf()** and **write\_scf\_header()** functions return 0. Otherwise these function returns -1.

## SEE ALSO

**scf**(4), [**read\_scf**(3)](/read_scf/3.md)
