---
name: "ppd_file_new"
section: "3"
platform: "linux"
package: "libppd-dev"
version: "2:0.10-9"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/ppd_file_new"
---

# ppd\_file\_new(3)

Parse a ppd file and load it into the ppd\_file\_t structure.

## NAME

ppd\_file\_new\_from\_filep, ppd\_file\_new\_from\_fd, ppd\_file\_new - Parse a ppd file and load it into the  ppd\_file\_t structure.

## SYNOPSIS

```
#include <ppd.h>

ppd_file_t *ppd_file_new_from_filep(FILE* fp");"

ppd_file_t *ppd_file_new_from_fd(int fd");"

ppd_file_t *ppd_file_new(const char * filename");"
```

## DESCRIPTION

The  **ppd\_file\_new\_from\_filep** function parses the specified PPD file.

## RETURN VALUES

Upon successful completion  **ppd\_file\_new\_from\_filep**, **ppd\_file\_new\_from\_fd ,** **ppd\_file\_new** return a  **ppd\_file\_t** pointer. Otherwise,  **NULL** is returned and  **errno** is set.

- **ENODEV**

  the FILE pointer passed into ppd\_file\_new\_from\_filep or the file descriptor passed into  ppd\_file\_new\_from\_fd is NULL.

- **EBADF**

  the file doesn't appear to be a PPD file.

- **ENOTTY**

  no idea what these errors are. Probably PPD parse errors.

- Other errors can be returned in errno by a failure in fdopen or fopen.

  ## SEE ALSO

[**ppd\_file\_free**(3)](/ppd_file_free/3.md), [**ppd\_emit\_to\_file**(3)](/ppd_emit_to_file/3.md)
