\hypertarget{g__label__iso9660_8c_source}{}\doxysection{g\+\_\+label\+\_\+iso9660.\+c}
\label{g__label__iso9660_8c_source}\index{geom/label/g\_label\_iso9660.c@{geom/label/g\_label\_iso9660.c}}
\mbox{\hyperlink{g__label__iso9660_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2004 Pawel Jakub Dawidek <pjd@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00030}\mbox{\hyperlink{g__label__iso9660_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00030}} \mbox{\hyperlink{g__label__iso9660_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__dbg_8h}{geom/geom\_dbg.h}}>}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__label_8h}{geom/label/g\_label.h}}>}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00041}\mbox{\hyperlink{g__label__iso9660_8c_af3dfed79f3ae3798f319fef66d8a9a3c}{00041}} \textcolor{preprocessor}{\#define ISO9660\_MAGIC   "{}\(\backslash\)x01"{}} "{}CD001"{} "{}\(\backslash\)x01\(\backslash\)x00"{}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00042}\mbox{\hyperlink{g__label__iso9660_8c_adc1b40b7bd85fda06a7026e843b53b19}{00042}} \textcolor{preprocessor}{\#define ISO9660\_OFFSET  0x8000}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00043}\mbox{\hyperlink{g__label__iso9660_8c_a589b9e90f60aa403d067832c5ded9298}{00043}} \textcolor{preprocessor}{\#define VOLUME\_LEN      32}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00045}00045 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00046}\mbox{\hyperlink{g__label__iso9660_8c_a393caf4920f688a633c9f7a0e9bf25ff}{00046}} \mbox{\hyperlink{g__label__iso9660_8c_a393caf4920f688a633c9f7a0e9bf25ff}{g\_label\_iso9660\_taste}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \textcolor{keywordtype}{char} *label, \textcolor{keywordtype}{size\_t} size)}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00047}00047 \{}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00048}00048         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00049}00049         \textcolor{keywordtype}{char} *sector, *\mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}};}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00051}00051         \mbox{\hyperlink{geom_8h_a71a3365bd3741226d2c0d1abada9fde7}{g\_topology\_assert\_not}}();}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00052}00052         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00053}00053         label[0] = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00055}00055         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{g__label__iso9660_8c_adc1b40b7bd85fda06a7026e843b53b19}{ISO9660\_OFFSET}} \% \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}) != 0)}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00056}00056                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00057}00057         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} < 0x28 + \mbox{\hyperlink{g__label__iso9660_8c_a589b9e90f60aa403d067832c5ded9298}{VOLUME\_LEN}})}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00058}00058                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00059}00059         sector = \mbox{\hyperlink{geom_8h_a550c2071f79908eea3d1ccbf821c4e4f}{g\_read\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \mbox{\hyperlink{g__label__iso9660_8c_adc1b40b7bd85fda06a7026e843b53b19}{ISO9660\_OFFSET}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, NULL);}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00060}00060         \textcolor{keywordflow}{if} (sector == NULL)}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00061}00061                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00062}00062         \textcolor{keywordflow}{if} (bcmp(sector, \mbox{\hyperlink{g__label__iso9660_8c_af3dfed79f3ae3798f319fef66d8a9a3c}{ISO9660\_MAGIC}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__label__iso9660_8c_af3dfed79f3ae3798f319fef66d8a9a3c}{ISO9660\_MAGIC}}) -\/ 1) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00063}00063                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(sector);}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00064}00064                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00065}00065         \}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00066}00066         \mbox{\hyperlink{g__label_8h_ab435bceb519dfa97ee448bc0f18e200f}{G\_LABEL\_DEBUG}}(1, \textcolor{stringliteral}{"{}ISO9660 file system detected on \%s."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00067}00067         \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}} = sector + 0x28;}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00068}00068         bzero(label, size);}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00069}00069         strlcpy(label, \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}}, MIN(size, \mbox{\hyperlink{g__label__iso9660_8c_a589b9e90f60aa403d067832c5ded9298}{VOLUME\_LEN}}));}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00070}00070         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(sector);}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00071}00071         \mbox{\hyperlink{g__label_8c_a6d378a52093aa49195b15e436640289f}{g\_label\_rtrim}}(label, size);}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00072}00072 \}}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00074}\mbox{\hyperlink{g__label_8h_a3caa72f2a1975576ab1cf6013843daad}{00074}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__label__desc}{g\_label\_desc}} \mbox{\hyperlink{g__label__iso9660_8c_a3caa72f2a1975576ab1cf6013843daad}{g\_label\_iso9660}} = \{}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00075}00075         .\mbox{\hyperlink{structg__label__desc_a5c38840bd2d369860b22fb12362fb4de}{ld\_taste}} = \mbox{\hyperlink{g__label__iso9660_8c_a393caf4920f688a633c9f7a0e9bf25ff}{g\_label\_iso9660\_taste}},}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00076}00076         .ld\_dirprefix = \textcolor{stringliteral}{"{}iso9660/"{}},}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00077}00077         .ld\_enabled = 1}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00078}00078 \};}
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{g__label__iso9660_8c_source_l00080}\mbox{\hyperlink{g__label__iso9660_8c_afe7c5cc47f267cde5189ba40cf5fcffe}{00080}} \mbox{\hyperlink{g__label__iso9660_8c_afe7c5cc47f267cde5189ba40cf5fcffe}{G\_LABEL\_INIT}}(iso9660, \mbox{\hyperlink{g__label__iso9660_8c_a3caa72f2a1975576ab1cf6013843daad}{g\_label\_iso9660}}, \textcolor{stringliteral}{"{}Create device nodes for ISO9660 volume names"{}});}

\end{DoxyCode}
