[Tex/LaTex] How to draw these (closed contours) diagrams using TikZ or PSTricks

pstrickstikz-pgf

First, I must say I have no knowledge about PGF/TikZ nor PSTricks, but I would like to draw the following or similar closed contours using one of them or another adequate package. Where can I find the TikZ and the PSTricks manuals?
I would appreciate if you could indicate the code to draw one of the diagrams.

ADDED: I've found this TikZ Manual for Version 2.10. It coincides with the package version installed on my computer, as I checked after the help of Benedikt Bauer's comments.

Diagram A

enter image description here

Diagram B

enter image description here

Best Answer

The first one:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}

\begin{tikzpicture}[decoration={markings,
mark=at position 0.5cm with {\arrow[line width=1pt]{>}},
mark=at position 2cm with {\arrow[line width=1pt]{>}},
mark=at position 7.85cm with {\arrow[line width=1pt]{>}},
mark=at position 9cm with {\arrow[line width=1pt]{>}}
}
]
% The axes
\draw[help lines,->] (-3,0) -- (3,0) coordinate (xaxis);
\draw[help lines,->] (0,-1) -- (0,3) coordinate (yaxis);

% The path
\path[draw,line width=0.8pt,postaction=decorate] (1,0) node[below] {$\varepsilon$} -- (2,0) node[below] {$r$} arc (0:180:2) -- (-1,0) arc (180:0:1);

% The labels
\node[below] at (xaxis) {$x$};
\node[left] at (yaxis) {$y$};
\node[below left] {$O$};
\node at (0.5,1.2) {$C_{\varepsilon}$};
\node at (1.5,1.8) {$C_{r}$};
\end{tikzpicture}

\end{document}

enter image description here

The second one:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}

\begin{tikzpicture}
[decoration={markings,
mark=at position 0.75cm with {\arrow[line width=1pt]{>}},
mark=at position 2cm with {\arrow[line width=1pt]{>}},
mark=at position 14cm with {\arrow[line width=1pt]{>}},
mark=at position 15cm with {\arrow[line width=1pt]{>}}
}
]
% The axes
\draw[help lines,->] (-3,0) -- (3,0) coordinate (xaxis);
\draw[help lines,->] (0,-3) -- (0,3) coordinate (yaxis);

% The path
\path[draw,line width=0.8pt,postaction=decorate] (10:1) node[left] {$\varepsilon$} -- +(1,0) node[right] {$r$} arc (5:355:2) -- +(-1,0) arc (-10:-350:1);

% The labels
\node[below] at (xaxis) {$x$};
\node[left] at (yaxis) {$y$};
\node[below left] {$O$};
\node at (-0.9,1) {$\gamma_{\varepsilon}$};
\node at (1.4,1.9) {$\gamma_{r}$};
\end{tikzpicture}

\end{document}

enter image description here