mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
This allows more straightforward memory management and the use of static destructor. Requested (by me) in https://github.com/systemd/systemd/pull/30143#discussion_r1401980763
23 lines
667 B
C
23 lines
667 B
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
#pragma once
|
|
|
|
#include <sys/types.h>
|
|
|
|
typedef struct MachineCredential {
|
|
char *id;
|
|
char *data;
|
|
size_t size;
|
|
} MachineCredential;
|
|
|
|
typedef struct MachineCredentialContext {
|
|
MachineCredential *credentials;
|
|
size_t n_credentials;
|
|
} MachineCredentialContext;
|
|
|
|
void machine_credential_context_done(MachineCredentialContext *ctx);
|
|
|
|
bool machine_credentials_contains(const MachineCredentialContext *ctx, const char *id);
|
|
|
|
int machine_credential_set(MachineCredentialContext *ctx, const char *cred_str);
|
|
int machine_credential_load(MachineCredentialContext *ctx, const char *cred_path);
|