-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
abyfall
committed
Dec 8, 2017
1 parent
bc6fa37
commit c61ea94
Showing
108 changed files
with
8,398 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
doc/html/_2home_2abyfall_2Projet_2AlloHouston_2serveur_2sources_2train_8c-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> | ||
<meta http-equiv="X-UA-Compatible" content="IE=9"/> | ||
<meta name="generator" content="Doxygen 1.8.13"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<title>Allo Houston: /home/abyfall/Projet/AlloHouston/serveur/sources/train.c</title> | ||
<link href="tabs.css" rel="stylesheet" type="text/css"/> | ||
<script type="text/javascript" src="jquery.js"></script> | ||
<script type="text/javascript" src="dynsections.js"></script> | ||
<link href="search/search.css" rel="stylesheet" type="text/css"/> | ||
<script type="text/javascript" src="search/searchdata.js"></script> | ||
<script type="text/javascript" src="search/search.js"></script> | ||
<link href="doxygen.css" rel="stylesheet" type="text/css" /> | ||
</head> | ||
<body> | ||
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> | ||
<div id="titlearea"> | ||
<table cellspacing="0" cellpadding="0"> | ||
<tbody> | ||
<tr style="height: 56px;"> | ||
<td id="projectalign" style="padding-left: 0.5em;"> | ||
<div id="projectname">Allo Houston | ||
</div> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<!-- end header part --> | ||
<!-- Generated by Doxygen 1.8.13 --> | ||
<script type="text/javascript"> | ||
var searchBox = new SearchBox("searchBox", "search",false,'Search'); | ||
</script> | ||
<script type="text/javascript" src="menudata.js"></script> | ||
<script type="text/javascript" src="menu.js"></script> | ||
<script type="text/javascript"> | ||
$(function() { | ||
initMenu('',true,false,'search.php','Search'); | ||
$(document).ready(function() { init_search(); }); | ||
}); | ||
</script> | ||
<div id="main-nav"></div> | ||
</div><!-- top --> | ||
<!-- window showing the filter options --> | ||
<div id="MSearchSelectWindow" | ||
onmouseover="return searchBox.OnSearchSelectShow()" | ||
onmouseout="return searchBox.OnSearchSelectHide()" | ||
onkeydown="return searchBox.OnSearchSelectKey(event)"> | ||
</div> | ||
|
||
<!-- iframe showing the search results (closed by default) --> | ||
<div id="MSearchResultsWindow"> | ||
<iframe src="javascript:void(0)" frameborder="0" | ||
name="MSearchResults" id="MSearchResults"> | ||
</iframe> | ||
</div> | ||
|
||
<div class="header"> | ||
<div class="headertitle"> | ||
<div class="title">/home/abyfall/Projet/AlloHouston/serveur/sources/train.c</div> </div> | ||
</div><!--header--> | ||
<div class="contents"> | ||
<p>char *nomFichier = "../ressources/Trains.txt"; Train **listeTrain; int nbTrain; listeTrain = trainFromFile(nomFichier, &nbTrain); // Récupération de la liste de train</p> | ||
<div class="fragment"><div class="line"><span class="preprocessor">#include "../headers/temps.h"</span></div><div class="line"><span class="preprocessor">#include "../headers/train.h"</span></div><div class="line"><span class="preprocessor">#include "../headers/outils.h"</span></div><div class="line"><span class="preprocessor">#include <stdio.h></span></div><div class="line"><span class="preprocessor">#include <string.h></span></div><div class="line"><span class="preprocessor">#include <stdlib.h></span></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> printTrain(Train* train)</div><div class="line">{</div><div class="line"> printf(<span class="stringliteral">"%d : %s -> %s Départ %d:%d arrivée %d:%d Prix : %f Reduc : %d"</span>, train->id, train->villeDepart, train->villeArrivee, train->heureDepart->heure, train->heureDepart->minute, train->heureArrivee->heure, train->heureArrivee->minute, train->prix, train->reduc);</div><div class="line">}</div><div class="line"></div><div class="line">Train* <a name="a0"></a><a class="code" href="train_8c.html#aed8aaf00ced6d9a3121352a88c2f8c23">trainFromCSV</a>(<span class="keywordtype">char</span>* csv)</div><div class="line">{</div><div class="line"> <span class="keyword">struct </span>Train* train = malloc(<span class="keyword">sizeof</span>(Train));</div><div class="line"> <span class="keywordtype">char</span> *token, *str, *tofree;</div><div class="line"> tofree = str = strdup(csv); <span class="comment">// We own str's memory now.</span></div><div class="line"> <span class="comment">// id</span></div><div class="line"> token = strsep(&str, <span class="stringliteral">";"</span>);</div><div class="line"> train->id = atoi(token);</div><div class="line"></div><div class="line"> <span class="comment">// villeDepart</span></div><div class="line"> token = strsep(&str, <span class="stringliteral">";"</span>);</div><div class="line"> <a name="a1"></a><a class="code" href="outils_8c.html#a687ea0d581d240391192e821e70ab607">strToUpper</a>(token); <span class="comment">// On met le nom de ville en majuscule</span></div><div class="line"> train->villeDepart = strdup(token);</div><div class="line"></div><div class="line"> <span class="comment">// villeArrivee</span></div><div class="line"> token = strsep(&str, <span class="stringliteral">";"</span>);</div><div class="line"> <a class="code" href="outils_8c.html#a687ea0d581d240391192e821e70ab607">strToUpper</a>(token); <span class="comment">// On met le nom de ville en majuscule</span></div><div class="line"> train->villeArrivee = strdup(token);</div><div class="line"></div><div class="line"> <span class="comment">// heureDepart</span></div><div class="line"> token = strsep(&str, <span class="stringliteral">";"</span>);</div><div class="line"> <span class="keyword">struct </span>Temps* heureDepart = malloc(<span class="keyword">sizeof</span>(Temps));</div><div class="line"> heureDepart = <a name="a2"></a><a class="code" href="temps_8c.html#a81e0f2549d4dd4dcb072ae1086bb65dc">tempsFromCSV</a>(token);</div><div class="line"> train->heureDepart = heureDepart;</div><div class="line"></div><div class="line"> <span class="comment">// heureArrivee</span></div><div class="line"> token = strsep(&str, <span class="stringliteral">";"</span>);</div><div class="line"> <span class="keyword">struct </span>Temps* heureArrivee = malloc(<span class="keyword">sizeof</span>(Temps));</div><div class="line"> heureArrivee = <a class="code" href="temps_8c.html#a81e0f2549d4dd4dcb072ae1086bb65dc">tempsFromCSV</a>(token);</div><div class="line"> train->heureArrivee = heureArrivee;</div><div class="line"></div><div class="line"> <span class="comment">// prix</span></div><div class="line"> token = strsep(&str, <span class="stringliteral">";"</span>);</div><div class="line"> train->prix = atof(token);</div><div class="line"></div><div class="line"> <span class="comment">// reduc</span></div><div class="line"> token = strsep(&str, <span class="stringliteral">";"</span>);</div><div class="line"> <span class="keywordflow">if</span> (token != NULL)</div><div class="line"> {</div><div class="line"> <a class="code" href="outils_8c.html#a687ea0d581d240391192e821e70ab607">strToUpper</a>(token); <span class="comment">// On met la reduc ou supp en majuscule</span></div><div class="line"> <span class="keywordtype">int</span> len = strlen(token);</div><div class="line"> token[len-1] = <span class="charliteral">'\0'</span>;</div><div class="line"> <span class="keywordflow">if</span> (strcmp(token, <span class="stringliteral">"REDUC"</span>) == 0)</div><div class="line"> {</div><div class="line"> train->reduc = 1;</div><div class="line"> }</div><div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(token, <span class="stringliteral">"SUPPL"</span>) == 0)</div><div class="line"> {</div><div class="line"> train->reduc = -1;</div><div class="line"> }</div><div class="line"> <span class="keywordflow">else</span></div><div class="line"> {</div><div class="line"> train->reduc = 0;</div><div class="line"> }</div><div class="line"> }</div><div class="line"> free(tofree); <span class="comment">// We free the str we made</span></div><div class="line"> <span class="keywordflow">return</span> train;</div><div class="line">}</div><div class="line"></div><div class="line"></div><div class="line">Train * <a name="a3"></a><a class="code" href="train_8c.html#ab3d507e8de3d02f93aa66801142d4840">trainFromFile</a>(<span class="keywordtype">char</span>* nomFichier, <span class="keywordtype">int</span>* nbTrain){</div><div class="line"> Train * listeToutTrain;</div><div class="line"> FILE *fichier = fopen ( nomFichier, <span class="stringliteral">"r"</span> );</div><div class="line"> <span class="keywordtype">int</span> compteLigne = 0;</div><div class="line"> <span class="keywordflow">if</span> (fichier != NULL)</div><div class="line"> {</div><div class="line"> <span class="keywordtype">char</span> ligne [ 256 ];</div><div class="line"> <span class="keywordtype">int</span> lineCount = 0;</div><div class="line"> <span class="keywordflow">while</span> (fgets(ligne, <span class="keyword">sizeof</span> ligne, fichier) != NULL) <span class="comment">/* lit une ligne */</span></div><div class="line"> {</div><div class="line"> compteLigne ++;</div><div class="line"> }</div><div class="line"> printf(<span class="stringliteral">"%d ligne dans le fichier Trains.txt\n"</span>, compteLigne);</div><div class="line"> rewind(fichier);</div><div class="line"> listeToutTrain = malloc(compteLigne * <span class="keyword">sizeof</span>(Train));</div><div class="line"> <span class="keywordflow">while</span> (fgets ( ligne, <span class="keyword">sizeof</span> ligne, fichier ) != NULL) <span class="comment">/* lit une ligne */</span></div><div class="line"> {</div><div class="line"> *(listeToutTrain + lineCount) = *<a class="code" href="train_8c.html#aed8aaf00ced6d9a3121352a88c2f8c23">trainFromCSV</a>(ligne);</div><div class="line"> lineCount ++;</div><div class="line"> }</div><div class="line"> fclose (fichier);</div><div class="line"> }</div><div class="line"> <span class="keywordflow">else</span></div><div class="line"> {</div><div class="line"> perror ( nomFichier ); <span class="comment">/* Pourquoi le fichier ne s'est pas ouvert ? */</span></div><div class="line"> }</div><div class="line"> *nbTrain = compteLigne;</div><div class="line"> <span class="keywordflow">return</span> listeToutTrain;</div><div class="line">}</div></div><!-- fragment --> </div><!-- contents --> | ||
<!-- start footer part --> | ||
<hr class="footer"/><address class="footer"><small> | ||
Generated by  <a href="http://www.doxygen.org/index.html"> | ||
<img class="footer" src="doxygen.png" alt="doxygen"/> | ||
</a> 1.8.13 | ||
</small></address> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> | ||
<meta http-equiv="X-UA-Compatible" content="IE=9"/> | ||
<meta name="generator" content="Doxygen 1.8.13"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<title>Allo Houston: serveur Directory Reference</title> | ||
<link href="tabs.css" rel="stylesheet" type="text/css"/> | ||
<script type="text/javascript" src="jquery.js"></script> | ||
<script type="text/javascript" src="dynsections.js"></script> | ||
<link href="search/search.css" rel="stylesheet" type="text/css"/> | ||
<script type="text/javascript" src="search/searchdata.js"></script> | ||
<script type="text/javascript" src="search/search.js"></script> | ||
<link href="doxygen.css" rel="stylesheet" type="text/css" /> | ||
</head> | ||
<body> | ||
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> | ||
<div id="titlearea"> | ||
<table cellspacing="0" cellpadding="0"> | ||
<tbody> | ||
<tr style="height: 56px;"> | ||
<td id="projectalign" style="padding-left: 0.5em;"> | ||
<div id="projectname">Allo Houston | ||
</div> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<!-- end header part --> | ||
<!-- Generated by Doxygen 1.8.13 --> | ||
<script type="text/javascript"> | ||
var searchBox = new SearchBox("searchBox", "search",false,'Search'); | ||
</script> | ||
<script type="text/javascript" src="menudata.js"></script> | ||
<script type="text/javascript" src="menu.js"></script> | ||
<script type="text/javascript"> | ||
$(function() { | ||
initMenu('',true,false,'search.php','Search'); | ||
$(document).ready(function() { init_search(); }); | ||
}); | ||
</script> | ||
<div id="main-nav"></div> | ||
<!-- window showing the filter options --> | ||
<div id="MSearchSelectWindow" | ||
onmouseover="return searchBox.OnSearchSelectShow()" | ||
onmouseout="return searchBox.OnSearchSelectHide()" | ||
onkeydown="return searchBox.OnSearchSelectKey(event)"> | ||
</div> | ||
|
||
<!-- iframe showing the search results (closed by default) --> | ||
<div id="MSearchResultsWindow"> | ||
<iframe src="javascript:void(0)" frameborder="0" | ||
name="MSearchResults" id="MSearchResults"> | ||
</iframe> | ||
</div> | ||
|
||
<div id="nav-path" class="navpath"> | ||
<ul> | ||
<li class="navelem"><a class="el" href="dir_17197e2a5901f70601536f515e8d47d9.html">serveur</a></li> </ul> | ||
</div> | ||
</div><!-- top --> | ||
<div class="header"> | ||
<div class="headertitle"> | ||
<div class="title">serveur Directory Reference</div> </div> | ||
</div><!--header--> | ||
<div class="contents"> | ||
<table class="memberdecls"> | ||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a> | ||
Directories</h2></td></tr> | ||
</table> | ||
</div><!-- contents --> | ||
<!-- start footer part --> | ||
<hr class="footer"/><address class="footer"><small> | ||
Generated by  <a href="http://www.doxygen.org/index.html"> | ||
<img class="footer" src="doxygen.png" alt="doxygen"/> | ||
</a> 1.8.13 | ||
</small></address> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> | ||
<meta http-equiv="X-UA-Compatible" content="IE=9"/> | ||
<meta name="generator" content="Doxygen 1.8.13"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<title>Allo Houston: serveur/sources Directory Reference</title> | ||
<link href="tabs.css" rel="stylesheet" type="text/css"/> | ||
<script type="text/javascript" src="jquery.js"></script> | ||
<script type="text/javascript" src="dynsections.js"></script> | ||
<link href="search/search.css" rel="stylesheet" type="text/css"/> | ||
<script type="text/javascript" src="search/searchdata.js"></script> | ||
<script type="text/javascript" src="search/search.js"></script> | ||
<link href="doxygen.css" rel="stylesheet" type="text/css" /> | ||
</head> | ||
<body> | ||
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> | ||
<div id="titlearea"> | ||
<table cellspacing="0" cellpadding="0"> | ||
<tbody> | ||
<tr style="height: 56px;"> | ||
<td id="projectalign" style="padding-left: 0.5em;"> | ||
<div id="projectname">Allo Houston | ||
</div> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<!-- end header part --> | ||
<!-- Generated by Doxygen 1.8.13 --> | ||
<script type="text/javascript"> | ||
var searchBox = new SearchBox("searchBox", "search",false,'Search'); | ||
</script> | ||
<script type="text/javascript" src="menudata.js"></script> | ||
<script type="text/javascript" src="menu.js"></script> | ||
<script type="text/javascript"> | ||
$(function() { | ||
initMenu('',true,false,'search.php','Search'); | ||
$(document).ready(function() { init_search(); }); | ||
}); | ||
</script> | ||
<div id="main-nav"></div> | ||
<!-- window showing the filter options --> | ||
<div id="MSearchSelectWindow" | ||
onmouseover="return searchBox.OnSearchSelectShow()" | ||
onmouseout="return searchBox.OnSearchSelectHide()" | ||
onkeydown="return searchBox.OnSearchSelectKey(event)"> | ||
</div> | ||
|
||
<!-- iframe showing the search results (closed by default) --> | ||
<div id="MSearchResultsWindow"> | ||
<iframe src="javascript:void(0)" frameborder="0" | ||
name="MSearchResults" id="MSearchResults"> | ||
</iframe> | ||
</div> | ||
|
||
<div id="nav-path" class="navpath"> | ||
<ul> | ||
<li class="navelem"><a class="el" href="dir_17197e2a5901f70601536f515e8d47d9.html">serveur</a></li><li class="navelem"><a class="el" href="dir_60c804fded23a45d56f6ac5c71f22e2d.html">sources</a></li> </ul> | ||
</div> | ||
</div><!-- top --> | ||
<div class="header"> | ||
<div class="headertitle"> | ||
<div class="title">sources Directory Reference</div> </div> | ||
</div><!--header--> | ||
<div class="contents"> | ||
<table class="memberdecls"> | ||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a> | ||
Files</h2></td></tr> | ||
<tr class="memitem:outils_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="outils_8c.html">outils.c</a></td></tr> | ||
<tr class="memdesc:outils_8c"><td class="mdescLeft"> </td><td class="mdescRight">Fichier contenant les méthodes utiles à toutes les parties du programme et non spécifique à une structure. <br /></td></tr> | ||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> | ||
<tr class="memitem:requetes_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="requetes_8c.html">requetes.c</a></td></tr> | ||
<tr class="memdesc:requetes_8c"><td class="mdescLeft"> </td><td class="mdescRight">Traitement des différentes requetes possibles. <br /></td></tr> | ||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> | ||
<tr class="memitem:service_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="service_8c.html">service.c</a></td></tr> | ||
<tr class="memdesc:service_8c"><td class="mdescLeft"> </td><td class="mdescRight">Fichier permettant la création d'un nouveau service. <br /></td></tr> | ||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> | ||
<tr class="memitem:temps_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="temps_8c.html">temps.c</a></td></tr> | ||
<tr class="memdesc:temps_8c"><td class="mdescLeft"> </td><td class="mdescRight">Fichier contenant les méthodes pour la structure temps. <br /></td></tr> | ||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> | ||
<tr class="memitem:train_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="train_8c.html">train.c</a></td></tr> | ||
<tr class="memdesc:train_8c"><td class="mdescLeft"> </td><td class="mdescRight">Fichier contenant les méthodes pour la structure Train. <br /></td></tr> | ||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> | ||
</table> | ||
</div><!-- contents --> | ||
<!-- start footer part --> | ||
<hr class="footer"/><address class="footer"><small> | ||
Generated by  <a href="http://www.doxygen.org/index.html"> | ||
<img class="footer" src="doxygen.png" alt="doxygen"/> | ||
</a> 1.8.13 | ||
</small></address> | ||
</body> | ||
</html> |
Oops, something went wrong.