%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\catcode`\@=11
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{\catcode`\<=1\catcode`\>=2
%	<\catcode`\{=12\gdef\OBraceTw<{>>
%	<\catcode`\}=12\gdef\CBraceTw<}>>
%>
%\@ifundefined{specHasManual}{\let\specHasManual\relax}{}
\let\specHasManual\relax
\let\specCsgManual\relax

\def\setMacroInAuxFile#1{%
    \global\expandafter\edef\csname#1\endcsname{\name}
    \expandafter\immediate\expandafter\write\@auxout\expandafter{\expandafter\string\expandafter\gdef\expandafter\string\csname #1\endcsname{\name}}
}
\def\eoa{end-of-args}
\def\@novers#1-#2\eoa{#1}
\def\novers#1{\expandafter\@novers#1\eoa}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\let\ganttlf\relax
\newwrite\ganttdata
\immediate\openout\ganttdata=anr.gantt

\def\enable{enable}
\def\disable{disable}
\def\leader{leader}
\newenvironment{taskinfo}%
{%
\let\ALL\disable%
\let\IRISA\disable%
\let\CITI\disable%
\let\LIP\disable%
\let\TIMA\disable%
\let\UBS\disable%
\let\UPMC\disable%
\let\ALTERA\disable%
\let\XILINX\disable%
\let\BULL\disable%
\let\THALES\disable%
\let\ZIED\disable%
}{%
\ifx\ALL\enable%
  \ifx\IRISA\disable\let\IRISA\enable\fi%
  \ifx\CITI\disable\let\CITI\enable\fi%
  \ifx\LIP\disable\let\LIP\enable\fi%
  \ifx\UPMC\disable\let\UPMC\enable\fi%
  \ifx\TIMA\disable\let\TIMA\enable\fi%
  \ifx\UBS\disable\let\UBS\enable\fi%
  \ifx\ALTERA\disable\let\ALTERA\enable\fi%
  \ifx\XILINX\disable\let\XILINX\enable\fi%
  \ifx\BULL\disable\let\BULL\enable\fi%
  \ifx\THALES\disable\let\THALES\enable\fi%
  \ifx\ZIED\disable\let\ZIED\enable\fi%
\fi%
\def\@leader{\begin{small}\textcolor{red}{lead.}\end{small}}
\def\@partner{\begin{small}\textcolor{blue}{part.}\end{small}}
\def\@IRISA{\ifx\IRISA\disable{}\else\ifx\IRISA\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@CITI{\ifx\CITI\disable{}\else\ifx\CITI\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@LIP{\ifx\LIP\disable{}\else\ifx\LIP\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@UPMC{\ifx\UPMC\disable{}\else\ifx\UPMC\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@TIMA{\ifx\TIMA\disable{}\else\ifx\TIMA\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@UBS{\ifx\UBS\disable{}\else\ifx\UBS\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@ALTERA{\ifx\ALTERA\disable{}\else\ifx\ALTERA\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@XILINX{\ifx\XILINX\disable{}\else\ifx\ALTERA\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@BULL{\ifx\BULL\disable{}\else\ifx\BULL\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@THALES{\ifx\THALES\disable{}\else\ifx\THALES\enable{\@partner}\else{\@leader}\fi\fi}%
\def\@ZIED{\ifx\ZIED\disable{}\else\ifx\ZIED\enable{\@partner}\else{\@leader}\fi\fi}%
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}\hline
\Sirisa  & \Sciti  & \Slip  & \Stima  & \Subs  & \Supmc  & \Saltera & \Sxilinx & \Sbull  & \Sthales & \Szied \\\hline
\@IRISA  & \@CITI  & \@LIP  & \@TIMA  & \@UBS  & \@UPMC  & \@ALTERA & \@XILINX & \@BULL  & \@THALES & \@ZIED \\\hline
\end{tabular}\par
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{objectif}%
{\begin{description}\item[Objectives]}
{\end{description}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcount\taskcnt\taskcnt=-1
\newcount\subtaskcnt
\newcount\livrablecnt
\newenvironment{workpackage}[1]%
{\global\advance\taskcnt1
 \global\subtaskcnt0
 \def\taskname{T\the\taskcnt}%
 \begin{description}%
 \let\itemsave\item%
 \def\item{%
    \global\advance\subtaskcnt1
    \def\subtaskname{S\taskname-\the\subtaskcnt}%
    \itemsave[\subtaskname]}}
{\end{description}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{livrable}%
{%
 \livrablecnt-1
 \ifvmode\else\\\fi
 \def\item##1##2##3##4##5##6{%
	\def\tmpa{##1}\def\vers{}
	\def\tmp{}  \ifx\tmp\tmpa\global\advance\livrablecnt1\def\vers{VF}\fi%
    \def\tmp{1} \ifx\tmp\tmpa\global\advance\livrablecnt1\def\vers{V1}\fi%
    \def\tmp{V1}\ifx\tmp\tmpa\global\advance\livrablecnt1\def\vers{V1}\fi%
    \def\tmp{2} \ifx\tmp\tmpa\def\vers{V2}\fi%
    \def\tmp{V2}\ifx\tmp\tmpa\def\vers{V2}\fi%
    \def\tmp{3} \ifx\tmp\tmpa\def\vers{V3}\fi%
    \def\tmp{V3}\ifx\tmp\tmpa\def\vers{V3}\fi%
    \def\tmp{F} \ifx\tmp\tmpa\def\vers{VF}\fi%
    \def\tmp{VF}\ifx\tmp\tmpa\def\vers{VF}\fi%
    %\gdef\name{D-\the\taskcnt\the\subtaskcnt\the\livrablecnt-##1}%
    \global\edef\name{D\the\taskcnt\the\subtaskcnt\the\livrablecnt-\vers}%
    {
      \let\xcoach\relax
      \let\xcoachplus\relax
      \let\xilinx\relax
      \let\altera\relax
      \immediate\write\ganttdata{%
        T=\the\taskcnt\space S=\the\subtaskcnt\space%
        D=\the\livrablecnt\space V=##1 BM=##2 EM=##3 TITLE=##6%
      }
    }
    \\\hline
    \begin{small}\textsc{\name}\end{small} &
    \begin{small}\textsc{T0+##3}\end{small} &
    \begin{small}\textsc{##4}\end{small} &
    \begin{small}\textsc{##5}\end{small} &
 }
% \begin{small}
 \begin{tabular}{|c|c|c|c|p{.55\linewidth}|}\hline%
 \makebox[5em]{number} & \makebox[3em]{date} & type & resp. & description 
}
{\\\hline\end{tabular}%
%\end{small}\\%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\catcode`\@=12
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
