You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
545 B

  1. @echo off
  2. set root=%~dp0
  3. set source=%root%src
  4. goto start
  5. :format
  6. set filelist=%1
  7. for /r "%filelist%" %%f in (*) do (
  8. if "%%~xf" equ ".h" (
  9. call :format_file %%f
  10. ) else if "%%~xf" equ ".c" (
  11. call :format_file %%f
  12. )
  13. )
  14. goto end
  15. :format_file
  16. set f=%1
  17. if "%~n1" neq "base64" (
  18. if "%~n1" neq "json" (
  19. if "%~n1" neq "uthash" (
  20. echo 'format file "%f%"'
  21. uncrustify -c %root%\.uncrustify.cfg -l C --replace --no-backup %f%
  22. DEL %~dp1*.uncrustify >nul 2>nul
  23. )
  24. )
  25. )
  26. goto end
  27. :start
  28. call :format %source%
  29. :end