utils.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * libdpkg - Debian packaging suite library routines
  3. * utils.c - Helper functions for dpkg
  4. *
  5. * Copyright (C) 2001 Wichert Akkerman <wakkerma@debian.org>
  6. *
  7. * This is free software; you can redistribute it and/or modify
  8. * it under the terms of version 2 of the GNU General Public
  9. * License version 2 as published by the Free Software Foundation.
  10. *
  11. * This is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public
  17. * License along with dpkg; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #include <config.h>
  21. /* Reimplementation of the standard ctype.h is* functions. Since gettext
  22. * has overloaded the meaning of LC_CTYPE we can't use that to force C
  23. * locale, so use these cis* functions instead.
  24. */
  25. int cisdigit(int c) {
  26. return (c>='0') && (c<='9');
  27. }
  28. int cisalpha(int c) {
  29. return ((c>='a') && (c<='z')) || ((c>='A') && (c<='Z'));
  30. }