VirtualBox

source: vbox/trunk/src/libs/libpng-1.6.36/contrib/tools/reindent@ 76680

Last change on this file since 76680 was 76030, checked in by vboxsync, 6 years ago

libpng-1.6.36: properly export to OSE, and while at it fix EOL style for shell scripts

  • Property svn:eol-style set to native
File size: 891 bytes
Line 
1#!/bin/sh
2
3# reindent a libpng C source
4
5# COPYRIGHT: Written by Glenn Randers-Pehrson, 2016.
6# To the extent possible under law, the author has waived all copyright and
7# related or neighboring rights to this work. This work is published from:
8# United States.
9
10# Usage:
11# reindent inputtabsize outputtabsize inputcontinuestring outputcontinuestring
12#
13# Assumes that continued lines begin with indentation plus one space, and
14# that continued comments begin with indentation plus " *".
15#
16# eg, to change libpng coding style from 3-space indentation with 4-space
17# continuations to 4-space indentation with 2-space continuations:
18#
19# reindent 3 4 "\t " " " < example.c > example.c_4_2
20# and to restore the file back to libpng coding style
21# reindent 4 3 " " " " < example.c_4_2 > example.c_3_4
22
23unexpand --first-only --t $1 | \
24 sed -e "/^ *$3[^\*]/{s/$3/$4/}" | \
25 expand -t $2
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette