/[baselayout]/trunk/src/rc.h
Gentoo

Diff of /trunk/src/rc.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 3000 Revision 3001
217/*! Checks that all daemons started with start-stop-daemon by the service 217/*! Checks that all daemons started with start-stop-daemon by the service
218 * are still running. 218 * are still running.
219 * @param service to check 219 * @param service to check
220 * @return true if all daemons started are still running, otherwise false */ 220 * @return true if all daemons started are still running, otherwise false */
221bool rc_service_daemons_crashed (const char *service); 221bool rc_service_daemons_crashed (const char *service);
222
223/*! Wait for a process to finish
224 * @param pid to wait for
225 * @return exit status of the process */
226int rc_waitpid (pid_t pid);
227
228/*! Find processes based on criteria.
229 * All of these are optional.
230 * pid overrides anything else.
231 * If both exec and cmd are given then we ignore exec.
232 * @param exec to check for
233 * @param cmd to check for
234 * @param uid to check for
235 * @param pid to check for
236 * @return NULL terminated list of pids */
237pid_t *rc_find_pids (const char *exec, const char *cmd,
238 uid_t uid, pid_t pid);
239 222
240/*! @name Dependency options 223/*! @name Dependency options
241 * These options can change the services found by the rc_get_depinfo and 224 * These options can change the services found by the rc_get_depinfo and
242 * rc_get_depends functions. */ 225 * rc_get_depends functions. */
243/*! Trace provided services */ 226/*! Trace provided services */
357 340
358/*! Return a NULL terminated string list of enviroment variables made from 341/*! Return a NULL terminated string list of enviroment variables made from
359 * our configuration files. */ 342 * our configuration files. */
360char **rc_env_config (void); 343char **rc_env_config (void);
361 344
345/*! Check if an environment variable is a boolean and return it's value.
346 * If variable is not a boolean then we set errno to be ENOENT when it does
347 * not exist or EINVAL if it's not a boolean.
348 * @param variable to check
349 * @return true if it matches true, yes or 1, false if otherwise. */
350bool rc_env_bool (const char *variable);
351
362/*! @name String List functions 352/*! @name String List functions
363 * Handy functions for dealing with string arrays of char **. 353 * Handy functions for dealing with string arrays of char **.
364 * It's safe to assume that any function here that uses char ** is a string 354 * It's safe to assume that any function here that uses char ** is a string
365 * list that can be manipulated with the below functions. Every string list 355 * list that can be manipulated with the below functions. Every string list
366 * should be released with a call to rc_strlist_free.*/ 356 * should be released with a call to rc_strlist_free.*/
418 408
419/*! Frees each item on the list and the list itself. 409/*! Frees each item on the list and the list itself.
420 * @param list to free */ 410 * @param list to free */
421void rc_strlist_free (char **list); 411void rc_strlist_free (char **list);
422 412
423/*! @name Utility
424 * Although not RC specific functions, they are used by the supporting
425 * applications */
426
427/*! Concatenate paths adding '/' if needed. The resultant pointer should be 413/*! Concatenate paths adding '/' if needed. The resultant pointer should be
428 * freed when finished with. 414 * freed when finished with.
429 * @param path1 starting path 415 * @param path1 starting path
430 * @param paths NULL terminated list of paths to add 416 * @param paths NULL terminated list of paths to add
431 * @return pointer to the new path */ 417 * @return pointer to the new path */
432char *rc_strcatpaths (const char *path1, const char *paths, ...) SENTINEL; 418char *rc_strcatpaths (const char *path1, const char *paths, ...) SENTINEL;
433 419
434/*! Check if an environment variable is a boolean and return it's value. 420/*! Find processes based on criteria.
435 * If variable is not a boolean then we set errno to be ENOENT when it does 421 * All of these are optional.
436 * not exist or EINVAL if it's not a boolean. 422 * pid overrides anything else.
423 * If both exec and cmd are given then we ignore exec.
424 * @param exec to check for
425 * @param cmd to check for
437 * @param variable to check 426 * @param uid to check for
438 * @return true if it matches true, yes or 1, false if otherwise. */ 427 * @param pid to check for
439bool rc_env_bool (const char *variable); 428 * @return NULL terminated list of pids */
429pid_t *rc_find_pids (const char *exec, const char *cmd,
430 uid_t uid, pid_t pid);
431
440 432
441#endif 433#endif

Legend:
Removed from v.3000  
changed lines
  Added in v.3001

  ViewVC Help
Powered by ViewVC 1.1.20