* int ret;
* ret = iterator_name_begin(&handle, &item);
* while (ret == 0) {
- * // process the item here
+ * // process the item here
* ret = iterator_name_begin(&handle, &item);
* }
* if (ret != ECGEOF) {
- * // process the error here
+ * // process the error here
* }
* iterator_name_end(&handle);
* @endcode
* full hierarchy.
* @param depth The maximum depth to which the function should walk, 0
* implies all the way down.
- * @param handle Handle to be used during iteration.
- * @param info Info filled and returned about directory information.
+ * @param handle The handle to be used during iteration.
+ * @param info The info filled and returned about directory information.
* @param base_level Opaque integer which you must pass to subsequent
- * cgroup_walk_tree_next.
+ * cgroup_walk_tree_next.
* @todo why base_level is not hidden in **handle?
* @return #ECGEOF when there is no node.
*/
int cgroup_walk_tree_begin(const char *controller, const char *base_path, int depth,
- void **handle, struct cgroup_file_info *info,
- int *base_level);
+ void **handle, struct cgroup_file_info *info,
+ int *base_level);
+
/**
* Get the next directory in the walk.
* @param depth The maximum depth to which the function should walk, 0
* implies all the way down.
- * @param handle Handle to be used during iteration.
- * @param info Info filled and returned about the next directory.
+ * @param handle The handle to be used during iteration.
+ * @param info The info filled and returned about the next directory.
* @param base_level Value of base_level returned by cgroup_walk_tree_begin().
* @return #ECGEOF when we are done walking through the nodes.
*/
int cgroup_walk_tree_next(int depth, void **handle,
- struct cgroup_file_info *info, int base_level);
+ struct cgroup_file_info *info, int base_level);
/**
* Release the iterator.
/**
* Set the flags for walk_tree. Currently available flags are in
* #cgroup_walk_type enum.
- * @param handle Handle of the iterator.
+ * @param handle The handle of the iterator.
* @param flags
*/
int cgroup_walk_tree_set_flags(void **handle, int flags);
* The value is read up to newline character or at most max-1 characters,
* whichever comes first (i.e. similar to fgets()).
* @param controller Name of the controller for which stats are requested.
- * @param path Path to control group, relative to hierarchy root.
+ * @param path The path to control group, relative to hierarchy root.
* @param name is variable name.
- * @param handle Handle to be used during iteration.
- * @param buffer Buffer to read the value into.
+ * @param handle The handle to be used during iteration.
+ * @param buffer The buffer to read the value into.
* The buffer is always zero-terminated.
* @param max Maximal lenght of the buffer
* @return #ECGEOF when the stats file is empty.
*/
int cgroup_read_value_begin(const char * const controller, const char *path,
- const char * const name, void **handle, char *buffer, int max);
-
-/**
- * Read the next string from the given variable handle
- * which is generated by cgroup_read_stats_begin() function.
- * the value is read up to newline character or at most max-1 characters,
- * whichever comes first (i.e. similar to fgets()) per
- * cgroup_read_stats_next() call
- * @param handle Handle to be used during iteration.
- * @param data returned the string.
- * @param buffer Buffer to read the value into.
- * The buffer is always zero-terminated.
- * @param max Maximal lenght of the buffer
- * @return #ECGEOF when the iterator finishes getting the list of stats.
- */
+ const char * const name, void **handle,
+ char *buffer, int max);
+
+/**
+ * Read the next string from the given variable handle
+ * which is generated by cgroup_read_stats_begin() function.
+ * the value is read up to newline character or at most max-1 characters,
+ * whichever comes first (i.e. similar to fgets()) per
+ * cgroup_read_stats_next() call
+ * @param handle The handle to be used during iteration.
+ * @param data returned the string.
+ * @param buffer The buffer to read the value into.
+ * The buffer is always zero-terminated.
+ * @param max Maximal lenght of the buffer
+ * @return #ECGEOF when the iterator finishes getting the list of stats.
+ */
int cgroup_read_value_next(void **handle, char *buffer, int max);
/**
* controller and control group. One line is returned per
* cgroup_read_stats_begin() and cgroup_read_stats_next() call.
* @param controller Name of the controller for which stats are requested.
- * @param path Path to control group, relative to hierarchy root.
- * @param handle Handle to be used during iteration.
+ * @param path The path to control group, relative to hierarchy root.
+ * @param handle The handle to be used during iteration.
* @param stat Returned first item in the stats file.
* @return #ECGEOF when the stats file is empty.
*/
int cgroup_read_stats_begin(const char *controller, const char *path, void **handle,
- struct cgroup_stat *stat);
+ struct cgroup_stat *stat);
/**
* Read the next stat value.
- * @param handle Handle to be used during iteration.
+ * @param handle The handle to be used during iteration.
* @param stat Returned next item in the stats file.
* @return #ECGEOF when the iterator finishes getting the list of stats.
*/
* Read the tasks file to get the list of tasks in a cgroup.
* @param cgroup Name of the cgroup.
* @param controller Name of the cgroup subsystem.
- * @param handle Handle to be used in the iteration.
+ * @param handle The handle to be used in the iteration.
* @param pid The pid read from the tasks file.
* @return #ECGEOF when the group does not contain any tasks.
*/
int cgroup_get_task_begin(const char *cgroup, const char *controller, void **handle,
- pid_t *pid);
+ pid_t *pid);
/**
* Read the next task value.
/**
* Read the mount table to give a list where each controller is
* mounted.
- * @param handle Handle to be used for iteration.
+ * @param handle The handle to be used for iteration.
* @param info The variable where the path to the controller is stored.
* @return #ECGEOF when no controllers are mounted.
*/
* While walking through the mount table, the controllers are
* returned in order of their mount points, i.e. controllers mounted together
* in one hierarchy are returned next to each other.
- * @param handle Handle to be used for iteration.
+ * @param handle The handle to be used for iteration.
* @param info The variable where the path to the controller is stored.
* @return #ECGEOF when all controllers were already returned.
*/
/**
* Read the first of controllers from /proc/cgroups.
- * @param handle Handle to be used for iteration.
+ * @param handle The handle to be used for iteration.
* @param info The structure which will be filled with controller data.
*/
int cgroup_get_all_controller_begin(void **handle,
struct controller_data *info);
/**
* Read next controllers from /proc/cgroups.
- * @param handle Handle to be used for iteration.
+ * @param handle The handle to be used for iteration.
* @param info The structure which will be filled with controller data.
*/
int cgroup_get_all_controller_next(void **handle, struct controller_data *info);
* Read the first mount point of the hierarchy with given controller.
* The first is the same as the mount point returned by
* cgroup_get_subsys_mount_point().
- * @param handle Handle to be used for iteration.
- * @param controller Controller name.
+ * @param handle The handle to be used for iteration.
+ * @param controller The controller name.
* @param path Buffer to fill the path into. The buffer must be at least
* FILENAME_MAX characters long.
*/
int cgroup_get_subsys_mount_point_begin(const char *controller, void **handle,
- char *path);
+ char *path);
+
/**
* Read next mount point of the hierarchy with given controller.
- * @param handle Handle to be used for iteration.
+ * @param handle The handle to be used for iteration.
* @param path Buffer to fill the path into. The buffer must be at least
* FILENAME_MAX characters long.
*/
-int cgroup_get_subsys_mount_point_next(void **handle,
- char *path);
+int cgroup_get_subsys_mount_point_next(void **handle, char *path);
/**
* Release the iterator.