Advertisement
userxbw

Header file C

Aug 18th, 2022
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.34 KB | None | 0 0
  1. /* filelist.h
  2.  
  3. Copyright (C) 1999-2003 Tom Gilbert.
  4.  
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to
  7. deal in the Software without restriction, including without limitation the
  8. rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9. sell copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11.  
  12. The above copyright notice and this permission notice shall be included in
  13. all copies of the Software and its documentation and acknowledgment shall be
  14. given in the documentation and software packages that this Software was
  15. used.
  16.  
  17. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. imPLIED, INCLUDING BUT NOT LimITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  20. THE AUTHORS BE LIABLE FOR ANY CLAim, DAMAGES OR OTHER LIABILITY, WHETHER
  21. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23.  
  24. //aug 10 2017
  25.  
  26. Modifactions made by me.
  27. Same permissions are passed on as formentioned pertaining to the
  28. modifactions made by me.
  29. Copyright (C) 2017 - ... Michael Hearas.
  30.  
  31. */
  32.  
  33. #ifndef FILELIST_H
  34. #define FILELIST_H
  35.  
  36. #include <dirent.h>
  37. #include <Imlib2.h>
  38.  
  39. #ifndef PATH_MAX
  40. #define PATH_MAX 4096
  41. #endif // PATH_MAX
  42.  
  43. typedef struct TheList mylist;
  44.  
  45. typedef int (compare_fn) (mylist *name1, mylist *name2);
  46.  
  47. typedef int (secret_fn) (mylist *secret_name1, mylist *secret_name2);
  48.  
  49. struct TheList
  50. {
  51. char *filename;
  52. int listcount;
  53. mylist *next;
  54. mylist *prev;
  55. };
  56.  
  57. void add_2_front(mylist** filelist, char *filename);
  58. void remove_link(mylist** head, char *value_to_remove);
  59. void display_list(mylist* head);
  60. void prepare_filelist(void);
  61. void sort_list(void);
  62. void insertNode(mylist** head, char *filename, int c);
  63. void add_file_count(mylist* filelist);
  64. void GetFiles(char *name, int indent);
  65.  
  66. char *get_file_name(void);
  67. char *remove_ext (char* mystr, char dot, char sep) ;
  68. char *remove_back(char *front);
  69. char *removeChar( char * string, char letter );
  70. char *get_number_in_list(int numberfile);
  71. char *get_next_name_in_list(void);
  72. char *get_im_name(void);
  73. char *get_absolute_path(char *path);
  74.  
  75. int isDirectory(const char *path);
  76.  int is_regular_file(const char *path);
  77. int check_file_ext(char *name1);
  78. int secret_cmp_filename(mylist *file1, mylist *file2);
  79. int cmp_filename(mylist *file1, mylist *file2);
  80. int list_length(mylist * l);
  81. int get_length(void);
  82.  
  83. Imlib_Image check_image_err(Imlib_Image image);
  84.  
  85.  
  86.  
  87.  
  88. mylist * list_move_down_by_one(mylist * root, mylist * l);
  89. mylist* list_unlink(mylist * root, mylist * l);
  90. mylist * list_add_end(mylist * root, char *filename, int c);
  91. mylist * list_last(mylist * l);
  92. mylist * list_randomize(mylist * list);
  93. mylist *list_time_jump(mylist *l, int num);
  94. mylist *list_sort_merge(mylist * l1, mylist * l2 , compare_fn cmp);
  95. mylist *secret_list_sort(mylist * list, secret_fn cmp);
  96. mylist *secret_sort_murge(mylist * l1, mylist * l2 , secret_fn cmp);
  97. mylist *list_sort(mylist * list, compare_fn cmp);
  98. mylist *  list_bubble_sort(mylist * list);
  99.  
  100. extern mylist* filelist;
  101. extern mylist *current_file;
  102. extern int filelist_len;
  103.  
  104. #endif
  105.  
  106.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement