Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
53bb7c3c
Commit
53bb7c3c
authored
15 years ago
by
Don Lipari
Browse files
Options
Downloads
Patches
Plain Diff
Copied some of the slurm_list_*() function defs into slurm.h.in
parent
e4b32cb3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
slurm/slurm.h.in
+116
-0
116 additions, 0 deletions
slurm/slurm.h.in
src/common/list.h
+3
-0
3 additions, 0 deletions
src/common/list.h
with
119 additions
and
0 deletions
slurm/slurm.h.in
+
116
−
0
View file @
53bb7c3c
...
@@ -2841,6 +2841,122 @@ extern char * slurm_hostlist_shift PARAMS(( hostlist_t hl ));
...
@@ -2841,6 +2841,122 @@ extern char * slurm_hostlist_shift PARAMS(( hostlist_t hl ));
*/
*/
extern void slurm_hostlist_uniq PARAMS((hostlist_t hl));
extern void slurm_hostlist_uniq PARAMS((hostlist_t hl));
/*****************************************************************************\
* SLURM LIST FUNCTIONS
\*****************************************************************************/
#ifndef __list_datatypes_defined
# define __list_datatypes_defined
typedef struct list * List;
/*
* List opaque data type.
*/
typedef struct listIterator * ListIterator;
/*
* List Iterator opaque data type.
*/
typedef void (*ListDelF) (void *x);
/*
* Function prototype to deallocate data stored in a list.
* This function is responsible for freeing all memory associated
* with an item, including all subordinate items (if applicable).
*/
typedef int (*ListCmpF) (void *x, void *y);
/*
* Function prototype for comparing two items in a list.
* Returns less-than-zero if (x<y), zero if (x==y), and
* greather-than-zero if (x>y).
*/
typedef int (*ListFindF) (void *x, void *key);
/*
* Function prototype for matching items in a list.
* Returns non-zero if (x==key); o/w returns zero.
*/
typedef int (*ListForF) (void *x, void *arg);
/*
* Function prototype for operating on each item in a list.
* Returns less-than-zero on error.
*/
#endif
/* slurm_list_append():
*
* Inserts data [x] at the end of list [l].
* Returns the data's ptr, or lsd_nomem_error() if insertion failed.
*/
extern void * slurm_list_append PARAMS((List l, void *x));
/* slurm_list_count():
*
* Returns the number of items in list [l].
*/
extern int slurm_list_count PARAMS((List l));
/* slurm_list_create():
*
* Creates and returns a new empty list, or lsd_nomem_error() on failure.
* The deletion function [f] is used to deallocate memory used by items
* in the list; if this is NULL, memory associated with these items
* will not be freed when the list is destroyed.
* Note: Abandoning a list without calling slurm_list_destroy() will result
* in a memory leak.
*/
extern List slurm_list_create PARAMS((ListDelF f));
/* slurm_list_destroy():
*
* Destroys list [l], freeing memory used for list iterators and the
* list itself; if a deletion function was specified when the list
* was created, it will be called for each item in the list.
*/
extern void slurm_list_destroy PARAMS((List l));
/* slurm_list_find():
*
* Traverses the list from the point of the list iterator [i]
* using [f] to match each item with [key].
* Returns a ptr to the next item for which the function [f]
* returns non-zero, or NULL once the end of the list is reached.
* Example: i=slurm_list_iterator_reset(i);
* while ((x=slurm_list_find(i,f,k))) {...}
*/
extern void * slurm_list_find PARAMS((ListIterator i, ListFindF f, void *key));
/* slurm_list_is_empty():
*
* Returns non-zero if list [l] is empty; o/w returns zero.
*/
extern int slurm_list_is_empty PARAMS((List l));
/* slurm_list_iterator_reset():
*
* Resets the list iterator [i] to start traversal at the beginning
* of the list.
*/
extern void slurm_list_iterator_reset PARAMS((ListIterator i));
/* slurm_list_next():
*
* Returns a ptr to the next item's data,
* or NULL once the end of the list is reached.
* Example: i=slurm_list_iterator_create(i);
* while ((x=slurm_list_next(i))) {...}
*/
extern void * slurm_list_next PARAMS((ListIterator i));
/* slurm_list_sort():
*
* Sorts list [l] into ascending order according to the function [f].
* Note: Sorting a list resets all iterators associated with the list.
* Note: The sort algorithm is stable.
*/
extern void slurm_list_sort PARAMS((List l, ListCmpF f));
/*****************************************************************************\
/*****************************************************************************\
* SLURM TRIGGER FUNCTIONS
* SLURM TRIGGER FUNCTIONS
\*****************************************************************************/
\*****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
src/common/list.h
+
3
−
0
View file @
53bb7c3c
...
@@ -66,6 +66,8 @@
...
@@ -66,6 +66,8 @@
* Data Types *
* Data Types *
****************/
****************/
#ifndef __list_datatypes_defined
# define __list_datatypes_defined
typedef
struct
list
*
List
;
typedef
struct
list
*
List
;
/*
/*
* List opaque data type.
* List opaque data type.
...
@@ -101,6 +103,7 @@ typedef int (*ListForF) (void *x, void *arg);
...
@@ -101,6 +103,7 @@ typedef int (*ListForF) (void *x, void *arg);
* Function prototype for operating on each item in a list.
* Function prototype for operating on each item in a list.
* Returns less-than-zero on error.
* Returns less-than-zero on error.
*/
*/
#endif
/*******************************
/*******************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment