IPnom Home • Manuals • FreeBSD

 FreeBSD Man Pages

Man Sections:Commands (1)System Calls (2)Library Functions (3)Device Drivers (4)File Formats (5)Miscellaneous (7)System Utilities (8)
Keyword Live Search (10 results max):
 Type in part of a command in the search box.
 
Index:
  [(1)
  addftinfo(1)
  addr2line(1)
  afmtodit(1)
  alias(1)
  alloc(1)
  apply(1)
  apropos(1)
  ar(1)
  as(1)
  asa(1)
  at(1)
  atq(1)
  atrm(1)
  awk(1)
  b64decode(1)
  b64encode(1)
  basename(1)
  batch(1)
  bc(1)
  bdes(1)
  bg(1)
  biff(1)
  bind(1)
  bindkey(1)
  brandelf(1)
  break(1)
  breaksw(1)
  bsdtar(1)
  bsnmpd(1)
  bthost(1)
  btsockstat(1)
  builtin(1)
  builtins(1)
  bunzip2(1)
  byacc(1)
  bzcat(1)
  bzegrep(1)
  bzfgrep(1)
  bzgrep(1)
  bzip2(1)
  c++(1)
  c89(1)
  c99(1)
  cal(1)
  calendar(1)
  cap_mkdb(1)
  case(1)
  cat(1)
  catman(1)
  cc(1)
  cd(1)
  cdcontrol(1)
  chdir(1)
  checknr(1)
  chflags(1)
  chfn(1)
  chgrp(1)
  chio(1)
  chkey(1)
  chmod(1)
  chpass(1)
  chsh(1)
  ci(1)
  ckdist(1)
  cksum(1)
  clear(1)
  cmp(1)
  co(1)
  col(1)
  colcrt(1)
  colldef(1)
  colrm(1)
  column(1)
  comm(1)
  command(1)
  compile_et(1)
  complete(1)
  compress(1)
  continue(1)
  cp(1)
  cpio(1)
  cpp(1)
  crontab(1)
  crunchgen(1)
  crunchide(1)
  crypt(1)
  csh(1)
  csplit(1)
  ctags(1)
  ctm(1)
  ctm_dequeue(1)
  ctm_rmail(1)
  ctm_smail(1)
  cu(1)
  cursor(1)
  cut(1)
  cvs(1)
  date(1)
  dc(1)
  dd(1)
  default(1)
  df(1)
  dialog(1)
  diff(1)
  diff3(1)
  dig(1)
  dirname(1)
  dirs(1)
  do(1)
  domainname(1)
  done(1)
  dtmfdecode(1)
  du(1)
  echo(1)
  echotc(1)
  ed(1)
  edit(1)
  ee(1)
  egrep(1)
  elfdump(1)
  elif(1)
  else(1)
  end(1)
  endif(1)
  endsw(1)
  enigma(1)
  env(1)
  eqn(1)
  esac(1)
  eval(1)
  ex(1)
  exec(1)
  exit(1)
  expand(1)
  export(1)
  expr(1)
  f77(1)
  false(1)
  fc(1)
  fdformat(1)
  fdread(1)
  fdwrite(1)
  fetch(1)
  fg(1)
  fgrep(1)
  fi(1)
  file(1)
  file2c(1)
  filetest(1)
  find(1)
  finger(1)
  flex++(1)
  flex(1)
  fmt(1)
  fold(1)
  fontedit(1)
  for(1)
  foreach(1)
  from(1)
  fstat(1)
  fsync(1)
  ftp(1)
  g++(1)
  g711conv(1)
  gate-ftp(1)
  gcc(1)
  gcore(1)
  gcov(1)
  gdb(1)
  gencat(1)
  gensnmptree(1)
  getNAME(1)
  getconf(1)
  getfacl(1)
  getopt(1)
  getopts(1)
  glob(1)
  goto(1)
  gperf(1)
  gprof(1)
  grep(1)
  grn(1)
  grodvi(1)
  groff(1)
  grog(1)
  grolbp(1)
  grolj4(1)
  grops(1)
  grotty(1)
  groups(1)
  gtar(1)
  gunzip(1)
  gzcat(1)
  gzexe(1)
  gzip(1)
  hash(1)
  hashstat(1)
  hd(1)
  head(1)
  hesinfo(1)
  hexdump(1)
  history(1)
  host(1)
  hostname(1)
  hpftodit(1)
  hup(1)
  id(1)
  ident(1)
  idprio(1)
  if(1)
  indent(1)
  indxbib(1)
  info(1)
  install-info(1)
  install(1)
  intro(1)
  introduction(1)
  ipcrm(1)
  ipcs(1)
  ipftest(1)
  ipnat(1)
  ipresend(1)
  ipsend(1)
  iptest(1)
  jobid(1)
  jobs(1)
  join(1)
  jot(1)
  kbdcontrol(1)
  kbdmap(1)
  kcon(1)
  kdestroy(1)
  kdump(1)
  kenv(1)
  keylogin(1)
  keylogout(1)
  kgdb(1)
  kill(1)
  killall(1)
  kinit(1)
  klist(1)
  kpasswd(1)
  krb5-config(1)
  ktrace(1)
  lam(1)
  last(1)
  lastcomm(1)
  ld-elf.so.1(1)
  ld(1)
  ld(1)
  ldd(1)
  leave(1)
  less(1)
  lesskey(1)
  lex++(1)
  lex(1)
  limit(1)
  limits(1)
  link(1)
  lint(1)
  lkbib(1)
  ln(1)
  loadfont(1)
  locale(1)
  locate(1)
  lock(1)
  lockf(1)
  log(1)
  logger(1)
  login(1)
  logins(1)
  logname(1)
  logout(1)
  look(1)
  lookbib(1)
  lorder(1)
  lp(1)
  lpq(1)
  lpr(1)
  lprm(1)
  lptest(1)
  ls-F(1)
  ls(1)
  lsvfs(1)
  m4(1)
  mail(1)
  mailq(1)
  mailx(1)
  make(1)
  makeinfo(1)
  makewhatis(1)
  man(1)
  manpath(1)
  md5(1)
  merge(1)
  mesg(1)
  minigzip(1)
  mkdep(1)
  mkdir(1)
  mkfifo(1)
  mklocale(1)
  mkstr(1)
  mktemp(1)
  mmroff(1)
  more(1)
  mptable(1)
  msgs(1)
  mt(1)
  mv(1)
  nawk(1)
  nc(1)
  ncal(1)
  ncplist(1)
  ncplogin(1)
  ncplogout(1)
  neqn(1)
  netstat(1)
  newaliases(1)
  newgrp(1)
  nex(1)
  nfsstat(1)
  nice(1)
  nl(1)
  nm(1)
  nohup(1)
  notify(1)
  nroff(1)
  nslookup(1)
  nvi(1)
  nview(1)
  objcopy(1)
  objdump(1)
  objformat(1)
  od(1)
  omshell(1)
  onintr(1)
  opieinfo(1)
  opiekey(1)
  opiepasswd(1)
  otp-md4(1)
  otp-md5(1)
  otp-sha(1)
  pagesize(1)
  passwd(1)
  paste(1)
  patch(1)
  pathchk(1)
  pawd(1)
  pax(1)
  pfbtops(1)
  pftp(1)
  pgrep(1)
  pic(1)
  pkg_add(1)
  pkg_check(1)
  pkg_create(1)
  pkg_delete(1)
  pkg_info(1)
  pkg_sign(1)
  pkg_version(1)
  pkill(1)
  popd(1)
  pr(1)
  printenv(1)
  printf(1)
  ps(1)
  psroff(1)
  pushd(1)
  pwd(1)
  quota(1)
  ranlib(1)
  rcp(1)
  rcs(1)
  rcsclean(1)
  rcsdiff(1)
  rcsfreeze(1)
  rcsintro(1)
  rcsmerge(1)
  read(1)
  readelf(1)
  readlink(1)
  readonly(1)
  realpath(1)
  red(1)
  ree(1)
  refer(1)
  rehash(1)
  repeat(1)
  reset(1)
  rev(1)
  rfcomm_sppd(1)
  rlog(1)
  rlogin(1)
  rm(1)
  rmd160(1)
  rmdir(1)
  rpcgen(1)
  rs(1)
  rsh(1)
  rtld(1)
  rtprio(1)
  rup(1)
  ruptime(1)
  rusers(1)
  rwall(1)
  rwho(1)
  sched(1)
  scon(1)
  scp(1)
  script(1)
  sdiff(1)
  sed(1)
  send-pr(1)
  sendbug(1)
  set(1)
  setenv(1)
  setfacl(1)
  settc(1)
  setty(1)
  setvar(1)
  sftp(1)
  sh(1)
  sha1(1)
  shar(1)
  shift(1)
  size(1)
  sleep(1)
  slogin(1)
  smbutil(1)
  sockstat(1)
  soelim(1)
  sort(1)
  source(1)
  split(1)
  sscop(1)
  ssh-add(1)
  ssh-agent(1)
  ssh-keygen(1)
  ssh-keyscan(1)
  ssh(1)
  startslip(1)
  stat(1)
  stop(1)
  strings(1)
  strip(1)
  stty(1)
  su(1)
  sum(1)
  suspend(1)
  switch(1)
  systat(1)
  tabs(1)
  tail(1)
  talk(1)
  tar(1)
  tbl(1)
  tcopy(1)
  tcpdump(1)
  tcpslice(1)
  tcsh(1)
  tee(1)
  telltc(1)
  telnet(1)
  test(1)
  texindex(1)
  tfmtodit(1)
  tftp(1)
  then(1)
  time(1)
  tip(1)
  top(1)
  touch(1)
  tput(1)
  tr(1)
  trace(1)
  trap(1)
  troff(1)
  true(1)
  truncate(1)
  truss(1)
  tset(1)
  tsort(1)
  tty(1)
  type(1)
  ul(1)
  ulimit(1)
  umask(1)
  unalias(1)
  uname(1)
  uncomplete(1)
  uncompress(1)
  unexpand(1)
  unhash(1)
  unifdef(1)
  unifdefall(1)
  uniq(1)
  units(1)
  unlimit(1)
  unlink(1)
  unset(1)
  unsetenv(1)
  until(1)
  unvis(1)
  uptime(1)
  usbhidaction(1)
  usbhidctl(1)
  users(1)
  uudecode(1)
  uuencode(1)
  uuidgen(1)
  vacation(1)
  vgrind(1)
  vi(1)
  vidcontrol(1)
  vidfont(1)
  view(1)
  vis(1)
  vt220keys(1)
  vttest(1)
  w(1)
  wait(1)
  wall(1)
  wc(1)
  what(1)
  whatis(1)
  where(1)
  whereis(1)
  which(1)
  while(1)
  who(1)
  whoami(1)
  whois(1)
  window(1)
  write(1)
  xargs(1)
  xstr(1)
  yacc(1)
  yes(1)
  ypcat(1)
  ypchfn(1)
  ypchpass(1)
  ypchsh(1)
  ypmatch(1)
  yppasswd(1)
  ypwhich(1)
  yyfix(1)
  zcat(1)
  zcmp(1)
  zdiff(1)
  zegrep(1)
  zfgrep(1)
  zforce(1)
  zgrep(1)
  zmore(1)
  znew(1)

indent(1)

NAME

     indent -- indent and format C program source


SYNOPSIS

     indent [input-file [output-file]] [-bad | -nbad] [-bap | -nbap]
	    [-bbb | -nbbb] [-bc | -nbc] [-bl] [-br] [-cn] [-cdn]
	    [-cdb | -ncdb] [-ce | -nce] [-cin] [-clin] [-dn] [-din]
	    [-fbs | -nfbs] [-fc1 | -nfc1] [-fcb | -nfcb] [-in] [-ip | -nip]
	    [-ln] [-lcn] [-ldin] [-lp | -nlp] [-npro] [-pcs | -npcs]
	    [-psl | -npsl] [-sc | -nsc] [-sob | -nsob] [-st] [-troff]
	    [-ut | -nut] [-v | -nv]


DESCRIPTION

     The indent utility is a C program formatter.  It reformats the C program
     in the input-file according to the switches.  The switches which can be
     specified are described below.  They may appear before or after the file
     names.

     NOTE: If you only specify an input-file, the formatting is done `in-
     place', that is, the formatted file is written back into input-file and a
     backup copy of input-file is written in the current directory.  If
     input-file is named `/blah/blah/file', the backup file is named
     `file.BAK'.

     If output-file is specified, indent checks to make sure that it is dif-
     ferent from input-file.

     The options listed below control the formatting style imposed by indent.

     -bad, -nbad     If -bad is specified, a blank line is forced after every
		     block of declarations.  Default: -nbad.

     -bap, -nbap     If -bap is specified, a blank line is forced after every
		     procedure body.  Default: -nbap.

     -bbb, -nbbb     If -bbb is specified, a blank line is forced before every
		     block comment.  Default: -nbbb.

     -bc, -nbc	     If -bc is specified, then a newline is forced after each
		     comma in a declaration.  -nbc turns off this option.
		     Default: -nbc.

     -br, -bl	     Specifying -bl lines-up compound statements like this:

			   if (...)
			   {
			     code
			   }

		     Specifying -br (the default) makes them look like this:

			   if (...) {
			     code
			   }

     -cn	     The column in which comments on code start.  The default
		     is 33.

				   /*
				    * this is a comment
				    */

		     Rather than like this:

				   /* this is a comment */

		     This only affects block comments, not comments to the
		     right of code.  The default is -cdb.

     -ce, -nce	     Enables (disables) forcing of `else's to cuddle up to the
		     immediately preceding `}'.  The default is -ce.

     -cin	     Sets the continuation indent to be n.  Continuation lines
		     will be indented that far from the beginning of the first
		     line of the statement.  Parenthesized expressions have
		     extra indentation added to indicate the nesting, unless
		     -lp is in effect or the contination indent is exactly
		     half of the main indent.  -ci defaults to the same value
		     as -i.

     -clin	     Causes case labels to be indented n tab stops to the
		     right of the containing switch statement.	-cli0.5 causes
		     case labels to be indented half a tab stop.  The default
		     is -cli0.

     -dn	     Controls the placement of comments which are not to the
		     right of code.  For example, -d1 means that such comments
		     are placed one indentation level to the left of code.
		     Specifying the default -d0 lines-up these comments with
		     the code.	See the section on comment indentation below.

     -din	     Specifies the indentation, in character positions, of
		     global variable names and all struct/union member names
		     relative to the beginning of their type declaration.  The
		     default is -di16.

     -dj, -ndj	     -dj left justifies declarations.  -ndj indents declara-
		     tions the same as code.  The default is -ndj.

     -ei, -nei	     Enables (disables) special else-if processing.  If it is
		     enabled, an if following an else will have the same
		     indentation as the preceding if statement.  The default
		     is -ei.

     -fbs, -nfbs     Enables (disables) splitting the function declaration and
		     opening brace across two lines.  The default is -fbs.

     -fc1, -nfc1     Enables (disables) the formatting of comments that start
		     in column 1.  Often, comments whose leading `/' is in
		     column 1 have been carefully hand formatted by the pro-
		     grammer.  In such cases, -nfc1 should be used.  The
		     default is -fc1.

     -fcb, -nfcb     Enables (disables) the formatting of block comments (ones
		     that begin with `/*\n').  Often, block comments have been

     -ip, -nip	     Enables (disables) the indentation of parameter declara-
		     tions from the left margin.  The default is -ip.

     -ln	     Maximum length of an output line.	The default is 78.

     -ldin	     Specifies the indentation, in character positions, of
		     local variable names relative to the beginning of their
		     type declaration.	The default is for local variable
		     names to be indented by the same amount as global ones.

     -lp, -nlp	     Lines-up code surrounded by parenthesis in continuation
		     lines.  If a line has a left paren which is not closed on
		     that line, then continuation lines will be lined up to
		     start at the character position just after the left
		     paren.  For example, here is how a piece of continued
		     code looks with -nlp in effect:

			   p1 = first_procedure(second_procedure(p2, p3),
			     third_procedure(p4, p5));

		     With -lp in effect (the default) the code looks somewhat
		     clearer:

			   p1 = first_procedure(second_procedure(p2, p3),
						third_procedure(p4, p5));

		     Inserting two more newlines we get:

			   p1 = first_procedure(second_procedure(p2,
								 p3),
						third_procedure(p4,
								p5));

     -npro	     Causes the profile files, `./.indent.pro' and
		     `~/.indent.pro', to be ignored.

     -pcs, -npcs     If true (-pcs) all procedure calls will have a space
		     inserted between the name and the `('.  The default is
		     -npcs.

     -psl, -npsl     If true (-psl) the names of procedures being defined are
		     placed in column 1 - their types, if any, will be left on
		     the previous lines.  The default is -psl.

     -sc, -nsc	     Enables (disables) the placement of asterisks (`*'s) at
		     the left edge of all comments.  The default is -sc.

     -sob, -nsob     If -sob is specified, indent will swallow optional blank
		     lines.  You can use this to get rid of blank lines after
		     declarations.  Default: -nsob.

     -st	     Causes indent to take its input from stdin and put its
		     output to stdout.

     -Ttypename      Adds typename to the list of type keywords.  Names accu-
		     mulate: -T can be specified more than once.  You need to
		     specify all the typenames that appear in your program
		     troff(1).	It will produce a fancy listing in much the
		     same spirit as vgrind(1).	If the output file is not
		     specified, the default is standard output, rather than
		     formatting in place.

     -ut, -nut	     Enables (disables) the use of tab characters in the out-
		     put.  Tabs are assumed to be aligned on columns divisble
		     by 8.  The default is -ut.

     -v, -nv	     -v turns on `verbose' mode; -nv turns it off.  When in
		     verbose mode, indent reports when it splits one line of
		     input into two or more lines of output, and gives some
		     size statistics at completion.  The default is -nv.

     You may set up your own `profile' of defaults to indent by creating a
     file called .indent.pro in your login directory and/or the current direc-
     tory and including whatever switches you like.  A `.indent.pro' in the
     current directory takes precedence over the one in your login directory.
     If indent is run and a profile file exists, then it is read to set up the
     program's defaults.  Switches on the command line, though, always over-
     ride profile switches.  The switches should be separated by spaces, tabs
     or newlines.

   Comments
     `Box' comments.  The indent utility assumes that any comment with a dash
     or star immediately after the start of comment (that is, `/*-' or `/**')
     is a comment surrounded by a box of stars.  Each line of such a comment
     is left unchanged, except that its indentation may be adjusted to account
     for the change in indentation of the first line of the comment.

     Straight text.  All other comments are treated as straight text.  The
     indent utility fits as many words (separated by blanks, tabs, or new-
     lines) on a line as possible.  Blank lines break paragraphs.

   Comment indentation
     If a comment is on a line with code it is started in the `comment col-
     umn', which is set by the -cn command line parameter.  Otherwise, the
     comment is started at n indentation levels less than where code is cur-
     rently being placed, where n is specified by the -dn command line parame-
     ter.  If the code on a line extends past the comment column, the comment
     starts further to the right, and the right margin may be automatically
     extended in extreme cases.

   Preprocessor lines
     In general, indent leaves preprocessor lines alone.  The only reformat-
     ting that it will do is to straighten up trailing comments.  It leaves
     embedded comments alone.  Conditional compilation (#ifdef...#endif) is
     recognized and indent attempts to correctly compensate for the syntactic
     peculiarities introduced.

   C syntax
     The indent utility understands a substantial amount about the syntax of
     C, but it has a `forgiving' parser.  It attempts to cope with the usual
     sorts of incomplete and misformed syntax.	In particular, the use of
     macros like:

	   #define forever for(;;)



HISTORY

     The indent command appeared in 4.2BSD.


BUGS

     The indent utility has even more switches than ls(1).

     A common mistake is to try to indent all the C programs in a directory by
     typing:

	   indent *.c

     This is probably a bug, not a feature.

FreeBSD 5.4			 June 29, 2004			   FreeBSD 5.4

SPONSORED LINKS




Man(1) output converted with man2html , sed , awk