Skip to content

Commit

Permalink
A stub for string compression.
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 16, 2011
1 parent f55e22e commit 22f2107
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions ib2slurm.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,27 @@ void output_nodelist(char *tag, int type, ib2slurm_opts_t* opts, ibnd_node_t* no
}

if(opts->compress_flag) {
/* TODO */
//print_with_compression(&list_head, tag);
print_with_compression(&list_head, tag);
} else {
print_without_compression(&list_head, tag);
}

/* TODO: free the list elements. */
}

/*
* This attempts to print the list in a compressed format,
* such as common[min-max].
*/
void print_with_compression(ib2slurm_list_t* list, char* tag)
{
fprintf(stderr, "Sorry, compressing strings isn't implemented yet.\n");
exit(EXIT_FAILURE);
}

/*
* This prints the list to be formatted as seperated by commas.
*/
void print_without_compression(ib2slurm_list_t* list, char* tag)
{
ib2slurm_list_t* list_cur = NULL;
Expand Down
2 changes: 1 addition & 1 deletion ib2slurm.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ typedef struct ib2slurm_list_t {
void switch_iter_func(ibnd_node_t* node, void* user_data);
void output_nodelist(char *tag, int type, ib2slurm_opts_t* opts, ibnd_node_t* node);
void print_without_compression(ib2slurm_list_t* list, char* tag);
//void print_with_compression(ib2slurm_list_t* list, char* tag);
void print_with_compression(ib2slurm_list_t* list, char* tag);
char* node_name(ibnd_node_t* node, ib2slurm_opts_t* opts);

#endif /* __IB2SLURM_H */

0 comments on commit 22f2107

Please sign in to comment.