repo stringlengths 1 152 ⌀ | file stringlengths 14 221 | code stringlengths 501 25k | file_length int64 501 25k | avg_line_length float64 20 99.5 | max_line_length int64 21 134 | extension_type stringclasses 2
values |
|---|---|---|---|---|---|---|
openssl | openssl-master/test/helpers/handshake_srp.c | /*
* Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 3,585 | 39.75 | 91 | c |
openssl | openssl-master/test/helpers/pkcs12.c | /*
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 19,679 | 23.661654 | 107 | c |
openssl | openssl-master/test/helpers/pkcs12.h | /*
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 3,440 | 31.771429 | 83 | h |
openssl | openssl-master/test/helpers/predefined_dhparams.c | /*
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 7,062 | 35.220513 | 82 | c |
openssl | openssl-master/test/helpers/predefined_dhparams.h | /*
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 613 | 31.315789 | 74 | h |
openssl | openssl-master/test/helpers/quictestlib.h | /*
* Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/licens... | 9,107 | 39.300885 | 85 | h |
openssl | openssl-master/test/helpers/ssl_test_ctx.h | /*
* Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 9,053 | 33.037594 | 80 | h |
openssl | openssl-master/test/helpers/ssltestlib.h | /*
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 2,428 | 36.953125 | 80 | h |
openssl | openssl-master/test/testutil/apps_shims.c | /*
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 1,337 | 22.473684 | 78 | c |
openssl | openssl-master/test/testutil/driver.c | /*
* Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 13,246 | 26.947257 | 95 | c |
openssl | openssl-master/test/testutil/fake_random.c | /*
* Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://www.openssl.org/source/license.html
* or in the file LICENSE in t... | 7,322 | 30.564655 | 81 | c |
openssl | openssl-master/test/testutil/format_output.c | /*
* Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 17,217 | 31.183178 | 81 | c |
openssl | openssl-master/test/testutil/load.c | /*
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 2,696 | 24.443396 | 76 | c |
openssl | openssl-master/test/testutil/main.c | /*
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 931 | 21.731707 | 74 | c |
openssl | openssl-master/test/testutil/options.c | /*
* Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 1,728 | 20.6125 | 80 | c |
openssl | openssl-master/test/testutil/output.h | /*
* Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 2,576 | 36.347826 | 77 | h |
openssl | openssl-master/test/testutil/provider.c | /*
* Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 7,429 | 29.576132 | 97 | c |
openssl | openssl-master/test/testutil/random.c | /*
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/licens... | 1,146 | 26.97561 | 74 | c |
openssl | openssl-master/test/testutil/stanza.c | /*
* Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/licens... | 3,964 | 23.78125 | 74 | c |
openssl | openssl-master/test/testutil/test_options.c | /*
* Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 616 | 27.045455 | 74 | c |
openssl | openssl-master/test/testutil/tests.c | /*
* Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 17,154 | 35.191983 | 81 | c |
openssl | openssl-master/test/testutil/testutil_init.c | /*
* Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 3,916 | 25.828767 | 79 | c |
openssl | openssl-master/test/testutil/tu_local.h | /*
* Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | 2,472 | 38.887097 | 74 | h |
openssl | openssl-master/util/check-format-test-positives.c | /*
* Copyright 2007-2022 The OpenSSL Project Authors. All Rights Reserved.
* Copyright Siemens AG 2015-2022
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
... | 11,068 | 29.747222 | 110 | c |
openssl | openssl-master/util/quicserver.c | /*
* Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/licens... | 7,127 | 27.062992 | 83 | c |
null | systemd-main/coccinelle/macros.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Collected macros from our systemd codebase to make the cocci semantic
* parser happy. Inspired by the original cocci macros file
* /usr/lib64/coccinelle/standard.h (including the YACFE_* symbols)
*/
// General
#define PTR_TO_PID(x)
// src/basic/macro.h
#define... | 13,772 | 58.366379 | 81 | h |
null | systemd-main/man/event-quick-child.c | /* SPDX-License-Identifier: MIT-0 */
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
#include <sd-event.h>
int main(int argc, char **argv) {
pid_t pid = fork();
assert(pid >= 0);
/* SIGCHLD signal must be blocked for sd_event_add_child to work */
sigset_t ss;
sigemptyset(&ss);
sigaddset(&ss, S... | 927 | 20.581395 | 69 | c |
null | systemd-main/man/glib-event-glue.c | /* SPDX-License-Identifier: MIT-0 */
#include <stdlib.h>
#include <glib.h>
#include <systemd/sd-event.h>
typedef struct SDEventSource {
GSource source;
GPollFD pollfd;
sd_event *event;
} SDEventSource;
static gboolean event_prepare(GSource *source, gint *timeout_) {
return sd_event_prepare(((SDEventSource *)... | 1,263 | 24.795918 | 91 | c |
null | systemd-main/man/hwdb-usb-device.c | /* SPDX-License-Identifier: MIT-0 */
#include <stdio.h>
#include <stdint.h>
#include <sd-hwdb.h>
int print_usb_properties(uint16_t vid, uint16_t pid) {
char match[STRLEN("usb:vp") + DECIMAL_STR_MAX(uint16_t) * 2];
sd_hwdb *hwdb;
const char *key, *value;
int r;
/* Match this USB vendor and product ID combin... | 666 | 20.516129 | 63 | c |
null | systemd-main/man/inotify-watch-tmp.c | /* SPDX-License-Identifier: MIT-0 */
#include <stdio.h>
#include <string.h>
#include <sys/inotify.h>
#include <systemd/sd-event.h>
#define _cleanup_(f) __attribute__((cleanup(f)))
static int inotify_handler(sd_event_source *source,
const struct inotify_event *event,
... | 1,806 | 29.627119 | 85 | c |
null | systemd-main/man/journal-iterate-poll.c | /* SPDX-License-Identifier: MIT-0 */
#include <poll.h>
#include <time.h>
#include <systemd/sd-journal.h>
int wait_for_changes(sd_journal *j) {
uint64_t t;
int msec;
struct pollfd pollfd;
sd_journal_get_timeout(j, &t);
if (t == (uint64_t) -1)
msec = -1;
else {
struct timespec ts;
uint64_t n;
... | 618 | 21.107143 | 59 | c |
null | systemd-main/man/journal-iterate-wait.c | /* SPDX-License-Identifier: MIT-0 */
#include <errno.h>
#include <stdio.h>
#include <systemd/sd-journal.h>
int main(int argc, char *argv[]) {
int r;
sd_journal *j;
r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
if (r < 0) {
errno = -r;
fprintf(stderr, "Failed to open journal: %m\n");
return 1;
... | 1,048 | 21.804348 | 66 | c |
null | systemd-main/man/journal-stream-fd.c | /* SPDX-License-Identifier: MIT-0 */
#include <errno.h>
#include <syslog.h>
#include <stdio.h>
#include <unistd.h>
#include <systemd/sd-journal.h>
#include <systemd/sd-daemon.h>
int main(int argc, char *argv[]) {
int fd;
FILE *log;
fd = sd_journal_stream_fd("test", LOG_INFO, 1);
if (fd < 0) {
errno = -fd;... | 641 | 20.4 | 58 | c |
null | systemd-main/man/logcontrol-example.c | /* SPDX-License-Identifier: MIT-0 */
/* Implements the LogControl1 interface as per specification:
* https://www.freedesktop.org/software/systemd/man/org.freedesktop.LogControl1.html
*
* Compile with 'cc logcontrol-example.c $(pkg-config --libs --cflags libsystemd)'
*
* To get and set properties via busctl:
*
*... | 7,656 | 30.904167 | 84 | c |
null | systemd-main/man/print-unit-path-call-method.c | /* SPDX-License-Identifier: MIT-0 */
/* This is equivalent to:
* busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 \
* org.freedesktop.systemd1.Manager GetUnitByPID $$
*
* Compile with 'cc print-unit-path-call-method.c -lsystemd'
*/
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
... | 1,428 | 26.480769 | 110 | c |
null | systemd-main/man/print-unit-path.c | /* SPDX-License-Identifier: MIT-0 */
/* This is equivalent to:
* busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 \
* org.freedesktop.systemd1.Manager GetUnitByPID $$
*
* Compile with 'cc print-unit-path.c -lsystemd'
*/
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <un... | 1,688 | 26.688525 | 75 | c |
null | systemd-main/man/sd_bus_error-example.c | /* SPDX-License-Identifier: MIT-0 */
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sd-bus.h>
int writer_with_negative_errno_return(int fd, sd_bus_error *error) {
const char *message = "Hello, World!\n";
ssize_t n = write(fd, message, strlen(message));
if (n >= 0)
return n; /* On succ... | 579 | 29.526316 | 83 | c |
null | systemd-main/man/send-unit-files-changed.c | /* SPDX-License-Identifier: MIT-0 */
#include <systemd/sd-bus.h>
#define _cleanup_(f) __attribute__((cleanup(f)))
int send_unit_files_changed(sd_bus *bus) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *message = NULL;
int r;
r = sd_bus_message_new_signal(bus, &message,
"/org... | 537 | 27.315789 | 67 | c |
null | systemd-main/man/vtable-example.c | /* SPDX-License-Identifier: MIT-0 */
#include <errno.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <systemd/sd-bus.h>
#define _cleanup_(f) __attribute__((cleanup(f)))
#define check(x) ({ \
int r = (x); \
er... | 3,404 | 29.132743 | 76 | c |
null | systemd-main/src/ac-power/ac-power.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
#include "battery-util.h"
#include "build.h"
#include "main-func.h"
static bool arg_verbose = false;
static enum {
ACTION_AC_POWER,
ACTION_LOW,
} arg_action = ACTION_AC_POWER;
static void help(void) {
printf("%s\n\n"
... | 3,009 | 26.363636 | 105 | c |
null | systemd-main/src/analyze/analyze-blame.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-blame.h"
#include "analyze-time-data.h"
#include "format-table.h"
int verb_blame(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_(unit_times_free_arrayp) ... | 1,968 | 27.128571 | 75 | c |
null | systemd-main/src/analyze/analyze-calendar.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-calendar.h"
#include "calendarspec.h"
#include "format-table.h"
#include "terminal-util.h"
static int test_calendar_one(usec_t n, const char *p) {
_cleanup_(calendar_spec_freep) CalendarSpec *spec = NULL;
_cleanup_... | 5,051 | 34.829787 | 105 | c |
null | systemd-main/src/analyze/analyze-capability.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-capability.h"
#include "cap-list.h"
#include "capability-util.h"
#include "format-table.h"
int verb_capabilities(int argc, char *argv[], void *userdata) {
_cleanup_(table_unrefp) Table *table = NULL;
unsigned last_... | 1,986 | 33.859649 | 121 | c |
null | systemd-main/src/analyze/analyze-cat-config.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-cat-config.h"
#include "conf-files.h"
#include "constants.h"
#include "nulstr-util.h"
#include "path-util.h"
#include "pretty-print.h"
#include "strv.h"
int verb_cat_config(int argc, char *argv[], void *userdata) {
char **... | 1,290 | 27.688889 | 110 | c |
null | systemd-main/src/analyze/analyze-compare-versions.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdio.h>
#include "analyze-compare-versions.h"
#include "compare-operator.h"
#include "macro.h"
#include "string-util.h"
#include "strv.h"
int verb_compare_versions(int argc, char *argv[], void *userdata) {
const char *v1 = ASSERT_PTR(argv[1]), *v2 =... | 2,018 | 37.09434 | 105 | c |
null | systemd-main/src/analyze/analyze-condition.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include "analyze.h"
#include "analyze-condition.h"
#include "analyze-verify-util.h"
#include "condition.h"
#include "conf-parser.h"
#include "load-fragment.h"
#include "service.h"
static int parse_condition(Unit *u, const char *line) {
ass... | 4,843 | 31.952381 | 132 | c |
null | systemd-main/src/analyze/analyze-critical-chain.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze-critical-chain.h"
#include "analyze-time-data.h"
#include "analyze.h"
#include "bus-error.h"
#include "copy.h"
#include "path-util.h"
#include "sort-util.h"
#include "special.h"
#include "static-destruct.h"
#include "strv.h"
#include "terminal-util.h"
... | 7,898 | 33.194805 | 126 | c |
null | systemd-main/src/analyze/analyze-dot.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-dot.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "bus-unit-util.h"
#include "glob-util.h"
#include "terminal-util.h"
static int graph_one_property(
sd_bus *bus,
const UnitInfo *u,
... | 6,364 | 33.781421 | 116 | c |
null | systemd-main/src/analyze/analyze-dump.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-bus.h"
#include "analyze-dump.h"
#include "analyze.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "bus-util.h"
#include "copy.h"
static int dump_fallback(sd_bus *bus) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NU... | 4,971 | 33.054795 | 111 | c |
null | systemd-main/src/analyze/analyze-exit-status.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-exit-status.h"
#include "exit-status.h"
#include "format-table.h"
int verb_exit_status(int argc, char *argv[], void *userdata) {
_cleanup_(table_unrefp) Table *table = NULL;
int r;
table = table_new("name"... | 2,181 | 37.280702 | 103 | c |
null | systemd-main/src/analyze/analyze-fdstore.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze-fdstore.h"
#include "analyze.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "fd-util.h"
#include "format-table.h"
static int dump_fdstore(sd_bus *bus, const char *arg) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERR... | 3,936 | 34.468468 | 114 | c |
null | systemd-main/src/analyze/analyze-inspect-elf.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-inspect-elf.h"
#include "elf-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "format-table.h"
#include "format-util.h"
#include "json.h"
#include "path-util.h"
#include "strv.h"
static int analyze_elf(char **filename... | 5,501 | 46.025641 | 114 | c |
null | systemd-main/src/analyze/analyze-log-control.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-log-control.h"
#include "verb-log-control.h"
int verb_log_control(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
int r;
assert(IN_SET(argc, 1, 2));
... | 621 | 26.043478 | 106 | c |
null | systemd-main/src/analyze/analyze-malloc.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-bus.h"
#include "analyze-malloc.h"
#include "analyze.h"
#include "bus-error.h"
#include "bus-internal.h"
static int dump_malloc_info(sd_bus *bus, char *service) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanu... | 2,221 | 33.71875 | 131 | c |
null | systemd-main/src/analyze/analyze-pcrs.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-pcrs.h"
#include "fileio.h"
#include "format-table.h"
#include "hexdecoct.h"
#include "terminal-util.h"
#include "tpm2-util.h"
static int get_pcr_alg(const char **ret) {
assert(ret);
FOREACH_STRING(alg, "sha256", ... | 4,600 | 30.731034 | 110 | c |
null | systemd-main/src/analyze/analyze-service-watchdogs.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-service-watchdogs.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "parse-util.h"
int verb_service_watchdogs(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERR... | 1,488 | 34.452381 | 124 | c |
null | systemd-main/src/analyze/analyze-time-data.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <sd-bus.h>
#include "time-util.h"
typedef struct BootTimes {
usec_t firmware_time;
usec_t loader_time;
usec_t kernel_time;
usec_t kernel_done_time;
usec_t initrd_time;
usec_t userspace_time;
... | 1,938 | 33.017544 | 109 | h |
null | systemd-main/src/analyze/analyze-time.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-time.h"
#include "analyze-time-data.h"
int verb_time(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_free_ char *buf = NULL;
int r;
r = a... | 565 | 23.608696 | 64 | c |
null | systemd-main/src/analyze/analyze-timespan.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-timespan.h"
#include "calendarspec.h"
#include "format-table.h"
#include "glyph-util.h"
#include "strv.h"
#include "terminal-util.h"
int verb_timespan(int argc, char *argv[], void *userdata) {
STRV_FOREACH(input_timespan, ... | 2,433 | 35.328358 | 127 | c |
null | systemd-main/src/analyze/analyze-timestamp.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-timestamp.h"
#include "format-table.h"
#include "terminal-util.h"
static int test_timestamp_one(const char *p) {
_cleanup_(table_unrefp) Table *table = NULL;
TableCell *cell;
usec_t usec;
int r;
... | 2,875 | 30.604396 | 105 | c |
null | systemd-main/src/analyze/analyze-unit-files.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-unit-files.h"
#include "path-lookup.h"
#include "strv.h"
static bool strv_fnmatch_strv_or_empty(char* const* patterns, char **strv, int flags) {
STRV_FOREACH(s, strv)
if (strv_fnmatch_or_empty(patterns, *s,... | 1,676 | 31.882353 | 87 | c |
null | systemd-main/src/analyze/analyze-unit-paths.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-unit-paths.h"
#include "path-lookup.h"
#include "strv.h"
int verb_unit_paths(int argc, char *argv[], void *userdata) {
_cleanup_(lookup_paths_free) LookupPaths paths = {};
int r;
r = lookup_paths_init_or_w... | 508 | 23.238095 | 74 | c |
null | systemd-main/src/analyze/analyze-verify-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include "all-units.h"
#include "alloc-util.h"
#include "analyze-verify-util.h"
#include "bus-error.h"
#include "bus-util.h"
#include "log.h"
#include "manager.h"
#include "pager.h"
#include "path-util.h"
#include "string-table.h"
#include "strv.h"
... | 11,379 | 30.523546 | 113 | c |
null | systemd-main/src/analyze/analyze-verify.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "analyze.h"
#include "analyze-verify.h"
#include "analyze-verify-util.h"
#include "copy.h"
#include "rm-rf.h"
#include "tmpfile-util.h"
static int process_aliases(char *argv[], char *tempdir, char ***ret) {
_cleanup_strv_free_ char **filenames = NULL;
... | 2,217 | 30.239437 | 118 | c |
null | systemd-main/src/analyze/analyze.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "analyze-verify-util.h"
#include "bus-util.h"
#include "json.h"
#include "pager.h"
#include "time-util.h"
#include "unit-file.h"
typedef enum DotMode {
DEP_ALL,
DEP_ORDER,
DEP_REQUIRE,
} DotMode;
exte... | 1,316 | 25.34 | 98 | h |
null | systemd-main/src/ask-password/ask-password.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <getopt.h>
#include <stddef.h>
#include <unistd.h>
#include "ask-password-api.h"
#include "build.h"
#include "constants.h"
#include "log.h"
#include "macro.h"
#include "main-func.h"
#include "parse-argument.h"
#include "pretty-print.h"
#incl... | 9,731 | 35.863636 | 134 | c |
null | systemd-main/src/basic/MurmurHash2.c | /* SPDX-License-Identifier: LicenseRef-murmurhash2-public-domain */
//-----------------------------------------------------------------------------
// MurmurHash2 was written by Austin Appleby, and is placed in the public
// domain. The author hereby disclaims copyright to this source code.
// Note - This code makes a... | 2,112 | 21.967391 | 79 | c |
null | systemd-main/src/basic/MurmurHash2.h | /* SPDX-License-Identifier: LicenseRef-murmurhash2-public-domain */
//-----------------------------------------------------------------------------
// MurmurHash2 was written by Austin Appleby, and is placed in the public
// domain. The author hereby disclaims copyright to this source code.
#pragma once
//-----------... | 922 | 27.84375 | 79 | h |
null | systemd-main/src/basic/af-list.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include "af-list.h"
#include "macro.h"
static const struct af_name* lookup_af(register const char *str, register GPERF_LEN_TYPE len);
#include "af-from-name.h"
#include "af-to-name.h"
const char *af_to_... | 1,215 | 21.943396 | 104 | c |
null | systemd-main/src/basic/alloc-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <malloc.h>
#include <stdint.h>
#include <string.h>
#include "alloc-util.h"
#include "macro.h"
#include "memory-util.h"
void* memdup(const void *p, size_t l) {
void *ret;
assert(l == 0 || p);
ret = malloc(l ?: 1);
if (!ret)
... | 3,174 | 22.345588 | 109 | c |
null | systemd-main/src/basic/architecture.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/utsname.h>
#include "architecture.h"
#include "macro.h"
#include "string-table.h"
#include "string-util.h"
Architecture uname_architecture(void) {
/* Return a sanitized enum identifying the architecture we are running on. This
* is base... | 7,063 | 38.463687 | 89 | c |
null | systemd-main/src/basic/architecture.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <endian.h>
#include "macro.h"
/* A cleaned up architecture definition. We don't want to get lost in
* processor features, models, generations or even ABIs. Hence we
* focus on general family, and distinguish word width and endianness. */
typed... | 8,289 | 32.562753 | 73 | h |
null | systemd-main/src/basic/argv-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sched.h>
#include <sys/mman.h>
#include <sys/prctl.h>
#include <unistd.h>
#include "argv-util.h"
#include "capability-util.h"
#include "errno-util.h"
#include "missing_sched.h"
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include ... | 9,630 | 41.241228 | 122 | c |
null | systemd-main/src/basic/argv-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "macro.h"
extern int saved_argc;
extern char **saved_argv;
static inline void save_argc_argv(int argc, char **argv) {
/* Protect against CVE-2021-4034 style attacks */
assert_se(argc > 0);
assert_se(a... | 583 | 21.461538 | 58 | h |
null | systemd-main/src/basic/arphrd-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <netinet/in.h>
#include <linux/if_arp.h>
#include <linux/if_infiniband.h>
#include <string.h>
#include "arphrd-util.h"
#include "macro.h"
static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len);... | 1,101 | 22.956522 | 102 | c |
null | systemd-main/src/basic/audit-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <linux/audit.h>
#include <linux/netlink.h>
#include <stdio.h>
#include <sys/socket.h>
#include "alloc-util.h"
#include "audit-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "io-util.h"
#include "macro.h"
#include "parse-util.h"
#i... | 4,292 | 28.204082 | 103 | c |
null | systemd-main/src/basic/bitfield.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "macro.h"
/* Bit index (0-based) to mask of specified type. Assertion failure if index is out of range. */
#define _INDEX_TO_MASK(type, i, uniq) \
({ ... | 4,415 | 58.675676 | 109 | h |
null | systemd-main/src/basic/bus-label.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include "alloc-util.h"
#include "bus-label.h"
#include "hexdecoct.h"
#include "macro.h"
char *bus_label_escape(const char *s) {
char *r, *t;
const char *f;
assert_return(s, NULL);
/* Escapes all chars that D-Bus' ... | 2,084 | 25.0625 | 109 | c |
null | systemd-main/src/basic/cap-list.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
/* Space for capability_to_string() in case we write out a numeric capability because we don't know the name
* for it. "0x3e" is the largest string we might output, in both sensese of the word "largest": two chars for
* "0x", two by... | 957 | 42.545455 | 109 | h |
null | systemd-main/src/basic/capability-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/prctl.h>
#include <unistd.h>
#include "alloc-util.h"
#include "capability-util.h"
#include "cap-list.h"
#include "fileio.h"
#include "log.h"
#include "logarithm.h"
#include "macro.h"
#include "miss... | 23,349 | 35.829653 | 119 | c |
null | systemd-main/src/basic/capability-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <sys/capability.h>
#include <sys/types.h>
#include "macro.h"
#include "missing_capability.h"
/* Special marker used when storing a capabilities mask as "unset" */
#define CAP_MASK_UNSET UINT64_MAX
/* All ... | 3,151 | 34.818182 | 119 | h |
null | systemd-main/src/basic/chattr-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <linux/fs.h>
#include "chattr-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "fs-util.h"
#include "macro.h"
#include "string-util.h"
int chattr_full(
... | 5,835 | 34.803681 | 119 | c |
null | systemd-main/src/basic/compress.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
typedef enum Compression {
COMPRESSION_NONE,
COMPRESSION_XZ,
COMPRESSION_LZ4,
COMPRESSION_ZSTD,
_COMPRESSION_MAX,
_COMPRESSION_I... | 4,543 | 40.309091 | 106 | h |
null | systemd-main/src/basic/conf-files.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "macro.h"
enum {
CONF_FILES_EXECUTABLE = 1 << 0,
CONF_FILES_REGULAR = 1 << 1,
CONF_FILES_DIRECTORY = 1 << 2,
CONF_FILES_BASENAME = 1 << 3,
CONF_FILES_FILTER_MASKED = 1 << 4,
};
int conf_fi... | 1,447 | 44.25 | 117 | h |
null | systemd-main/src/basic/confidential-virt.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#if defined(__i386__) || defined(__x86_64__)
#include <cpuid.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include "confidential-virt-fundamental.h"
#include "confidential-virt.h"
#include "fd-util.h"
#include "missing_threads... | 7,357 | 31.131004 | 107 | c |
null | systemd-main/src/basic/confidential-virt.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "errno-list.h"
#include "macro.h"
typedef enum ConfidentialVirtualization {
CONFIDENTIAL_VIRTUALIZATION_NONE = 0,
CONFIDENTIAL_VIRTUALIZATION_SEV,
CONFIDENTIAL_VIRTUALIZATION_SEV_ES,
CONFIDENT... | 882 | 32.961538 | 113 | h |
null | systemd-main/src/basic/constants.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#if !defined(HAS_FEATURE_MEMORY_SANITIZER)
# if defined(__has_feature)
# if __has_feature(memory_sanitizer)
# define HAS_FEATURE_MEMORY_SANITIZER 1
# endif
# endif
# if !defined(HAS_FEATURE_MEMORY_SANITIZER)
# define HAS_FEATURE_MEMORY_SANI... | 4,371 | 37.690265 | 122 | h |
null | systemd-main/src/basic/coverage.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/* Use the coverage-related tweaks below only for C stuff as they're not really
* C++ compatible, and the only thing that is built with a C++ compiler is
* the lone test-bus-vtable-cc unit test.
*/
#ifndef __cplusplus
void __gcov_dump(void);
void __gcov... | 2,218 | 32.119403 | 128 | h |
null | systemd-main/src/basic/devnum-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <string.h>
#include <sys/stat.h>
#include "chase.h"
#include "devnum-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "string-util.h"
int parse_devnum(const char *s, dev_t *ret) {
const char *major;
unsigned x, y;
size_t... | 3,892 | 27.007194 | 119 | c |
null | systemd-main/src/basic/devnum-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include <stdbool.h>
#include <sys/types.h>
#include "stdio-util.h"
int parse_devnum(const char *s, dev_t *ret);
/* glibc and the Linux kernel have different ideas about the major/minor size. These calls will check whether the
* sp... | 2,586 | 44.385965 | 119 | h |
null | systemd-main/src/basic/dirent-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <sys/stat.h>
#include "dirent-util.h"
#include "path-util.h"
#include "stat-util.h"
#include "string-util.h"
int dirent_ensure_type(int dir_fd, struct dirent *de) {
STRUCT_STATX_DEFINE(sx);
int r;
assert(dir_fd >= 0... | 2,646 | 23.971698 | 119 | c |
null | systemd-main/src/basic/dirent-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <dirent.h>
#include <errno.h>
#include <stdbool.h>
#include "macro.h"
#include "path-util.h"
bool dirent_is_file(const struct dirent *de) _pure_;
bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) _pure_;
int dirent_ensu... | 3,278 | 51.047619 | 110 | h |
null | systemd-main/src/basic/dns-def.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/* Length of a single label, with all escaping removed, excluding any trailing dot or NUL byte */
#define DNS_LABEL_MAX 63
/* Worst case length of a single label, with all escaping applied and room for a trailing NUL byte. */
#define DNS_LABEL_ESCAPED_MAX ... | 692 | 37.5 | 116 | h |
null | systemd-main/src/basic/efivars.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#if !ENABLE_EFI
# include <errno.h>
#endif
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "sd-id128.h"
#include "efivars-fundamental.h"
#include "time-util.h"
#define EFI_VENDOR_LOADER SD_ID128_MAKE(4a,67,b0,82,0a,4c,41,cf,b6... | 3,497 | 33.633663 | 107 | h |
null | systemd-main/src/basic/env-file.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "env-file.h"
#include "env-util.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "string-util.h"
#include "strv.h"
#include "tmpfile-util.h"
#include "utf8.h"
typedef int (*push_env_func_t)(
... | 19,078 | 29.09306 | 117 | c |
null | systemd-main/src/basic/env-file.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include "macro.h"
int parse_env_filev(FILE *f, const char *fname, va_list ap);
int parse_env_file_fdv(int fd, const char *fname, va_list ap);
int parse_env_file_sentinel(FILE *f, const char *fname... | 1,045 | 39.230769 | 98 | h |
null | systemd-main/src/basic/errno-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdlib.h>
#include <string.h>
#include "macro.h"
/* strerror(3) says that glibc uses a maximum length of 1024 bytes. */
#define ERRNO_BUF_LEN 1024
/* Note: the lifetime of the compound literal is the immediately surrounding block,
* see C11 §6... | 6,202 | 34.045198 | 108 | h |
null | systemd-main/src/basic/escape.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "escape.h"
#include "hexdecoct.h"
#include "macro.h"
#include "strv.h"
#include "utf8.h"
int cescape_char(char c, char *buf) {
char *buf_old = buf;
/* Needs sp... | 17,054 | 28.558059 | 127 | c |
null | systemd-main/src/basic/escape.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include <uchar.h>
#include "string-util.h"
#include "missing_type.h"
/* What characters are special in the shell? */
/* must be escaped outside and inside double-quotes ... | 2,782 | 37.123288 | 124 | h |
null | systemd-main/src/basic/ether-addr-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <inttypes.h>
#include <net/ethernet.h>
#include <stdio.h>
#include <sys/types.h>
#include "ether-addr-util.h"
#include "hexdecoct.h"
#include "macro.h"
#include "string-util.h"
char *hw_addr_to_string_full(
const struct hw_a... | 8,262 | 29.267399 | 129 | c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.