chiark / gitweb /
Add __attribute__((const, pure, format)) in various places
[elogind.git] / src / core / cgroup-attr.h
index 2b3c1aea9e0ddbabce61bc2610a412f6f35b74e3..3a13b7c92dde811c8d9ab700f23119f4d19d271d 100644 (file)
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foocgroupattrhfoo
-#define foocgroupattrhfoo
+#pragma once
 
 /***
   This file is part of systemd.
 
 typedef struct CGroupAttribute CGroupAttribute;
 
-typedef int (*CGroupAttributeMapCallback)(const char *controller, const char*name, const char *value, char **ret);
-
 #include "unit.h"
 #include "cgroup.h"
+#include "cgroup-semantics.h"
 
 struct CGroupAttribute {
         char *controller;
         char *name;
         char *value;
 
-        CGroupAttributeMapCallback map_callback;
+        Unit *unit;
+
+        const CGroupSemantics *semantics;
 
         LIST_FIELDS(CGroupAttribute, by_unit);
 };
@@ -42,8 +42,9 @@ struct CGroupAttribute {
 int cgroup_attribute_apply(CGroupAttribute *a, CGroupBonding *b);
 int cgroup_attribute_apply_list(CGroupAttribute *first, CGroupBonding *b);
 
-CGroupAttribute *cgroup_attribute_find_list(CGroupAttribute *first, const char *controller, const char *name);
+bool cgroup_attribute_matches(CGroupAttribute *a, const char *controller, const char *name) _pure_;
+CGroupAttribute *cgroup_attribute_find_list(CGroupAttribute *first, const char *controller, const char *name) _pure_;
 
+void cgroup_attribute_free(CGroupAttribute *a);
 void cgroup_attribute_free_list(CGroupAttribute *first);
-
-#endif
+void cgroup_attribute_free_some(CGroupAttribute *first, const char *controller, const char *name);