Debian Codegraph @

libdrgn/language.c

raw
1 // Copyright (c) Meta Platforms, Inc. and affiliates.
2 // SPDX-License-Identifier: LGPL-2.1-or-later
3
4 #include <assert.h>
5
6 #include "array.h"
7 #include "language.h"
8 #include "util.h"
9
10 const struct drgn_language * const drgn_languages[] = {
11 [DRGN_LANGUAGE_C] = &drgn_language_c,
12 [DRGN_LANGUAGE_CPP] = &drgn_language_cpp,
13 };
14 static_assert(array_size(drgn_languages) == DRGN_NUM_LANGUAGES,
15 "missing language in drgn_languages");
16
17 LIBDRGN_PUBLIC const char *drgn_language_name(const struct drgn_language *lang)
18 {
19 return lang->name;
20 }