\hypertarget{g__label__gpt_8c_source}{}\doxysection{g\+\_\+label\+\_\+gpt.\+c}
\label{g__label__gpt_8c_source}\index{geom/label/g\_label\_gpt.c@{geom/label/g\_label\_gpt.c}}
\mbox{\hyperlink{g__label__gpt_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2008 Marius Nuennerich}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00030}\mbox{\hyperlink{g__label__gpt_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00030}} \mbox{\hyperlink{g__label__gpt_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/kobj.h>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/gpt.h>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/sbuf.h>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__label_8h}{geom/label/g\_label.h}}>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__part_8h}{geom/part/g\_part.h}}>}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00044}\mbox{\hyperlink{g__label__gpt_8c_a466e75ad4dee4823f635879e53391f4e}{00044}} \textcolor{preprocessor}{\#define PART\_CLASS\_NAME "{}PART"{}}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00045}\mbox{\hyperlink{g__label__gpt_8c_a7cbbc17a6a074c4df7c530ad5582db52}{00045}} \textcolor{preprocessor}{\#define SCHEME\_NAME     "{}GPT"{}}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00047}00047 \textcolor{comment}{/* XXX: Also defined in geom/part/g\_part\_gpt.c */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00048}\mbox{\hyperlink{structg__part__gpt__entry}{00048}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__gpt__entry}{g\_part\_gpt\_entry}} \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00049}\mbox{\hyperlink{structg__part__gpt__entry_a003778de041424135bd997f884182bc6}{00049}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__entry}{g\_part\_entry}}     \mbox{\hyperlink{structg__part__gpt__entry_a003778de041424135bd997f884182bc6}{base}};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00050}\mbox{\hyperlink{structg__part__gpt__entry_a57b502101e998bdc6e164c5bcd3e5ce2}{00050}}         \textcolor{keyword}{struct }gpt\_ent          \mbox{\hyperlink{structg__part__gpt__entry_a57b502101e998bdc6e164c5bcd3e5ce2}{ent}};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00051}00051 \};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00053}00053 \textcolor{comment}{/* XXX: Shamelessly stolen from g\_part\_gpt.c */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00054}00054 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00055}\mbox{\hyperlink{g__label__gpt_8c_a8f0442c9c3bc15bc67eac9546f262798}{00055}} \mbox{\hyperlink{g__label__gpt_8c_a8f0442c9c3bc15bc67eac9546f262798}{sbuf\_nprintf\_utf16}}(\textcolor{keyword}{struct} sbuf *\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, uint16\_t *str, \textcolor{keywordtype}{size\_t} len)}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00056}00056 \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00057}00057         u\_int bo;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00058}00058         uint32\_t ch;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00059}00059         uint16\_t c;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00061}00061         bo = LITTLE\_ENDIAN;     \textcolor{comment}{/* GPT is little-\/endian */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00062}00062         \textcolor{keywordflow}{while} (len > 0 \&\& *str != 0) \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00063}00063                 ch = (bo == BIG\_ENDIAN) ? be16toh(*str) : le16toh(*str);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00064}00064                 str++, len-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00065}00065                 \textcolor{keywordflow}{if} ((ch \& 0xf800) == 0xd800) \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00066}00066                         \textcolor{keywordflow}{if} (len > 0) \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00067}00067                                 c = (bo == BIG\_ENDIAN) ? be16toh(*str)}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00068}00068                                     : le16toh(*str);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00069}00069                                 str++, len-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00070}00070                         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00071}00071                                 c = 0xfffd;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00072}00072                         \textcolor{keywordflow}{if} ((ch \& 0x400) == 0 \&\& (c \& 0xfc00) == 0xdc00) \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00073}00073                                 ch = ((ch \& 0x3ff) << 10) + (c \& 0x3ff);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00074}00074                                 ch += 0x10000;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00075}00075                         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00076}00076                                 ch = 0xfffd;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00077}00077                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (ch == 0xfffe) \{ \textcolor{comment}{/* BOM (U+FEFF) swapped. */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00078}00078                         bo = (bo == BIG\_ENDIAN) ? LITTLE\_ENDIAN : BIG\_ENDIAN;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00079}00079                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00080}00080                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (ch == 0xfeff) \textcolor{comment}{/* BOM (U+FEFF) unswapped. */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00081}00081                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00083}00083                 \textcolor{comment}{/* Write the Unicode character in UTF-\/8 */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00084}00084                 \textcolor{keywordflow}{if} (ch < 0x80)}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00085}00085                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%c"{}}, ch);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00086}00086                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (ch < 0x800)}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00087}00087                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%c\%c"{}}, 0xc0 | (ch >> 6),}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00088}00088                             0x80 | (ch \& 0x3f));}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00089}00089                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (ch < 0x10000)}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00090}00090                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%c\%c\%c"{}}, 0xe0 | (ch >> 12),}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00091}00091                             0x80 | ((ch >> 6) \& 0x3f), 0x80 | (ch \& 0x3f));}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00092}00092                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (ch < 0x200000)}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00093}00093                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%c\%c\%c\%c"{}}, 0xf0 | (ch >> 18),}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00094}00094                             0x80 | ((ch >> 12) \& 0x3f),}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00095}00095                             0x80 | ((ch >> 6) \& 0x3f), 0x80 | (ch \& 0x3f));}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00096}00096         \}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00097}00097 \}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00099}00099 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00100}\mbox{\hyperlink{g__label__gpt_8c_a736445b90e37fa31bbd08a5005e85858}{00100}} \mbox{\hyperlink{g__label__gpt_8c_a736445b90e37fa31bbd08a5005e85858}{g\_label\_gpt\_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__gpt_8c_source_l00101}00101 \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00102}00102         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00103}00103         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__table}{g\_part\_table}} *tp;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00104}00104         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__gpt__entry}{g\_part\_gpt\_entry}} *part\_gpt\_entry;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00105}00105         \textcolor{keyword}{struct }sbuf *lbl;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00107}00107         \mbox{\hyperlink{geom_8h_a71a3365bd3741226d2c0d1abada9fde7}{g\_topology\_assert\_not}}();}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00108}00108         \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__gpt_8c_source_l00109}00109         tp = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__table}{g\_part\_table}} *)\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_afe5c92b8a2a9e4cdf1cab6daa96923c1}{geom}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00110}00110         label[0] = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00112}00112         \textcolor{comment}{/* We taste only partitions handled by GPART */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00113}00113         if (strncmp(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_afe5c92b8a2a9e4cdf1cab6daa96923c1}{geom}}-\/>\mbox{\hyperlink{structg__geom_a502c2ffb3c41ad9d30d9875c678f5404}{class}}-\/>\mbox{\hyperlink{structg__class_a66bf8381cf0afbf7ccdebfa6b90a4a96}{name}}, \mbox{\hyperlink{g__label__gpt_8c_a466e75ad4dee4823f635879e53391f4e}{PART\_CLASS\_NAME}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__label__gpt_8c_a466e75ad4dee4823f635879e53391f4e}{PART\_CLASS\_NAME}})))}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00114}00114                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00115}00115         \textcolor{comment}{/* and only GPT */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00116}00116         \textcolor{keywordflow}{if} (strncmp(tp-\/>\mbox{\hyperlink{structg__part__table_a34eb7c407e232e50277567ac1723cd07}{gpt\_scheme}}-\/>name, \mbox{\hyperlink{g__label__gpt_8c_a7cbbc17a6a074c4df7c530ad5582db52}{SCHEME\_NAME}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__label__gpt_8c_a7cbbc17a6a074c4df7c530ad5582db52}{SCHEME\_NAME}})))}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00117}00117                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00118}00118 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00119}00119         part\_gpt\_entry = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__gpt__entry}{g\_part\_gpt\_entry}} *)\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a5516d1ee51e75b228f047f827f46431b}{private}};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00121}00121         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00122}00122 \textcolor{comment}{         * Create sbuf with biggest possible size.}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00123}00123 \textcolor{comment}{         * We need max. 4 bytes for every 2-\/byte utf16 char.}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00124}00124 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00125}00125         lbl = sbuf\_new(NULL, NULL, \textcolor{keyword}{sizeof}(part\_gpt\_entry-\/>\mbox{\hyperlink{structg__part__gpt__entry_a57b502101e998bdc6e164c5bcd3e5ce2}{ent}}.ent\_name) << 1, SBUF\_FIXEDLEN);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00126}00126         \textcolor{comment}{/* Size is the number of characters, not bytes */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00127}00127         \mbox{\hyperlink{g__label__gpt_8c_a8f0442c9c3bc15bc67eac9546f262798}{sbuf\_nprintf\_utf16}}(lbl, part\_gpt\_entry-\/>\mbox{\hyperlink{structg__part__gpt__entry_a57b502101e998bdc6e164c5bcd3e5ce2}{ent}}.ent\_name, \textcolor{keyword}{sizeof}(part\_gpt\_entry-\/>\mbox{\hyperlink{structg__part__gpt__entry_a57b502101e998bdc6e164c5bcd3e5ce2}{ent}}.ent\_name) >> 1);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00128}00128         sbuf\_finish(lbl);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00129}00129         strlcpy(label, sbuf\_data(lbl), size);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00130}00130         sbuf\_delete(lbl);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00131}00131 \}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00133}00133 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00134}\mbox{\hyperlink{g__label__gpt_8c_a154e11427aafe76b1f71a1b952255fa8}{00134}} \mbox{\hyperlink{g__label__gpt_8c_a154e11427aafe76b1f71a1b952255fa8}{g\_label\_gpt\_uuid\_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__gpt_8c_source_l00135}00135 \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00136}00136         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00137}00137         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__table}{g\_part\_table}} *tp;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00138}00138         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__gpt__entry}{g\_part\_gpt\_entry}} *part\_gpt\_entry;}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00140}00140         \mbox{\hyperlink{geom_8h_a71a3365bd3741226d2c0d1abada9fde7}{g\_topology\_assert\_not}}();}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00141}00141         \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__gpt_8c_source_l00142}00142         tp = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__table}{g\_part\_table}} *)\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_afe5c92b8a2a9e4cdf1cab6daa96923c1}{geom}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00143}00143         label[0] = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00145}00145         \textcolor{comment}{/* We taste only partitions handled by GPART */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00146}00146         if (strncmp(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_afe5c92b8a2a9e4cdf1cab6daa96923c1}{geom}}-\/>\mbox{\hyperlink{structg__geom_a502c2ffb3c41ad9d30d9875c678f5404}{class}}-\/>\mbox{\hyperlink{structg__class_a66bf8381cf0afbf7ccdebfa6b90a4a96}{name}}, \mbox{\hyperlink{g__label__gpt_8c_a466e75ad4dee4823f635879e53391f4e}{PART\_CLASS\_NAME}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__label__gpt_8c_a466e75ad4dee4823f635879e53391f4e}{PART\_CLASS\_NAME}})))}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00147}00147                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00148}00148         \textcolor{comment}{/* and only GPT */}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00149}00149         \textcolor{keywordflow}{if} (strncmp(tp-\/>\mbox{\hyperlink{structg__part__table_a34eb7c407e232e50277567ac1723cd07}{gpt\_scheme}}-\/>name, \mbox{\hyperlink{g__label__gpt_8c_a7cbbc17a6a074c4df7c530ad5582db52}{SCHEME\_NAME}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__label__gpt_8c_a7cbbc17a6a074c4df7c530ad5582db52}{SCHEME\_NAME}})))}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00150}00150                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00152}00152         part\_gpt\_entry = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__gpt__entry}{g\_part\_gpt\_entry}} *)\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a5516d1ee51e75b228f047f827f46431b}{private}};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00153}00153         snprintf\_uuid(label, size, \&part\_gpt\_entry-\/>\mbox{\hyperlink{structg__part__gpt__entry_a57b502101e998bdc6e164c5bcd3e5ce2}{ent}}.ent\_uuid);}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00154}00154 \}}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00156}\mbox{\hyperlink{g__label_8h_aa77227c8bfbb3b94cfa29d12c43ec1d3}{00156}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__label__desc}{g\_label\_desc}} \mbox{\hyperlink{g__label__gpt_8c_aa77227c8bfbb3b94cfa29d12c43ec1d3}{g\_label\_gpt}} = \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00157}00157         .\mbox{\hyperlink{structg__label__desc_a5c38840bd2d369860b22fb12362fb4de}{ld\_taste}} = \mbox{\hyperlink{g__label__gpt_8c_a736445b90e37fa31bbd08a5005e85858}{g\_label\_gpt\_taste}},}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00158}00158         .ld\_dirprefix = \textcolor{stringliteral}{"{}gpt/"{}},}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00159}00159         .ld\_enabled = 1}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00160}00160 \};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00162}\mbox{\hyperlink{g__label_8h_a6283a3f2ecad6bf8fa82755dc2b94be6}{00162}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__label__desc}{g\_label\_desc}} \mbox{\hyperlink{g__label__gpt_8c_a6283a3f2ecad6bf8fa82755dc2b94be6}{g\_label\_gpt\_uuid}} = \{}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00163}00163         .\mbox{\hyperlink{structg__label__desc_a5c38840bd2d369860b22fb12362fb4de}{ld\_taste}} = \mbox{\hyperlink{g__label__gpt_8c_a154e11427aafe76b1f71a1b952255fa8}{g\_label\_gpt\_uuid\_taste}},}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00164}00164         .ld\_dirprefix = \textcolor{stringliteral}{"{}gptid/"{}},}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00165}00165         .ld\_enabled = 1}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00166}00166 \};}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00167}00167 }
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00168}\mbox{\hyperlink{g__label__gpt_8c_ad1d82ebeaf26eaa2a530373c9375496b}{00168}} \mbox{\hyperlink{g__label__gpt_8c_ad1d82ebeaf26eaa2a530373c9375496b}{G\_LABEL\_INIT}}(gpt, \mbox{\hyperlink{g__label__gpt_8c_aa77227c8bfbb3b94cfa29d12c43ec1d3}{g\_label\_gpt}}, \textcolor{stringliteral}{"{}Create device nodes for GPT labels"{}});}
\DoxyCodeLine{\Hypertarget{g__label__gpt_8c_source_l00169}\mbox{\hyperlink{g__label__gpt_8c_afec49c5a5694bf280444f6fc95230b34}{00169}} \mbox{\hyperlink{g__label__gpt_8c_ad1d82ebeaf26eaa2a530373c9375496b}{G\_LABEL\_INIT}}(gptid, \mbox{\hyperlink{g__label__gpt_8c_a6283a3f2ecad6bf8fa82755dc2b94be6}{g\_label\_gpt\_uuid}}, \textcolor{stringliteral}{"{}Create device nodes for GPT UUIDs"{}});}

\end{DoxyCode}
