Line 11: | Line 11: | ||
== Implementation == | == Implementation == | ||
+ | The following sections present possible implementations. | ||
+ | |||
+ | All shell commands are prefixed with <tt>prompt%</tt> (their output is presented for explanation purposes only and is not required to answer the problem). | ||
+ | |||
+ | It is assumed that the <tt>CVSROOT</tt> variable has been defined: | ||
+ | <bash> | ||
+ | export CVSROOT=/cvs | ||
+ | </bash> | ||
+ | |||
+ | === Step 1: Building the Project === | ||
+ | |||
+ | Assuming that all files are in directory <tt>/some/temporary/directory</tt>, the following commands may be used to create the '''factorial''' project (). | ||
+ | |||
+ | prompt% cd /some/temporary/directory | ||
+ | prompt% cvs import factorial david initial | ||
+ | N factorial/recurs.cpp | ||
+ | N factorial/recurs.h | ||
+ | N factorial/iter.cpp | ||
+ | N factorial/iter.h | ||
+ | N factorial/main.cpp | ||
+ | |||
+ | Then, after import is complete, we can check-out a fresh copy of the project and change to that directory: | ||
− | + | prompt% cvs co factorial | |
+ | U factorial/iter.cpp | ||
+ | U factorial/iter.h | ||
+ | U factorial/main.cpp | ||
+ | U factorial/recurs.cpp | ||
+ | U factorial/recurs.h | ||
+ | prompt% cd factorial |
Considere quatro ficheiros recurs.cpp (contendo a função factrecurs), recurs.h (contendo a declaração da função factrecurs), iter.cpp (contendo a função factiter ), iter.h (contendo a declaração da função factiter) e main.cpp (contendo a função main que invoca sequencialmente ambas as funções anteriores e que inclui recurs.h e iter.h).
The following sections present possible implementations.
All shell commands are prefixed with prompt% (their output is presented for explanation purposes only and is not required to answer the problem).
It is assumed that the CVSROOT variable has been defined: <bash>
export CVSROOT=/cvs
</bash>
Assuming that all files are in directory /some/temporary/directory, the following commands may be used to create the factorial project ().
prompt% cd /some/temporary/directory prompt% cvs import factorial david initial N factorial/recurs.cpp N factorial/recurs.h N factorial/iter.cpp N factorial/iter.h N factorial/main.cpp
Then, after import is complete, we can check-out a fresh copy of the project and change to that directory:
prompt% cvs co factorial U factorial/iter.cpp U factorial/iter.h U factorial/main.cpp U factorial/recurs.cpp U factorial/recurs.h prompt% cd factorial