\doxysection{io.\+c}
\hypertarget{io_8c_source}{}\label{io_8c_source}\index{workspace/post-\/scarcity/src/io/io.c@{workspace/post-\/scarcity/src/io/io.c}}
\mbox{\hyperlink{io_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00001}00001\ \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00002}00002\ \textcolor{comment}{\ *\ io.c}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00003}00003\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00004}00004\ \textcolor{comment}{\ *\ Communication\ between\ PSSE\ and\ the\ outside\ world,\ via\ libcurl.\ NOTE}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00005}00005\ \textcolor{comment}{\ *\ that\ this\ file\ destructively\ changes\ metadata\ on\ URL\ connections,}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00006}00006\ \textcolor{comment}{\ *\ because\ the\ metadata\ is\ not\ available\ until\ the\ stream\ has\ been\ read}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00007}00007\ \textcolor{comment}{\ *\ from.\ It\ would\ be\ better\ to\ find\ a\ workaround!}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00008}00008\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00009}00009\ \textcolor{comment}{\ *\ (c)\ 2019\ Simon\ Brooke\ <simon@journeyman.cc>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00010}00010\ \textcolor{comment}{\ *\ Licensed\ under\ GPL\ version\ 2.0,\ or,\ at\ your\ option,\ any\ later\ version.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00011}00011\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00012}00012\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00013}00013\ \textcolor{preprocessor}{\#include\ <grp.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00014}00014\ \textcolor{preprocessor}{\#include\ <langinfo.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00015}00015\ \textcolor{preprocessor}{\#include\ <pwd.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00016}00016\ \textcolor{preprocessor}{\#include\ <stdlib.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00017}00017\ \textcolor{preprocessor}{\#include\ <string.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00018}00018\ \textcolor{preprocessor}{\#include\ <time.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00019}00019\ \textcolor{preprocessor}{\#include\ <sys/stat.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00020}00020\ \textcolor{preprocessor}{\#include\ <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00021}00021\ \textcolor{preprocessor}{\#include\ <unistd.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00022}00022\ \textcolor{preprocessor}{\#include\ <uuid/uuid.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00023}00023\ \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00024}00024\ \textcolor{comment}{\ *\ wide\ characters}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00025}00025\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00026}00026\ \textcolor{preprocessor}{\#include\ <wchar.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00027}00027\ \textcolor{preprocessor}{\#include\ <wctype.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00028}00028\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00029}00029\ \textcolor{preprocessor}{\#include\ <curl/curl.h>}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00030}00030\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00031}00031\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{integer_8h}{arith/integer.h}}"{}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00032}00032\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{debug_8h}{debug.h}}"{}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00033}00033\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{fopen_8h}{io/fopen.h}}"{}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00034}00034\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{io_8h}{io/io.h}}"{}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00035}00035\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{conspage_8h}{memory/conspage.h}}"{}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00036}00036\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{consspaceobject_8h}{memory/consspaceobject.h}}"{}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00037}00037\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{intern_8h}{ops/intern.h}}"{}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00038}00038\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{lispops_8h}{ops/lispops.h}}"{}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00039}00039\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{utils_8h}{utils.h}}"{}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00040}00040\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00041}00041\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00042}00042\ \textcolor{comment}{\ *\ The\ sharing\ hub\ for\ all\ connections.\ TODO:\ Ultimately\ this\ probably\ doesn't}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00043}00043\ \textcolor{comment}{\ *\ work\ for\ a\ multi-\/user\ environment\ and\ we\ will\ need\ one\ sharing\ hub\ for\ each}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00044}00044\ \textcolor{comment}{\ *\ user,\ or\ else\ we\ will\ need\ to\ not\ share\ at\ least\ cookies\ and\ ssl\ sessions.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00045}00045\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00046}\mbox{\hyperlink{io_8c_ac40101a2ddb1b4aac9f2f722c84d16dd}{00046}}\ CURLSH\ *\mbox{\hyperlink{io_8c_ac40101a2ddb1b4aac9f2f722c84d16dd}{io\_share}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00047}00047\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00048}00048\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00049}00049\ \textcolor{comment}{\ *\ @brief\ bound\ to\ the\ Lisp\ string\ representing\ C\_IO\_IN\ in\ initialisation.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00050}00050\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00051}\mbox{\hyperlink{io_8c_a21ef246a2e9023dab932aef9cf51ffcd}{00051}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{io_8c_a21ef246a2e9023dab932aef9cf51ffcd}{lisp\_io\_in}}\ =\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}};\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00052}00052\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00053}00053\ \textcolor{comment}{\ *\ @brief\ bound\ to\ the\ Lisp\ string\ representing\ C\_IO\_OUT\ in\ initialisation.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00054}00054\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00055}\mbox{\hyperlink{io_8c_a4ab3e001c63210ab136b954086f9bed0}{00055}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{io_8c_a4ab3e001c63210ab136b954086f9bed0}{lisp\_io\_out}}\ =\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00056}00056\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00057}00057\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00058}00058\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00059}00059\ \textcolor{comment}{\ *\ Allow\ a\ one-\/character\ unget\ facility.\ This\ may\ not\ be\ enough\ -\/\ we\ may\ need}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00060}00060\ \textcolor{comment}{\ *\ to\ allocate\ a\ buffer.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00061}00061\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00062}\mbox{\hyperlink{io_8c_adc2e532fc0f0c5602984efa7f22c9e8c}{00062}}\ wint\_t\ \mbox{\hyperlink{io_8c_adc2e532fc0f0c5602984efa7f22c9e8c}{ungotten}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00063}00063\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00064}00064\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00065}00065\ \textcolor{comment}{\ *\ Initialise\ the\ I/O\ subsystem.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00066}00066\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00067}00067\ \textcolor{comment}{\ *\ @return\ 0\ on\ success;\ any\ other\ value\ means\ failure.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00068}00068\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00069}\mbox{\hyperlink{io_8c_a12ce98b64f2019ac45b44826a4db7ec9}{00069}}\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{io_8c_a12ce98b64f2019ac45b44826a4db7ec9}{io\_init}}(\ \ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00070}00070\ \ \ \ \ \textcolor{keywordtype}{int}\ result\ =\ curl\_global\_init(\ CURL\_GLOBAL\_SSL\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00071}00071\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00072}00072\ \ \ \ \ \mbox{\hyperlink{io_8c_ac40101a2ddb1b4aac9f2f722c84d16dd}{io\_share}}\ =\ curl\_share\_init(\ \ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00073}00073\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00074}00074\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ result\ ==\ 0\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00075}00075\ \ \ \ \ \ \ \ \ curl\_share\_setopt(\ \mbox{\hyperlink{io_8c_ac40101a2ddb1b4aac9f2f722c84d16dd}{io\_share}},\ CURLSHOPT\_SHARE,\ CURL\_LOCK\_DATA\_CONNECT\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00076}00076\ \ \ \ \ \ \ \ \ curl\_share\_setopt(\ \mbox{\hyperlink{io_8c_ac40101a2ddb1b4aac9f2f722c84d16dd}{io\_share}},\ CURLSHOPT\_SHARE,\ CURL\_LOCK\_DATA\_COOKIE\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00077}00077\ \ \ \ \ \ \ \ \ curl\_share\_setopt(\ \mbox{\hyperlink{io_8c_ac40101a2ddb1b4aac9f2f722c84d16dd}{io\_share}},\ CURLSHOPT\_SHARE,\ CURL\_LOCK\_DATA\_DNS\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00078}00078\ \ \ \ \ \ \ \ \ curl\_share\_setopt(\ \mbox{\hyperlink{io_8c_ac40101a2ddb1b4aac9f2f722c84d16dd}{io\_share}},\ CURLSHOPT\_SHARE,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00079}00079\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ CURL\_LOCK\_DATA\_SSL\_SESSION\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00080}00080\ \ \ \ \ \ \ \ \ curl\_share\_setopt(\ \mbox{\hyperlink{io_8c_ac40101a2ddb1b4aac9f2f722c84d16dd}{io\_share}},\ CURLSHOPT\_SHARE,\ CURL\_LOCK\_DATA\_PSL\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00081}00081\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00082}00082\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00083}00083\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00084}00084\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00085}00085\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00086}00086\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00087}00087\ \textcolor{comment}{\ *\ Convert\ this\ lisp\ string-\/like-\/thing\ (also\ works\ for\ symbols,\ and,\ later}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00088}00088\ \textcolor{comment}{\ *\ keywords)\ into\ a\ UTF-\/8\ string.\ NOTE\ that\ the\ returned\ value\ has\ been}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00089}00089\ \textcolor{comment}{\ *\ malloced\ and\ must\ be\ freed.\ TODO:\ candidate\ to\ moving\ into\ a\ utilities}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00090}00090\ \textcolor{comment}{\ *\ file.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00091}00091\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00092}00092\ \textcolor{comment}{\ *\ @param\ s\ the\ lisp\ string\ or\ symbol;}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00093}00093\ \textcolor{comment}{\ *\ @return\ the\ c\ string.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00094}00094\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00095}\mbox{\hyperlink{io_8c_a7af48ce42d938915fd8e59aad5f566ee}{00095}}\ \textcolor{keywordtype}{char}\ *\mbox{\hyperlink{io_8c_a7af48ce42d938915fd8e59aad5f566ee}{lisp\_string\_to\_c\_string}}(\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ s\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00096}00096\ \ \ \ \ \textcolor{keywordtype}{char}\ *result\ =\ NULL;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00097}00097\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00098}00098\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_ab57f7feed314b0b9efa64d4cb3102759}{stringp}}(\ s\ )\ ||\ \mbox{\hyperlink{consspaceobject_8h_a868a73028c615e36d3ec378406b725b8}{symbolp}}(\ s\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00099}00099\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ len\ =\ 0;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00100}00100\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00101}00101\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ c\ =\ s;\ !\mbox{\hyperlink{consspaceobject_8h_a758a42bfac22caaf66e29c666c91702d}{nilp}}(\ c\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00102}00102\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ c\ =\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ c\ ).payload.string.cdr\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00103}00103\ \ \ \ \ \ \ \ \ \ \ \ \ len++;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00104}00104\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00105}00105\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00106}00106\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{wchar\_t}\ *buffer\ =\ calloc(\ len\ +\ 1,\ \textcolor{keyword}{sizeof}(\ \textcolor{keywordtype}{wchar\_t}\ )\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00107}00107\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ worst\ case,\ one\ wide\ char\ =\ four\ utf\ bytes\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00108}00108\ \ \ \ \ \ \ \ \ result\ =\ calloc(\ (\ len\ *\ 4\ )\ +\ 1,\ \textcolor{keyword}{sizeof}(\ \textcolor{keywordtype}{char}\ )\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00109}00109\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00110}00110\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ i\ =\ 0;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00111}00111\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ c\ =\ s;\ !\mbox{\hyperlink{consspaceobject_8h_a758a42bfac22caaf66e29c666c91702d}{nilp}}(\ c\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00112}00112\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ c\ =\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ c\ ).payload.string.cdr\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00113}00113\ \ \ \ \ \ \ \ \ \ \ \ \ buffer[i++]\ =\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ c\ ).payload.string.character;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00114}00114\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00115}00115\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00116}00116\ \ \ \ \ \ \ \ \ wcstombs(\ result,\ buffer,\ len\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00117}00117\ \ \ \ \ \ \ \ \ free(\ buffer\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00118}00118\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00119}00119\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00120}00120\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}lisp\_string\_to\_c\_string(\ "{}},\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00121}00121\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ s,\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00122}00122\ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}},\ L\textcolor{stringliteral}{"{})\ =>\ '\%s'\(\backslash\)n"{}},\ result\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00123}00123\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00124}00124\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00125}00125\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00126}00126\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00127}00127\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00128}00128\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00129}00129\ \textcolor{comment}{\ *\ given\ this\ file\ handle\ f,\ return\ a\ new\ url\_file\ handle\ wrapping\ it.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00130}00130\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00131}00131\ \textcolor{comment}{\ *\ @param\ f\ the\ file\ to\ be\ wrapped;}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00132}00132\ \textcolor{comment}{\ *\ @return\ the\ new\ handle,\ or\ null\ if\ no\ such\ handle\ could\ be\ allocated.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00133}00133\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00134}\mbox{\hyperlink{io_8c_a94886a863fdd18ea9e5559e4a70a5059}{00134}}\ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ *\mbox{\hyperlink{io_8c_a94886a863fdd18ea9e5559e4a70a5059}{file\_to\_url\_file}}(\ FILE\ *f\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00135}00135\ \ \ \ \ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ *result\ =\ (\ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ *\ )\ malloc(\ \textcolor{keyword}{sizeof}(\ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ )\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00136}00136\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00137}00137\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ result\ !=\ NULL\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00138}00138\ \ \ \ \ \ \ \ \ result-\/>\mbox{\hyperlink{fopen_8h_a3f626b0c4d351deff31d373b1987f5a7}{type}}\ =\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12a3cbcf3d97506c91623b1e0641c3671b4}{CFTYPE\_FILE}},\ result-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.file\ =\ f;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00139}00139\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00140}00140\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00141}00141\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00142}00142\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00143}00143\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00144}00144\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00145}00145\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00146}00146\ \textcolor{comment}{\ *\ get\ one\ wide\ character\ from\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00147}00147\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00148}00148\ \textcolor{comment}{\ *\ @param\ file\ the\ stream\ to\ read\ from;}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00149}00149\ \textcolor{comment}{\ *\ @return\ the\ next\ wide\ character\ on\ the\ stream,\ or\ zero\ if\ no\ more.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00150}00150\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00151}\mbox{\hyperlink{io_8c_a3be41e66bc649c81ff099e4be3e5b1a8}{00151}}\ wint\_t\ \mbox{\hyperlink{io_8c_a3be41e66bc649c81ff099e4be3e5b1a8}{url\_fgetwc}}(\ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ *input\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00152}00152\ \ \ \ \ wint\_t\ result\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00153}00153\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00154}00154\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{io_8c_adc2e532fc0f0c5602984efa7f22c9e8c}{ungotten}}\ !=\ 0\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00155}00155\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ TODO:\ not\ thread\ safe\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00156}00156\ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{io_8c_adc2e532fc0f0c5602984efa7f22c9e8c}{ungotten}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00157}00157\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{io_8c_adc2e532fc0f0c5602984efa7f22c9e8c}{ungotten}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00158}00158\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00159}00159\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{switch}\ (\ input-\/>\mbox{\hyperlink{fopen_8h_a3f626b0c4d351deff31d373b1987f5a7}{type}}\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00160}00160\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12a3cbcf3d97506c91623b1e0641c3671b4}{CFTYPE\_FILE}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00161}00161\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fwide(\ input-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.file,\ 1\ );\ \textcolor{comment}{/*\ wide\ characters\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00162}00162\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ fgetwc(\ input-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.file\ );\ \ \textcolor{comment}{/*\ passthrough\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00163}00163\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00164}00164\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00165}00165\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12a008570f612978c91c772a226badbee17}{CFTYPE\_CURL}}:\{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00166}00166\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ *cbuff\ =}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00167}00167\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ calloc(\ \textcolor{keyword}{sizeof}(\ \textcolor{keywordtype}{wchar\_t}\ )\ +\ 2,\ \textcolor{keyword}{sizeof}(\ \textcolor{keywordtype}{char}\ )\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00168}00168\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{wchar\_t}\ *wbuff\ =\ calloc(\ 2,\ \textcolor{keyword}{sizeof}(\ \textcolor{keywordtype}{wchar\_t}\ )\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00169}00169\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00170}00170\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ count\ =\ 0;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00171}00171\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00172}00172\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}url\_fgetwc:\ about\ to\ call\ url\_fgets\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00173}00173\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00174}00174\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{fopen_8c_a581c0437f39131b6368dd163843afff8}{url\_fgets}}(\ cbuff,\ 2,\ input\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00175}00175\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}url\_fgetwc:\ back\ from\ url\_fgets\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00176}00176\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00177}00177\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ c\ =\ (\ int\ )\ cbuff[0];}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00178}00178\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ TODO:\ risk\ of\ reading\ off\ cbuff?}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00179}00179\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00180}00180\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L\textcolor{stringliteral}{"{}url\_fgetwc:\ cbuff\ is\ '\%s';\ (first)\ character\ =\ \%d\ (\%c)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00181}00181\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cbuff,\ c,\ c\ \&\ 0xf7\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00182}00182\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ The\ value\ of\ each\ individual\ byte\ indicates\ its\ UTF-\/8\ function,\ as\ follows:}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00183}00183\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00184}00184\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *\ 00\ to\ 7F\ hex\ (0\ to\ 127):\ first\ and\ only\ byte\ of\ a\ sequence.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00185}00185\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *\ 80\ to\ BF\ hex\ (128\ to\ 191):\ continuing\ byte\ in\ a\ multi-\/byte\ sequence.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00186}00186\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *\ C2\ to\ DF\ hex\ (194\ to\ 223):\ first\ byte\ of\ a\ two-\/byte\ sequence.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00187}00187\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *\ E0\ to\ EF\ hex\ (224\ to\ 239):\ first\ byte\ of\ a\ three-\/byte\ sequence.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00188}00188\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *\ F0\ to\ FF\ hex\ (240\ to\ 255):\ first\ byte\ of\ a\ four-\/byte\ sequence.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00189}00189\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00190}00190\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ c\ <=\ 0xf7\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00191}00191\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ count\ =\ 1;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00192}00192\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (\ c\ >=\ 0xc2\ \&\&\ c\ <=\ 0xdf\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00193}00193\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ count\ =\ 2;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00194}00194\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (\ c\ >=\ 0xe0\ \&\&\ c\ <=\ 0xef\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00195}00195\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ count\ =\ 3;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00196}00196\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (\ c\ >=\ 0xf0\ \&\&\ c\ <=\ 0xff\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00197}00197\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ count\ =\ 4;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00198}00198\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00199}00199\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00200}00200\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ count\ >\ 1\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00201}00201\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{fopen_8c_a581c0437f39131b6368dd163843afff8}{url\_fgets}}(\ (\ \textcolor{keywordtype}{char}\ *\ )\ \&cbuff[1],\ count,\ input\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00202}00202\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00203}00203\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ mbstowcs(\ wbuff,\ cbuff,\ 2\ );\ \ \textcolor{comment}{//(char\ *)(\&input-\/>buffer[input-\/>buffer\_pos]),\ 1\ );}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00204}00204\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ wbuff[0];}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00205}00205\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00206}00206\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ free(\ wbuff\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00207}00207\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ free(\ cbuff\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00208}00208\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00209}00209\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00210}00210\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12abf2aa2baf8c5c768bee2228c2991c0a7}{CFTYPE\_NONE}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00211}00211\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00212}00212\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00213}00213\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00214}00214\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00215}00215\ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}},\ L\textcolor{stringliteral}{"{}url\_fgetwc\ returning\ \%d\ (\%C)\(\backslash\)n"{}},\ result,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00216}00216\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ result\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00217}00217\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00218}00218\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00219}00219\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00220}\mbox{\hyperlink{io_8c_a201e1590889d70033b6cae46f30ce6e0}{00220}}\ wint\_t\ \mbox{\hyperlink{io_8c_a201e1590889d70033b6cae46f30ce6e0}{url\_ungetwc}}(\ wint\_t\ wc,\ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ *input\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00221}00221\ \ \ \ \ wint\_t\ result\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00222}00222\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00223}00223\ \ \ \ \ \textcolor{keywordflow}{switch}\ (\ input-\/>\mbox{\hyperlink{fopen_8h_a3f626b0c4d351deff31d373b1987f5a7}{type}}\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00224}00224\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12a3cbcf3d97506c91623b1e0641c3671b4}{CFTYPE\_FILE}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00225}00225\ \ \ \ \ \ \ \ \ \ \ \ \ fwide(\ input-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.file,\ 1\ );\ \textcolor{comment}{/*\ wide\ characters\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00226}00226\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ ungetwc(\ wc,\ input-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.file\ );\ \textcolor{comment}{/*\ passthrough\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00227}00227\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00228}00228\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00229}00229\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12a008570f612978c91c772a226badbee17}{CFTYPE\_CURL}}:\{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00230}00230\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{io_8c_adc2e532fc0f0c5602984efa7f22c9e8c}{ungotten}}\ =\ wc;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00231}00231\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00232}00232\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12abf2aa2baf8c5c768bee2228c2991c0a7}{CFTYPE\_NONE}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00233}00233\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00234}00234\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00235}00235\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00236}00236\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00237}00237\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00238}00238\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00239}00239\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00240}00240\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00241}00241\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00242}00242\ \textcolor{comment}{\ *\ Function,\ sort-\/of:\ close\ the\ file\ indicated\ by\ my\ first\ arg,\ and\ return}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00243}00243\ \textcolor{comment}{\ *\ nil.\ If\ the\ first\ arg\ is\ not\ a\ stream,\ does\ nothing.\ All\ other\ args\ are}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00244}00244\ \textcolor{comment}{\ *\ ignored.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00245}00245\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00246}00246\ \textcolor{comment}{\ *\ *\ (close\ stream)}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00247}00247\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00248}00248\ \textcolor{comment}{\ *\ @param\ frame\ my\ stack\_frame.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00249}00249\ \textcolor{comment}{\ *\ @param\ frame\_pointer\ a\ pointer\ to\ my\ stack\_frame.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00250}00250\ \textcolor{comment}{\ *\ @param\ env\ my\ environment.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00251}00251\ \textcolor{comment}{\ *\ @return\ T\ if\ the\ stream\ was\ successfully\ closed,\ else\ NIL.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00252}00252\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00253}00253\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00254}\mbox{\hyperlink{io_8c_abb88a49fb6af67a8370bad809a47faf8}{00254}}\ \mbox{\hyperlink{io_8c_abb88a49fb6af67a8370bad809a47faf8}{lisp\_close}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structstack__frame}{stack\_frame}}\ *frame,\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ frame\_pointer,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00255}00255\ \ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ env\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00256}00256\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result\ =\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00257}00257\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00258}00258\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a529f73078f45d69cf57129856f61c8c2}{readp}}(\ frame-\/>arg[0]\ )\ ||\ \mbox{\hyperlink{consspaceobject_8h_a09a3fce77d86ceec4e6e1f9a73fb8306}{writep}}(\ frame-\/>arg[0]\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00259}00259\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{fopen_8c_ae855f8141739dd05eb4a2319006d1177}{url\_fclose}}(\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ frame-\/>arg[0]\ ).payload.stream.stream\ )}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00260}00260\ \ \ \ \ \ \ \ \ \ \ \ \ \ ==\ 0\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00261}00261\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{consspaceobject_8h_aa8cecfc5c5c054d2875c03e77b7be15d}{TRUE}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00262}00262\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00263}00263\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00264}00264\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00265}00265\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00266}00266\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00267}00267\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00268}\mbox{\hyperlink{io_8c_a1c9d334edc92edabdc449a52673abdd7}{00268}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{io_8c_a1c9d334edc92edabdc449a52673abdd7}{add\_meta\_integer}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ meta,\ wchar\_t\ *key,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00269}00269\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{long}\ \textcolor{keywordtype}{int}\ value\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00270}00270\ \ \ \ \ \textcolor{keywordflow}{return}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00271}00271\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8c_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}(\ \mbox{\hyperlink{consspaceobject_8c_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00272}00272\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ \mbox{\hyperlink{consspaceobject_8c_a36a68d265999acf02988326ec4c53fc2}{c\_string\_to\_lisp\_keyword}}(\ key\ ),}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00273}00273\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_afff1d31bb49e1be78395b0803b0b2514}{make\_integer}}(\ value,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ )\ ),\ meta\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00274}00274\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00275}00275\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00276}\mbox{\hyperlink{io_8c_a1e9d1bc4043f1148db2a5e012e8427a4}{00276}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{io_8c_a1e9d1bc4043f1148db2a5e012e8427a4}{add\_meta\_string}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ meta,\ wchar\_t\ *key,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00277}00277\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ *value\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00278}00278\ \ \ \ \ value\ =\ \mbox{\hyperlink{utils_8c_ae5bb0c43f76b886197ee48679f0e8dbc}{trim}}(\ value\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00279}00279\ \ \ \ \ \textcolor{keywordtype}{wchar\_t}\ buffer[strlen(\ value\ )\ +\ 1];}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00280}00280\ \ \ \ \ mbstowcs(\ buffer,\ value,\ strlen(\ value\ )\ +\ 1\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00281}00281\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00282}00282\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{consspaceobject_8c_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}(\ \mbox{\hyperlink{consspaceobject_8c_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}(\ \mbox{\hyperlink{consspaceobject_8c_a36a68d265999acf02988326ec4c53fc2}{c\_string\_to\_lisp\_keyword}}(\ key\ ),}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00283}00283\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8c_a9e4202c8555763ca9a119f0d63a058cd}{c\_string\_to\_lisp\_string}}(\ buffer\ )\ ),\ meta\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00284}00284\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00285}00285\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00286}\mbox{\hyperlink{io_8c_a774cd200184c00b546915c112be56372}{00286}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{io_8c_a774cd200184c00b546915c112be56372}{add\_meta\_time}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ meta,\ wchar\_t\ *key,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00287}00287\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ time\_t\ *value\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00288}00288\ \ \ \ \ \textcolor{comment}{/*\ I\ don't\ yet\ have\ a\ concept\ of\ a\ date-\/time\ object,\ which\ is\ a}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00289}00289\ \textcolor{comment}{\ \ \ \ \ *\ bit\ of\ an\ oversight!\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00290}00290\ \ \ \ \ \textcolor{keywordtype}{char}\ datestring[256];}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00291}00291\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00292}00292\ \ \ \ \ strftime(\ datestring,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00293}00293\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{sizeof}(\ datestring\ ),}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00294}00294\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ nl\_langinfo(\ D\_T\_FMT\ ),\ localtime(\ value\ )\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00295}00295\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00296}00296\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{io_8c_a1e9d1bc4043f1148db2a5e012e8427a4}{add\_meta\_string}}(\ meta,\ key,\ datestring\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00297}00297\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00298}00298\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00299}00299\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00300}00300\ \textcolor{comment}{\ *\ Callback\ to\ assemble\ metadata\ for\ a\ URL\ stream.\ This\ is\ naughty\ because}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00301}00301\ \textcolor{comment}{\ *\ it\ modifies\ data,\ but\ it's\ really\ the\ only\ way\ to\ create\ metadata.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00302}00302\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00303}00303\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{size\_t}\ write\_meta\_callback(\ \textcolor{keywordtype}{char}\ *\textcolor{keywordtype}{string},\ \textcolor{keywordtype}{size\_t}\ size,\ \textcolor{keywordtype}{size\_t}\ nmemb,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00304}00304\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct}\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ stream\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00305}00305\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *cell\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ stream\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00306}00306\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00307}00307\ \ \ \ \ \textcolor{comment}{/*\ make\ a\ copy\ of\ the\ string\ that\ we\ can\ destructively\ change\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00308}00308\ \ \ \ \ \textcolor{keywordtype}{char}\ *s\ =\ calloc(\ strlen(\ \textcolor{keywordtype}{string}\ ),\ \textcolor{keyword}{sizeof}(\ \textcolor{keywordtype}{char}\ )\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00309}00309\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00310}00310\ \ \ \ \ strcpy(\ s,\ \textcolor{keywordtype}{string}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00311}00311\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00312}00312\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ strncmp(\ \&cell-\/>\mbox{\hyperlink{consspaceobject_8h_a21cb645ce4ae20308447dcd59534bf38}{tag}}.bytes[0],\ \mbox{\hyperlink{consspaceobject_8h_a2b90ce94785f52e02da0f919a6a40d01}{READTAG}},\ 4\ )\ ||}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00313}00313\ \ \ \ \ \ \ \ \ \ strncmp(\ \&cell-\/>\mbox{\hyperlink{consspaceobject_8h_a21cb645ce4ae20308447dcd59534bf38}{tag}}.bytes[0],\ \mbox{\hyperlink{consspaceobject_8h_add6f1b30b9405ded32bea47b70c54026}{WRITETAG}},\ 4\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00314}00314\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ offset\ =\ \mbox{\hyperlink{utils_8c_ab55c66b6fbeac34e71ec2b8f83a2aade}{index\_of}}(\ \textcolor{charliteral}{':'},\ s\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00315}00315\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00316}00316\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ offset\ !=\ -\/1\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00317}00317\ \ \ \ \ \ \ \ \ \ \ \ \ s[offset]\ =\ (\ char\ )\ 0;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00318}00318\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ *name\ =\ \mbox{\hyperlink{utils_8c_ae5bb0c43f76b886197ee48679f0e8dbc}{trim}}(\ s\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00319}00319\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ *value\ =\ \mbox{\hyperlink{utils_8c_ae5bb0c43f76b886197ee48679f0e8dbc}{trim}}(\ \&s[++offset]\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00320}00320\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{wchar\_t}\ wname[strlen(\ name\ )];}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00321}00321\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00322}00322\ \ \ \ \ \ \ \ \ \ \ \ \ mbstowcs(\ wname,\ name,\ strlen(\ name\ )\ +\ 1\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00323}00323\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00324}00324\ \ \ \ \ \ \ \ \ \ \ \ \ cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.stream.meta\ =}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00325}00325\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{io_8c_a1e9d1bc4043f1148db2a5e012e8427a4}{add\_meta\_string}}(\ cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.stream.meta,\ wname,\ value\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00326}00326\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00327}00327\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00328}00328\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L\textcolor{stringliteral}{"{}write\_meta\_callback:\ added\ header\ '\%s':\ value\ '\%s'\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00329}00329\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ name,\ value\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00330}00330\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (\ strncmp(\ \textcolor{stringliteral}{"{}HTTP"{}},\ s,\ 4\ )\ ==\ 0\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00331}00331\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ offset\ =\ \mbox{\hyperlink{utils_8c_ab55c66b6fbeac34e71ec2b8f83a2aade}{index\_of}}(\ \textcolor{charliteral}{'\ '},\ s\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00332}00332\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ *value\ =\ \mbox{\hyperlink{utils_8c_ae5bb0c43f76b886197ee48679f0e8dbc}{trim}}(\ \&s[offset]\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00333}00333\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00334}00334\ \ \ \ \ \ \ \ \ \ \ \ \ cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.stream.meta\ =}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00335}00335\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{io_8c_a1c9d334edc92edabdc449a52673abdd7}{add\_meta\_integer}}(\ \mbox{\hyperlink{io_8c_a1e9d1bc4043f1148db2a5e012e8427a4}{add\_meta\_string}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00336}00336\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.stream.meta,\ L\textcolor{stringliteral}{"{}status"{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00337}00337\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ value\ ),\ L\textcolor{stringliteral}{"{}status-\/code"{}},\ strtol(\ value,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00338}00338\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NULL,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00339}00339\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 10\ )\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00340}00340\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00341}00341\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00342}00342\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L\textcolor{stringliteral}{"{}write\_meta\_callback:\ added\ header\ 'status':\ value\ '\%s'\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00343}00343\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ value\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00344}00344\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00345}00345\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00346}00346\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L\textcolor{stringliteral}{"{}write\_meta\_callback:\ header\ passed\ with\ no\ colon:\ '\%s'\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00347}00347\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ s\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00348}00348\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00349}00349\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00350}00350\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00351}00351\ \ \ \ \ \ \ \ \ \ \ \ \ (\ L\textcolor{stringliteral}{"{}Pointer\ passed\ to\ write\_meta\_callback\ did\ not\ point\ to\ a\ stream:\ "{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00352}00352\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00353}00353\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_aa0ffa929ddbce890ce4f81264a211233}{debug\_dump\_object}}(\ stream,\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00354}00354\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00355}00355\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00356}00356\ \ \ \ \ free(\ s\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00357}00357\ \ \ \ \ \textcolor{keywordflow}{return}\ strlen(\ \textcolor{keywordtype}{string}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00358}00358\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00359}00359\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00360}\mbox{\hyperlink{io_8c_a96420c7f029c2decf73c8f99f69daae9}{00360}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{io_8c_a96420c7f029c2decf73c8f99f69daae9}{collect\_meta}}(\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ stream,\ \textcolor{keywordtype}{char}\ *url\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00361}00361\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *cell\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ stream\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00362}00362\ \ \ \ \ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ *s\ =\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ stream\ ).payload.stream.stream;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00363}00363\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ meta\ =}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00364}00364\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{io_8c_a1e9d1bc4043f1148db2a5e012e8427a4}{add\_meta\_string}}(\ cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.stream.meta,\ L\textcolor{stringliteral}{"{}url"{}},\ url\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00365}00365\ \ \ \ \ \textcolor{keyword}{struct\ }stat\ statbuf;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00366}00366\ \ \ \ \ \textcolor{keywordtype}{int}\ result\ =\ stat(\ url,\ \&statbuf\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00367}00367\ \ \ \ \ \textcolor{keyword}{struct\ }passwd\ *pwd;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00368}00368\ \ \ \ \ \textcolor{keyword}{struct\ }group\ *grp;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00369}00369\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00370}00370\ \ \ \ \ \textcolor{keywordflow}{switch}\ (\ s-\/>\mbox{\hyperlink{fopen_8h_a3f626b0c4d351deff31d373b1987f5a7}{type}}\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00371}00371\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12abf2aa2baf8c5c768bee2228c2991c0a7}{CFTYPE\_NONE}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00372}00372\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00373}00373\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12a3cbcf3d97506c91623b1e0641c3671b4}{CFTYPE\_FILE}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00374}00374\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ result\ ==\ 0\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00375}00375\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ (\ pwd\ =\ getpwuid(\ statbuf.st\_uid\ )\ )\ !=\ NULL\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00376}00376\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ meta\ =\ \mbox{\hyperlink{io_8c_a1e9d1bc4043f1148db2a5e012e8427a4}{add\_meta\_string}}(\ meta,\ L\textcolor{stringliteral}{"{}owner"{}},\ pwd-\/>pw\_name\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00377}00377\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00378}00378\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ meta\ =\ \mbox{\hyperlink{io_8c_a1c9d334edc92edabdc449a52673abdd7}{add\_meta\_integer}}(\ meta,\ L\textcolor{stringliteral}{"{}owner"{}},\ statbuf.st\_uid\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00379}00379\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00380}00380\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00381}00381\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ (\ grp\ =\ getgrgid(\ statbuf.st\_gid\ )\ )\ !=\ NULL\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00382}00382\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ meta\ =\ \mbox{\hyperlink{io_8c_a1e9d1bc4043f1148db2a5e012e8427a4}{add\_meta\_string}}(\ meta,\ L\textcolor{stringliteral}{"{}group"{}},\ grp-\/>gr\_name\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00383}00383\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00384}00384\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ meta\ =\ \mbox{\hyperlink{io_8c_a1c9d334edc92edabdc449a52673abdd7}{add\_meta\_integer}}(\ meta,\ L\textcolor{stringliteral}{"{}group"{}},\ statbuf.st\_gid\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00385}00385\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00386}00386\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00387}00387\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ meta\ =}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00388}00388\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{io_8c_a1c9d334edc92edabdc449a52673abdd7}{add\_meta\_integer}}(\ meta,\ L\textcolor{stringliteral}{"{}size"{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00389}00389\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ intmax\_t\ )\ statbuf.st\_size\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00390}00390\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00391}00391\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ meta\ =\ \mbox{\hyperlink{io_8c_a774cd200184c00b546915c112be56372}{add\_meta\_time}}(\ meta,\ L\textcolor{stringliteral}{"{}modified"{}},\ \&statbuf.st\_mtime\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00392}00392\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00393}00393\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00394}00394\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12a008570f612978c91c772a226badbee17}{CFTYPE\_CURL}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00395}00395\ \ \ \ \ \ \ \ \ \ \ \ \ curl\_easy\_setopt(\ s-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.curl,\ CURLOPT\_VERBOSE,\ 1L\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00396}00396\ \ \ \ \ \ \ \ \ \ \ \ \ curl\_easy\_setopt(\ s-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.curl,\ CURLOPT\_HEADERFUNCTION,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00397}00397\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ write\_meta\_callback\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00398}00398\ \ \ \ \ \ \ \ \ \ \ \ \ curl\_easy\_setopt(\ s-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.curl,\ CURLOPT\_HEADERDATA,\ stream\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00399}00399\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00400}00400\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00401}00401\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00402}00402\ \ \ \ \ \textcolor{comment}{/*\ this\ is\ destructive\ change\ before\ the\ cell\ is\ released\ into\ the}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00403}00403\ \textcolor{comment}{\ \ \ \ \ *\ wild,\ and\ consequently\ permissible,\ just.\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00404}00404\ \ \ \ \ cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.stream.meta\ =\ meta;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00405}00405\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00406}00406\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00407}00407\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00408}00408\ \textcolor{comment}{\ *\ Resutn\ the\ current\ default\ input,\ or\ of\ \`{}inputp`\ is\ false,\ output\ stream\ from}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00409}00409\ \textcolor{comment}{\ *\ this\ \`{}env`ironment.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00410}00410\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00411}\mbox{\hyperlink{io_8c_a9d614d1f21a42692f5dbab12757ec1be}{00411}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{io_8c_a9d614d1f21a42692f5dbab12757ec1be}{get\_default\_stream}}(\ bool\ inputp,\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ env\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00412}00412\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result\ =\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00413}00413\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ stream\_name\ =\ inputp\ ?\ \mbox{\hyperlink{io_8c_a21ef246a2e9023dab932aef9cf51ffcd}{lisp\_io\_in}}\ :\ \mbox{\hyperlink{io_8c_a4ab3e001c63210ab136b954086f9bed0}{lisp\_io\_out}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00414}00414\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00415}00415\ \ \ \ \ result\ =\ \mbox{\hyperlink{intern_8c_ac42ecb66595443f6fc62333afb326873}{c\_assoc}}(\ stream\_name,\ env\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00416}00416\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00417}00417\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00418}00418\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00419}00419\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00420}00420\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00421}00421\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00422}00422\ \textcolor{comment}{\ *\ Function:\ return\ a\ stream\ open\ on\ the\ URL\ indicated\ by\ the\ first\ argument;}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00423}00423\ \textcolor{comment}{\ *\ if\ a\ second\ argument\ is\ present\ and\ is\ non-\/nil,\ open\ it\ for\ reading.\ At}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00424}00424\ \textcolor{comment}{\ *\ present,\ further\ arguments\ are\ ignored\ and\ there\ is\ no\ mechanism\ to\ open}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00425}00425\ \textcolor{comment}{\ *\ to\ append,\ or\ error\ if\ the\ URL\ is\ faulty\ or\ indicates\ an\ unavailable}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00426}00426\ \textcolor{comment}{\ *\ resource.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00427}00427\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00428}00428\ \textcolor{comment}{\ *\ *\ (open\ url)}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00429}00429\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00430}00430\ \textcolor{comment}{\ *\ @param\ frame\ my\ stack\_frame.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00431}00431\ \textcolor{comment}{\ *\ @param\ frame\_pointer\ a\ pointer\ to\ my\ stack\_frame.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00432}00432\ \textcolor{comment}{\ *\ @param\ env\ my\ environment.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00433}00433\ \textcolor{comment}{\ *\ @return\ a\ string\ of\ one\ character,\ namely\ the\ next\ available\ character}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00434}00434\ \textcolor{comment}{\ *\ on\ my\ stream,\ if\ any,\ else\ NIL.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00435}00435\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00436}00436\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00437}\mbox{\hyperlink{io_8c_a44891c34d2c712e623d05df4d661a5aa}{00437}}\ \mbox{\hyperlink{io_8c_a44891c34d2c712e623d05df4d661a5aa}{lisp\_open}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structstack__frame}{stack\_frame}}\ *frame,\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ frame\_pointer,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00438}00438\ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ env\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00439}00439\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result\ =\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00440}00440\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00441}00441\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_ab57f7feed314b0b9efa64d4cb3102759}{stringp}}(\ frame-\/>arg[0]\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00442}00442\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ *url\ =\ \mbox{\hyperlink{io_8c_a7af48ce42d938915fd8e59aad5f566ee}{lisp\_string\_to\_c\_string}}(\ frame-\/>arg[0]\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00443}00443\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00444}00444\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a758a42bfac22caaf66e29c666c91702d}{nilp}}(\ frame-\/>arg[1]\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00445}00445\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ *stream\ =\ \mbox{\hyperlink{fopen_8c_a26798feb43118ca8efe6fde1aa0dcaba}{url\_fopen}}(\ url,\ \textcolor{stringliteral}{"{}r"{}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00446}00446\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00447}00447\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00448}00448\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L\textcolor{stringliteral}{"{}lisp\_open:\ stream\ @\ \%ld,\ stream\ type\ =\ \%d,\ stream\ handle\ =\ \%ld\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00449}00449\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ \textcolor{keywordtype}{long}\ \textcolor{keywordtype}{int}\ )\ \&stream,\ (\ \textcolor{keywordtype}{int}\ )\ stream-\/>\mbox{\hyperlink{fopen_8h_a3f626b0c4d351deff31d373b1987f5a7}{type}},}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00450}00450\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ \textcolor{keywordtype}{long}\ \textcolor{keywordtype}{int}\ )\ stream-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.file\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00451}00451\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00452}00452\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{switch}\ (\ stream-\/>\mbox{\hyperlink{fopen_8h_a3f626b0c4d351deff31d373b1987f5a7}{type}}\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00453}00453\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12abf2aa2baf8c5c768bee2228c2991c0a7}{CFTYPE\_NONE}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00454}00454\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00455}00455\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_a2a1abab0c80ab1e97f507bc4eab02523}{make\_exception}}(\ \mbox{\hyperlink{consspaceobject_8h_a9e4202c8555763ca9a119f0d63a058cd}{c\_string\_to\_lisp\_string}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00456}00456\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ L\textcolor{stringliteral}{"{}Could\ not\ open\ stream"{}}\ ),}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00457}00457\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ frame\_pointer\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00458}00458\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00459}00459\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12a3cbcf3d97506c91623b1e0641c3671b4}{CFTYPE\_FILE}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00460}00460\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ stream-\/>\mbox{\hyperlink{fopen_8h_a61eb2fbb79b1d44fffa49dd0a194e09b}{handle}}.file\ ==\ NULL\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00461}00461\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00462}00462\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_a2a1abab0c80ab1e97f507bc4eab02523}{make\_exception}}(\ \mbox{\hyperlink{consspaceobject_8h_a9e4202c8555763ca9a119f0d63a058cd}{c\_string\_to\_lisp\_string}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00463}00463\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ L\textcolor{stringliteral}{"{}Could\ not\ open\ file"{}}\ ),}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00464}00464\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ frame\_pointer\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00465}00465\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00466}00466\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00467}00467\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{fopen_8h_a529ac570f58a46fd897c0d4c40d97c12a008570f612978c91c772a226badbee17}{CFTYPE\_CURL}}:}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00468}00468\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ can't\ tell\ whether\ a\ URL\ is\ bad\ without\ reading\ it\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00469}00469\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00470}00470\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00471}00471\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00472}00472\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{consspaceobject_8h_abc8581c0068fa9c1a6691336d88c11e5}{make\_read\_stream}}(\ stream,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00473}00473\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00474}00474\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ TODO:\ anything\ more\ complex\ is\ a\ problem\ for\ another\ day.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00475}00475\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ *stream\ =\ \mbox{\hyperlink{fopen_8c_a26798feb43118ca8efe6fde1aa0dcaba}{url\_fopen}}(\ url,\ \textcolor{stringliteral}{"{}w"{}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00476}00476\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{consspaceobject_8h_a9d49b726c4a7af147d27492b43751785}{make\_write\_stream}}(\ stream,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00477}00477\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00478}00478\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00479}00479\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ result\ ).payload.stream.stream\ ==\ NULL\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00480}00480\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00481}00481\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00482}00482\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{io_8c_a96420c7f029c2decf73c8f99f69daae9}{collect\_meta}}(\ result,\ url\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00483}00483\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00484}00484\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00485}00485\ \ \ \ \ \ \ \ \ free(\ url\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00486}00486\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00487}00487\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00488}00488\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00489}00489\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00490}00490\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00491}00491\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00492}00492\ \textcolor{comment}{\ *\ Function:\ return\ the\ next\ character\ from\ the\ stream\ indicated\ by\ arg\ 0;}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00493}00493\ \textcolor{comment}{\ *\ further\ arguments\ are\ ignored.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00494}00494\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00495}00495\ \textcolor{comment}{\ *\ *\ (read-\/char\ stream)}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00496}00496\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00497}00497\ \textcolor{comment}{\ *\ @param\ frame\ my\ stack\_frame.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00498}00498\ \textcolor{comment}{\ *\ @param\ frame\_pointer\ a\ pointer\ to\ my\ stack\_frame.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00499}00499\ \textcolor{comment}{\ *\ @param\ env\ my\ environment.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00500}00500\ \textcolor{comment}{\ *\ @return\ a\ string\ of\ one\ character,\ namely\ the\ next\ available\ character}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00501}00501\ \textcolor{comment}{\ *\ on\ my\ stream,\ if\ any,\ else\ NIL.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00502}00502\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00503}00503\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00504}\mbox{\hyperlink{io_8c_ac795341ab3355d1a89753166159bfa80}{00504}}\ \mbox{\hyperlink{io_8c_ac795341ab3355d1a89753166159bfa80}{lisp\_read\_char}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structstack__frame}{stack\_frame}}\ *frame,\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ frame\_pointer,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00505}00505\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ env\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00506}00506\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result\ =\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00507}00507\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00508}00508\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a529f73078f45d69cf57129856f61c8c2}{readp}}(\ frame-\/>arg[0]\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00509}00509\ \ \ \ \ \ \ \ \ result\ =}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00510}00510\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_a6e09249d678524caf40f18ac273c8157}{make\_string}}(\ \mbox{\hyperlink{io_8c_a3be41e66bc649c81ff099e4be3e5b1a8}{url\_fgetwc}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00511}00511\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ frame-\/>arg[0]\ ).payload.stream.}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00512}00512\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ stream\ ),\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00513}00513\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00514}00514\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00515}00515\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00516}00516\ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00517}00517\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00518}00518\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00519}00519\ \textcolor{comment}{\ *\ Function:\ return\ a\ string\ representing\ all\ characters\ from\ the\ stream}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00520}00520\ \textcolor{comment}{\ *\ indicated\ by\ arg\ 0;\ further\ arguments\ are\ ignored.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00521}00521\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00522}00522\ \textcolor{comment}{\ *\ TODO:\ it\ should\ be\ possible\ to\ optionally\ pass\ a\ string\ URL\ to\ this\ function,}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00523}00523\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00524}00524\ \textcolor{comment}{\ *\ *\ (slurp\ stream)}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00525}00525\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00526}00526\ \textcolor{comment}{\ *\ @param\ frame\ my\ stack\_frame.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00527}00527\ \textcolor{comment}{\ *\ @param\ frame\_pointer\ a\ pointer\ to\ my\ stack\_frame.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00528}00528\ \textcolor{comment}{\ *\ @param\ env\ my\ environment.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00529}00529\ \textcolor{comment}{\ *\ @return\ a\ string\ of\ one\ character,\ namely\ the\ next\ available\ character}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00530}00530\ \textcolor{comment}{\ *\ on\ my\ stream,\ if\ any,\ else\ NIL.}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00531}00531\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00532}00532\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00533}\mbox{\hyperlink{io_8c_a63d8ed9d6c6a5c00d9f62dbc7a24425c}{00533}}\ \mbox{\hyperlink{io_8c_a63d8ed9d6c6a5c00d9f62dbc7a24425c}{lisp\_slurp}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structstack__frame}{stack\_frame}}\ *frame,\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ frame\_pointer,}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00534}00534\ \ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ env\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00535}00535\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result\ =\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}};}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00536}00536\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00537}00537\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a529f73078f45d69cf57129856f61c8c2}{readp}}(\ frame-\/>arg[0]\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00538}00538\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{fopen_8h_structfcurl__data}{URL\_FILE}}\ *stream\ =\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ frame-\/>arg[0]\ ).payload.stream.stream;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00539}00539\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ cursor\ =\ \mbox{\hyperlink{consspaceobject_8h_a6e09249d678524caf40f18ac273c8157}{make\_string}}(\ \mbox{\hyperlink{io_8c_a3be41e66bc649c81ff099e4be3e5b1a8}{url\_fgetwc}}(\ stream\ ),\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00540}00540\ \ \ \ \ \ \ \ \ result\ =\ cursor;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00541}00541\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00542}00542\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\ wint\_t\ c\ =\ \mbox{\hyperlink{io_8c_a3be41e66bc649c81ff099e4be3e5b1a8}{url\_fgetwc}}(\ stream\ );\ !\mbox{\hyperlink{fopen_8c_a216d4da618cba31eb9b2badf6d5de2d9}{url\_feof}}(\ stream\ )\ \&\&\ c\ !=\ 0;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00543}00543\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ c\ =\ \mbox{\hyperlink{io_8c_a3be41e66bc649c81ff099e4be3e5b1a8}{url\_fgetwc}}(\ stream\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00544}00544\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}slurp:\ cursor\ is:\ "{}},\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00545}00545\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_aa0ffa929ddbce890ce4f81264a211233}{debug\_dump\_object}}(\ cursor,\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00546}00546\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{};\ result\ is:\ "{}},\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00547}00547\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_aa0ffa929ddbce890ce4f81264a211233}{debug\_dump\_object}}(\ result,\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00548}00548\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_a9d5aa8671cb579261b2049c09aafa773}{debug\_println}}(\ \mbox{\hyperlink{debug_8h_aa1b2b9f2886a468441606f89913c0c59}{DEBUG\_IO}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00549}00549\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00550}00550\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *cell\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ cursor\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00551}00551\ \ \ \ \ \ \ \ \ \ \ \ \ cursor\ =\ \mbox{\hyperlink{consspaceobject_8h_a6e09249d678524caf40f18ac273c8157}{make\_string}}(\ (\ \textcolor{keywordtype}{wchar\_t}\ )\ c,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00552}00552\ \ \ \ \ \ \ \ \ \ \ \ \ cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.string.cdr\ =\ cursor;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00553}00553\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00554}00554\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00555}00555\ }
\DoxyCodeLine{\Hypertarget{io_8c_source_l00556}00556\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{io_8c_source_l00557}00557\ \}}

\end{DoxyCode}
