getopt.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // Copyright 2026 Aarav Ravindra Kharade
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. /* Declarations for getopt.
  17. Copyright (C) 1989-2026 Free Software Foundation, Inc.
  18. This file is part of the GNU C Library.
  19. Unlike the bulk of the getopt implementation, this file is NOT part
  20. of gnulib; gnulib also has a getopt.h but it is different.
  21. The GNU C Library is free software; you can redistribute it and/or
  22. modify it under the terms of the GNU Lesser General Public
  23. License as published by the Free Software Foundation; either
  24. version 2.1 of the License, or (at your option) any later version.
  25. The GNU C Library is distributed in the hope that it will be useful,
  26. but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  28. Lesser General Public License for more details.
  29. You should have received a copy of the GNU Lesser General Public
  30. License along with the GNU C Library; if not, see
  31. <https://www.gnu.org/licenses/>. */
  32. #ifndef _GETOPT_H
  33. #define _GETOPT_H 1
  34. #include <features.h>
  35. /* The type of the 'argv' argument to getopt_long and getopt_long_only
  36. is properly 'char **', since both functions may write to the array
  37. (in order to move all the options to the beginning). However, for
  38. compatibility with old versions of LSB, glibc has to use 'char *const *'
  39. instead. */
  40. #ifndef __getopt_argv_const
  41. # define __getopt_argv_const const
  42. #endif
  43. #include <bits/getopt_core.h>
  44. #include <bits/getopt_ext.h>
  45. #endif /* getopt.h */