Skip to content

Modify the descritions of seq_file and flowchart #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lkmpg.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ \subsection{Manage /proc file with seq\_file}
The \cpp|seq_file| API starts a sequence when a user read the \verb|/proc| file.

A sequence begins with the call of the function \cpp|start()|.
If the return is a non \cpp|NULL| value, the function \cpp|next()| is called.
If the return is a non \cpp|NULL| value, the function \cpp|next()| is called; otherwise, otherwise, the \cpp|stop()| function is called directly.
This function is an iterator, the goal is to go through all the data.
Each time \cpp|next()| is called, the function \cpp|show()| is also called.
It writes data values in the buffer read by the user.
Expand All @@ -1251,13 +1251,12 @@ \subsection{Manage /proc file with seq\_file}
\begin{tikzpicture}[node distance=2cm, thick]
\node (start) [startstop] {start() treatment};
\node (branch1) [decision, below of=start, yshift=-1cm] {return is NULL?};
\node (emptynode) [right of=branch1, xshift=2cm] {Yes};
\node (next) [process, below of=branch1, yshift=-1cm] {next() treatment};
\node (branch2) [decision, below of=next, yshift=-1cm] {return is NULL?};
\node (stop) [startstop, below of=branch2, yshift=-1cm] {stop() treatment};

\draw [->] (start) -- (branch1);
\draw [->] (branch1) -- node[anchor=east] {} (emptynode);
\draw [->] (branch1.east) to [out=135, in=-135, bend left=45] node [right] {Yes} (stop.east);
\draw [->] (branch1) -- node[left=2em, anchor=south] {No} (next);
\draw [->] (next) -- (branch2);
\draw [->] (branch2.west) to [out=135, in=-135, bend left=45] node [left] {No} (next.west);
Expand Down