Blame src/mangen.cpp

Packit Service 50c9f2
/******************************************************************************
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * 
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Copyright (C) 1997-2015 by Dimitri van Heesch.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Permission to use, copy, modify, and distribute this software and its
Packit Service 50c9f2
 * documentation under the terms of the GNU General Public License is hereby 
Packit Service 50c9f2
 * granted. No representations are made about the suitability of this software 
Packit Service 50c9f2
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit Service 50c9f2
 * See the GNU General Public License for more details.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Documents produced by Doxygen are derivative works derived from the
Packit Service 50c9f2
 * input used in their production; they are not affected by this license.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 */
Packit Service 50c9f2
Packit Service 50c9f2
/* http://www.cubic.org/source/archive/fileform/txt/man/ has some
Packit Service 50c9f2
   nice introductions to groff and man pages. */
Packit Service 50c9f2
Packit Service 50c9f2
#include <stdlib.h>
Packit Service 50c9f2
Packit Service 50c9f2
#include <qdir.h>
Packit Service 50c9f2
#include "message.h"
Packit Service 50c9f2
#include "mangen.h"
Packit Service 50c9f2
#include "config.h"
Packit Service 50c9f2
#include "util.h"
Packit Service 50c9f2
#include "doxygen.h"
Packit Service 50c9f2
#include <string.h>
Packit Service 50c9f2
#include "docparser.h"
Packit Service 50c9f2
#include "mandocvisitor.h"
Packit Service 50c9f2
#include "language.h"
Packit Service 50c9f2
Packit Service 50c9f2
static QCString getExtension()
Packit Service 50c9f2
{
Packit Service 50c9f2
  /*
Packit Service 50c9f2
   * [.][nuber][rest]
Packit Service 50c9f2
   * in case of . missing, just ignore it
Packit Service 50c9f2
   * in case number missing, just place a 3 in front of it
Packit Service 50c9f2
   */
Packit Service 50c9f2
  QCString ext = Config_getString(MAN_EXTENSION);
Packit Service 50c9f2
  if (ext.isEmpty())
Packit Service 50c9f2
  {
Packit Service 50c9f2
    ext = "3"; 
Packit Service 50c9f2
  }
Packit Service 50c9f2
  else
Packit Service 50c9f2
  {
Packit Service 50c9f2
    if (ext.at(0)=='.')
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (ext.length()==1)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        ext = "3"; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else // strip .
Packit Service 50c9f2
      {
Packit Service 50c9f2
        ext = ext.mid(1);
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
    if (ext.at(0)<'0' || ext.at(0)>'9')
Packit Service 50c9f2
    {
Packit Service 50c9f2
      ext.prepend("3");
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
  return ext;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
static QCString getSubdir()
Packit Service 50c9f2
{
Packit Service 50c9f2
  QCString dir = Config_getString(MAN_SUBDIR);
Packit Service 50c9f2
  if (dir.isEmpty())
Packit Service 50c9f2
  {
Packit Service 50c9f2
    dir = "man" + getExtension();
Packit Service 50c9f2
  }
Packit Service 50c9f2
  return dir;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
ManGenerator::ManGenerator() : OutputGenerator()
Packit Service 50c9f2
{
Packit Service 50c9f2
  dir=Config_getString(MAN_OUTPUT) + "/" + getSubdir();
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
  paragraph=TRUE;
Packit Service 50c9f2
  col=0;
Packit Service 50c9f2
  upperCase=FALSE;
Packit Service 50c9f2
  insideTabbing=FALSE;
Packit Service 50c9f2
  inHeader=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
ManGenerator::~ManGenerator()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
//void ManGenerator::append(const OutputGenerator *g)
Packit Service 50c9f2
//{
Packit Service 50c9f2
//  QCString r=g->getContents();
Packit Service 50c9f2
//  if (upperCase)
Packit Service 50c9f2
//    t << r.upper();
Packit Service 50c9f2
//  else
Packit Service 50c9f2
//    t << r;
Packit Service 50c9f2
//  if (!r.isEmpty())
Packit Service 50c9f2
//    firstCol = r.at(r.length()-1)=='\n';
Packit Service 50c9f2
//  else
Packit Service 50c9f2
//    firstCol = ((ManGenerator *)g)->firstCol;
Packit Service 50c9f2
//  col+=((ManGenerator *)g)->col;
Packit Service 50c9f2
//  inHeader=((ManGenerator *)g)->inHeader;
Packit Service 50c9f2
//  paragraph=FALSE;
Packit Service 50c9f2
//}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::init()
Packit Service 50c9f2
{
Packit Service 50c9f2
  QCString &manOutput = Config_getString(MAN_OUTPUT);
Packit Service 50c9f2
  
Packit Service 50c9f2
  QDir d(manOutput);
Packit Service 50c9f2
  if (!d.exists() && !d.mkdir(manOutput))
Packit Service 50c9f2
  {
Packit Service 50c9f2
    err("Could not create output directory %s\n",manOutput.data());
Packit Service 50c9f2
    exit(1);
Packit Service 50c9f2
  }
Packit Service 50c9f2
  d.setPath(manOutput + "/" + getSubdir());
Packit Service 50c9f2
  if (!d.exists() && !d.mkdir(manOutput + "/" + getSubdir()))
Packit Service 50c9f2
  {
Packit Service 50c9f2
    err("Could not create output directory %s/%s\n",manOutput.data(), getSubdir().data());
Packit Service 50c9f2
    exit(1);
Packit Service 50c9f2
  }
Packit Service 50c9f2
  createSubDirs(d);
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
static QCString buildFileName(const char *name)
Packit Service 50c9f2
{
Packit Service 50c9f2
  QCString fileName;
Packit Service 50c9f2
  if (name==0) return "noname";
Packit Service 50c9f2
Packit Service 50c9f2
  const char *p=name;
Packit Service 50c9f2
  char c;
Packit Service 50c9f2
  while ((c=*p++))
Packit Service 50c9f2
  {
Packit Service 50c9f2
    switch (c)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      case ':':
Packit Service 50c9f2
        fileName+="_";
Packit Service 50c9f2
        if (*p==':') p++;
Packit Service 50c9f2
        break;
Packit Service 50c9f2
      case '<':
Packit Service 50c9f2
      case '>':
Packit Service 50c9f2
      case '&':
Packit Service 50c9f2
      case '*':
Packit Service 50c9f2
      case '!':
Packit Service 50c9f2
      case '^':
Packit Service 50c9f2
      case '~':
Packit Service 50c9f2
      case '%':
Packit Service 50c9f2
      case '+':
Packit Service 50c9f2
      case '/':
Packit Service 50c9f2
        fileName+="_";
Packit Service 50c9f2
        break;
Packit Service 50c9f2
      default:
Packit Service 50c9f2
        fileName+=c;
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
Packit Service 50c9f2
  QCString manExtension = "." + getExtension();
Packit Service 50c9f2
  if (fileName.right(manExtension.length())!=manExtension) 
Packit Service 50c9f2
  {
Packit Service 50c9f2
    fileName+=manExtension;
Packit Service 50c9f2
  }
Packit Service 50c9f2
Packit Service 50c9f2
  return fileName;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startFile(const char *,const char *manName,const char *)
Packit Service 50c9f2
{
Packit Service 50c9f2
  startPlainFile( buildFileName( manName ) );
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endFile()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << endl;
Packit Service 50c9f2
  endPlainFile();
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endTitleHead(const char *,const char *name)
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << ".TH \"" << name << "\" " << getExtension() << " \"" 
Packit Service 50c9f2
    << dateToString(FALSE) << "\" \"";
Packit Service 50c9f2
  if (!Config_getString(PROJECT_NUMBER).isEmpty())
Packit Service 50c9f2
    t << "Version " << Config_getString(PROJECT_NUMBER) << "\" \"";
Packit Service 50c9f2
  if (Config_getString(PROJECT_NAME).isEmpty()) 
Packit Service 50c9f2
    t << "Doxygen";
Packit Service 50c9f2
  else
Packit Service 50c9f2
    t << Config_getString(PROJECT_NAME);
Packit Service 50c9f2
  t << "\" \\\" -*- nroff -*-" << endl;
Packit Service 50c9f2
  t << ".ad l" << endl;
Packit Service 50c9f2
  t << ".nh" << endl;
Packit Service 50c9f2
  t << ".SH NAME" << endl;
Packit Service 50c9f2
  t << name;
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
  paragraph=TRUE;
Packit Service 50c9f2
  inHeader=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::newParagraph()
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!paragraph)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    if (!firstCol) t << endl;
Packit Service 50c9f2
    t << ".PP" << endl;
Packit Service 50c9f2
    firstCol=TRUE;
Packit Service 50c9f2
  }
Packit Service 50c9f2
  paragraph=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startParagraph(const char *)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!paragraph)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    if (!firstCol) t << endl;
Packit Service 50c9f2
    t << ".PP" << endl;
Packit Service 50c9f2
    firstCol=TRUE;
Packit Service 50c9f2
  }
Packit Service 50c9f2
  paragraph=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endParagraph()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::writeString(const char *text)
Packit Service 50c9f2
{
Packit Service 50c9f2
  docify(text);
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startIndexItem(const char *,const char *)
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endIndexItem(const char *,const char *)
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::writeStartAnnoItem(const char *,const char *,
Packit Service 50c9f2
                                       const char *,const char *)
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::writeObjectLink(const char *,const char *,
Packit Service 50c9f2
                                    const char *, const char *name)
Packit Service 50c9f2
{
Packit Service 50c9f2
  startBold(); docify(name); endBold();
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::writeCodeLink(const char *,const char *,
Packit Service 50c9f2
                                 const char *, const char *name,
Packit Service 50c9f2
                                 const char *)
Packit Service 50c9f2
{
Packit Service 50c9f2
  docify(name);
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startHtmlLink(const char *)
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endHtmlLink()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
//void ManGenerator::writeMailLink(const char *url)
Packit Service 50c9f2
//{
Packit Service 50c9f2
//  docify(url);
Packit Service 50c9f2
//}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startGroupHeader(int)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << ".SH \"";
Packit Service 50c9f2
  upperCase=TRUE;
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endGroupHeader(int)
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\"\n.PP " << endl;
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
  paragraph=TRUE;
Packit Service 50c9f2
  upperCase=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startMemberHeader(const char *)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << ".SS \"";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endMemberHeader()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\"\n";
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::docify(const char *str)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (str)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    const char *p=str;
Packit Service 50c9f2
    char c=0;
Packit Service 50c9f2
    while ((c=*p++)) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch(c)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case '-':  t << "\\-"; break; // see  bug747780
Packit Service 50c9f2
        case '.':  t << "\\&.;; break; // see  bug652277
Packit Service 50c9f2
        case '\\': t << "\\\\"; col++; break;
Packit Service 50c9f2
        case '\n': t << "\n"; col=0; break;
Packit Service 50c9f2
        case '\"':  c = '\''; // no break!
Packit Service 50c9f2
        default: t << c; col++; break;
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
    firstCol=(c=='\n');
Packit Service 50c9f2
    //printf("%s",str);fflush(stdout);
Packit Service 50c9f2
  }
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::codify(const char *str)
Packit Service 50c9f2
{
Packit Service 50c9f2
  //static char spaces[]="        ";
Packit Service 50c9f2
  if (str)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    const char *p=str;
Packit Service 50c9f2
    char c;
Packit Service 50c9f2
    int spacesToNextTabStop;
Packit Service 50c9f2
    while (*p)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      c=*p++;
Packit Service 50c9f2
      switch(c)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case '.':   t << "\\&.;; break; // see  bug652277
Packit Service 50c9f2
        case '\t':  spacesToNextTabStop =
Packit Service 50c9f2
                          Config_getInt(TAB_SIZE) - (col%Config_getInt(TAB_SIZE));
Packit Service 50c9f2
                    t << Doxygen::spaces.left(spacesToNextTabStop); 
Packit Service 50c9f2
                    col+=spacesToNextTabStop; 
Packit Service 50c9f2
                    break;
Packit Service 50c9f2
        case '\n':  t << "\n"; firstCol=TRUE; col=0; break;
Packit Service 50c9f2
        case '\\':  t << "\\"; col++; break;
Packit Service 50c9f2
        case '\"':  // no break!
Packit Service 50c9f2
        default:    p=writeUtf8Char(t,p-1); firstCol=FALSE; col++; break;
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
    //printf("%s",str);fflush(stdout);
Packit Service 50c9f2
  }
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::writeChar(char c)
Packit Service 50c9f2
{
Packit Service 50c9f2
  firstCol=(c=='\n');
Packit Service 50c9f2
  if (firstCol) col=0; else col++;
Packit Service 50c9f2
  switch (c)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    case '\\': t << "\\\\"; break;
Packit Service 50c9f2
  case '\"': c = '\''; // no break!
Packit Service 50c9f2
    default:   t << c; break;
Packit Service 50c9f2
  }
Packit Service 50c9f2
  //printf("%c",c);fflush(stdout);
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startDescList(SectionTypes)      
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) 
Packit Service 50c9f2
  { t << endl << ".PP" << endl; 
Packit Service 50c9f2
    firstCol=TRUE; paragraph=TRUE; 
Packit Service 50c9f2
    col=0;
Packit Service 50c9f2
  }
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
  startBold();
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startTitle() 
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (!firstCol) t << endl; 
Packit Service 50c9f2
  t << ".SH \""; 
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endTitle()
Packit Service 50c9f2
{
Packit Service 50c9f2
    t << "\"";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startItemListItem() 
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (!firstCol) t << endl; 
Packit Service 50c9f2
  t << ".TP" << endl; 
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
  col=0;
Packit Service 50c9f2
} 
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endItemListItem()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startCodeFragment() 
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  newParagraph();
Packit Service 50c9f2
  t << ".nf" << endl; 
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endCodeFragment()   
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << ".fi" << endl; 
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
  col=0;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool) 
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << ".SS \""; 
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startDoxyAnchor(const char *,const char *manName,
Packit Service 50c9f2
                                   const char *, const char *name,
Packit Service 50c9f2
                                   const char *)
Packit Service 50c9f2
{
Packit Service 50c9f2
    // something to be done?
Packit Service 50c9f2
    if( !Config_getBool(MAN_LINKS) ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
	return; // no
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    // the name of the link file is derived from the name of the anchor:
Packit Service 50c9f2
    // - truncate after an (optional) ::
Packit Service 50c9f2
    QCString baseName = name;
Packit Service 50c9f2
    int i=baseName.findRev("::");
Packit Service 50c9f2
    if (i!=-1) baseName=baseName.right(baseName.length()-i-2);
Packit Service 50c9f2
Packit Service 50c9f2
    //printf("Converting man link '%s'->'%s'->'%s'\n",
Packit Service 50c9f2
    //       name,baseName.data(),buildFileName(baseName).data());
Packit Service 50c9f2
    
Packit Service 50c9f2
    // - remove dangerous characters and append suffix, then add dir prefix
Packit Service 50c9f2
    QCString fileName=dir+"/"+buildFileName( baseName );
Packit Service 50c9f2
    QFile linkfile( fileName );
Packit Service 50c9f2
    // - only create file if it doesn't exist already
Packit Service 50c9f2
    if ( !linkfile.open( IO_ReadOnly ) ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
	if ( linkfile.open( IO_WriteOnly ) ) 
Packit Service 50c9f2
        {
Packit Service 50c9f2
	      FTextStream linkstream;
Packit Service 50c9f2
	      linkstream.setDevice(&linkfile);
Packit Service 50c9f2
	      //linkstream.setEncoding(QTextStream::UnicodeUTF8);
Packit Service 50c9f2
	      linkstream << ".so " << getSubdir() << "/" << buildFileName( manName ) << endl;
Packit Service 50c9f2
	}
Packit Service 50c9f2
    }
Packit Service 50c9f2
    linkfile.close();
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endMemberDoc(bool)
Packit Service 50c9f2
{
Packit Service 50c9f2
    t << "\"\n";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startSubsection()    
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << ".SS \""; 
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endSubsection()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\"";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startSubsubsection() 
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << "\n.SS \""; 
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endSubsubsection()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\"";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::writeSynopsis()      
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << ".SH SYNOPSIS\n.br\n.PP\n"; 
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startDescItem()
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << ".IP \"";
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
//void ManGenerator::endDescTitle()
Packit Service 50c9f2
//{
Packit Service 50c9f2
//  endBold();
Packit Service 50c9f2
//  paragraph=TRUE;
Packit Service 50c9f2
//}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startDescForItem()
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  if (!paragraph) t << ".in -1c" << endl;
Packit Service 50c9f2
  t << ".in +1c" << endl;
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
  col=0;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endDescForItem()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endDescItem()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\" 1c" << endl;
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startAnonTypeScope(int indentLevel)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (indentLevel==0)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    insideTabbing=TRUE;
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endAnonTypeScope(int indentLevel)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (indentLevel==0)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    insideTabbing=FALSE;
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startMemberItem(const char *,int,const char *) 
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (firstCol && !insideTabbing) t << ".in +1c\n";
Packit Service 50c9f2
  t << "\n.ti -1c\n.RI \""; 
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endMemberItem() 
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  t << "\"\n.br"; 
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startMemberList() 
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (!insideTabbing)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    t << "\n.in +1c"; firstCol=FALSE; 
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endMemberList() 
Packit Service 50c9f2
{ 
Packit Service 50c9f2
  if (!insideTabbing)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    t << "\n.in -1c"; firstCol=FALSE; 
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startMemberGroupHeader(bool)
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\n.PP\n.RI \"\\fB";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endMemberGroupHeader()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\\fP\"\n.br\n";
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startMemberGroupDocs()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endMemberGroupDocs()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\n.PP";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startMemberGroup()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\n.in +1c";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endMemberGroup(bool)
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\n.in -1c";
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startSection(const char *,const char *,SectionInfo::SectionType type)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if( !inHeader ) 
Packit Service 50c9f2
  {
Packit Service 50c9f2
    switch(type)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      case SectionInfo::Page:          startGroupHeader(FALSE); break;
Packit Service 50c9f2
      case SectionInfo::Section:       startGroupHeader(FALSE); break;
Packit Service 50c9f2
      case SectionInfo::Subsection:    startMemberHeader(0); break;
Packit Service 50c9f2
      case SectionInfo::Subsubsection: startMemberHeader(0); break;
Packit Service 50c9f2
      case SectionInfo::Paragraph:     startMemberHeader(0); break;
Packit Service 50c9f2
      default: ASSERT(0); break;
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endSection(const char *,SectionInfo::SectionType type)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if( !inHeader )
Packit Service 50c9f2
  {
Packit Service 50c9f2
    switch(type)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      case SectionInfo::Page:          endGroupHeader(0); break;
Packit Service 50c9f2
      case SectionInfo::Section:       endGroupHeader(0); break;
Packit Service 50c9f2
      case SectionInfo::Subsection:    endMemberHeader(); break;
Packit Service 50c9f2
      case SectionInfo::Subsubsection: endMemberHeader(); break;
Packit Service 50c9f2
      case SectionInfo::Paragraph:     endMemberHeader(); break;
Packit Service 50c9f2
      default: ASSERT(0); break;
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
  else
Packit Service 50c9f2
  {
Packit Service 50c9f2
    t << "\n";
Packit Service 50c9f2
    firstCol=TRUE;
Packit Service 50c9f2
    paragraph=FALSE;
Packit Service 50c9f2
    inHeader=FALSE;
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startSimpleSect(SectionTypes,const char *,
Packit Service 50c9f2
                                   const char *,const char *title)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) 
Packit Service 50c9f2
  { t << endl << ".PP" << endl; 
Packit Service 50c9f2
    firstCol=TRUE; paragraph=TRUE; 
Packit Service 50c9f2
    col=0;
Packit Service 50c9f2
  }
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
  startBold();
Packit Service 50c9f2
  docify(title);
Packit Service 50c9f2
  endBold();
Packit Service 50c9f2
  paragraph=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endSimpleSect()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startParamList(ParamListTypes,const char *title)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) 
Packit Service 50c9f2
  { t << endl << ".PP" << endl; 
Packit Service 50c9f2
    firstCol=TRUE; paragraph=TRUE; 
Packit Service 50c9f2
    col=0;
Packit Service 50c9f2
  }
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
  startBold();
Packit Service 50c9f2
  docify(title);
Packit Service 50c9f2
  endBold();
Packit Service 50c9f2
  paragraph=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endParamList()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *)
Packit Service 50c9f2
{
Packit Service 50c9f2
  ManDocVisitor *visitor = new ManDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""));
Packit Service 50c9f2
  n->accept(visitor);
Packit Service 50c9f2
  delete visitor; 
Packit Service 50c9f2
  firstCol=FALSE;
Packit Service 50c9f2
  paragraph = FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startConstraintList(const char *header)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) 
Packit Service 50c9f2
  { t << endl << ".PP" << endl; 
Packit Service 50c9f2
    firstCol=TRUE; paragraph=TRUE; 
Packit Service 50c9f2
    col=0;
Packit Service 50c9f2
  }
Packit Service 50c9f2
  paragraph=FALSE;
Packit Service 50c9f2
  startBold();
Packit Service 50c9f2
  docify(header);
Packit Service 50c9f2
  endBold();
Packit Service 50c9f2
  paragraph=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startConstraintParam()
Packit Service 50c9f2
{
Packit Service 50c9f2
  startItemListItem();
Packit Service 50c9f2
  startEmphasis();
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endConstraintParam()
Packit Service 50c9f2
{
Packit Service 50c9f2
  endEmphasis();
Packit Service 50c9f2
  endItemListItem();
Packit Service 50c9f2
  t << " : ";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startConstraintType()
Packit Service 50c9f2
{
Packit Service 50c9f2
  startEmphasis();
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endConstraintType()
Packit Service 50c9f2
{
Packit Service 50c9f2
  endEmphasis();
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startConstraintDocs()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endConstraintDocs()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << endl; firstCol=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endConstraintList()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startInlineHeader() 
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) 
Packit Service 50c9f2
  {
Packit Service 50c9f2
    t << endl << ".PP" << endl << ".in -1c" << endl;
Packit Service 50c9f2
  }
Packit Service 50c9f2
  t << ".RI \"\\fB"; 
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endInlineHeader() 
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\\fP\"" << endl << ".in +1c" << endl;
Packit Service 50c9f2
  firstCol = FALSE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startMemberDocSimple(bool isEnum)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) 
Packit Service 50c9f2
  {
Packit Service 50c9f2
    t << endl << ".PP" << endl;
Packit Service 50c9f2
  }
Packit Service 50c9f2
  t << "\\fB";
Packit Service 50c9f2
  if (isEnum)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    docify(theTranslator->trEnumerationValues());
Packit Service 50c9f2
  }
Packit Service 50c9f2
  else
Packit Service 50c9f2
  {
Packit Service 50c9f2
    docify(theTranslator->trCompoundMembers());
Packit Service 50c9f2
  }
Packit Service 50c9f2
  t << ":\\fP" << endl;
Packit Service 50c9f2
  t << ".RS 4" << endl;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endMemberDocSimple(bool)
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << ".RE" << endl;
Packit Service 50c9f2
  t << ".PP" << endl;
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startInlineMemberType()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endInlineMemberType()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << " ";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startInlineMemberName()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\\fI";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endInlineMemberName()
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\\fP ";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startInlineMemberDoc()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endInlineMemberDoc()
Packit Service 50c9f2
{
Packit Service 50c9f2
  if (!firstCol) t << endl;
Packit Service 50c9f2
  t << ".br" << endl;
Packit Service 50c9f2
  t << ".PP" << endl;
Packit Service 50c9f2
  firstCol=TRUE;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::startLabels()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::writeLabel(const char *l,bool isLast)
Packit Service 50c9f2
{
Packit Service 50c9f2
  t << "\\fC [" << l << "]\\fP";
Packit Service 50c9f2
  if (!isLast) t << ", ";
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endLabels()
Packit Service 50c9f2
{
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void ManGenerator::endHeaderSection()
Packit Service 50c9f2
{
Packit Service 50c9f2
}