---
name: "loc_database_get_country"
section: "3"
platform: "linux"
package: "libloc"
version: "0.9.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/loc_database_get_country"
---

# loc\_database\_get\_country(3)

Fetch country information from the database

## NAME

loc\_database\_get\_country - Fetch country information from the database

## SYNOPSIS

\#include \<libloc/database.h\>

int loc\_database\_get\_country(struct loc\_database\* db, struct loc\_country\*\* country, const char\* code);

## DESCRIPTION

This function fetches information about the country with the matching *code*.

## RETURN VALUE

On success, zero is returned. Otherwise non-zero is being returned and *errno* is set accordingly.

## SEE ALSO

[**libloc**(3)](/libloc/3.md)

## AUTHORS

Michael Tremer
