<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.16">
  <compounddef id="fat__string_8c" kind="file" language="C++">
    <compoundname>fat_string.c</compoundname>
    <includes refid="string_8h" local="no">string.h</includes>
    <includes refid="assert_8h" local="no">assert.h</includes>
    <includes refid="fat__string_8h" local="yes">fat_string.h</includes>
    <incdepgraph>
      <node id="10">
        <label>strings.h</label>
        <link refid="strings_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="5">
        <label>sys/select.h</label>
        <link refid="select_8h"/>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="8" relation="include">
        </childnode>
        <childnode refid="9" relation="include">
        </childnode>
      </node>
      <node id="9">
        <label>sys/_sigset.h</label>
        <link refid="__sigset_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
      <node id="2">
        <label>string.h</label>
        <link refid="string_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
      </node>
      <node id="3">
        <label>sys/types.h</label>
        <link refid="include_2sys_2types_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="5" relation="include">
        </childnode>
      </node>
      <node id="11">
        <label>assert.h</label>
        <link refid="assert_8h"/>
      </node>
      <node id="6">
        <label>sys/cdefs.h</label>
        <link refid="cdefs_8h"/>
      </node>
      <node id="4">
        <label>sys/_types.h</label>
        <link refid="__types_8h"/>
      </node>
      <node id="1">
        <label>C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c</label>
        <link refid="fat__string_8c"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="11" relation="include">
        </childnode>
        <childnode refid="12" relation="include">
        </childnode>
      </node>
      <node id="12">
        <label>fat_string.h</label>
        <link refid="fat__string_8h"/>
      </node>
      <node id="7">
        <label>sys/_timespec.h</label>
        <link refid="__timespec_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
      <node id="8">
        <label>sys/_timeval.h</label>
        <link refid="__timeval_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="fat__string_8c_1a88289160199a24ccb76d819a07c47921" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int fatfs_compare_names</definition>
        <argsstring>(char *strA, char *strB)</argsstring>
        <name>fatfs_compare_names</name>
        <param>
          <type>char *</type>
          <declname>strA</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>strB</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="260" column="5" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="260" bodyend="319"/>
        <references refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" compoundref="fat__string_8h" startline="17">NULL</references>
        <referencedby refid="fat__access_8h_1a8a18a3afa5804c2c3143f671d462687d" compoundref="fat__access_8c" startline="380" endline="472">fatfs_get_file_entry</referencedby>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1a3f5672103cd0dfe71c87c95a1ad3cb60" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int fatfs_create_path_string</definition>
        <argsstring>(char *path, char *filename, char *out, int maxlen)</argsstring>
        <name>fatfs_create_path_string</name>
        <param>
          <type>char *</type>
          <declname>path</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>filename</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>out</declname>
        </param>
        <param>
          <type>int</type>
          <declname>maxlen</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="403" column="5" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="403" bodyend="436"/>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1a375b265a962a087842f0fb7375f20bf4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int fatfs_get_extension</definition>
        <argsstring>(char *filename, char *out, int maxlen)</argsstring>
        <name>fatfs_get_extension</name>
        <param>
          <type>char *</type>
          <declname>filename</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>out</declname>
        </param>
        <param>
          <type>int</type>
          <declname>maxlen</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="370" column="5" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="370" bodyend="398"/>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1a591f207df5e2aa9fe091df89b0c0f3f8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int fatfs_get_sfn_display_name</definition>
        <argsstring>(char *out, char *in)</argsstring>
        <name>fatfs_get_sfn_display_name</name>
        <param>
          <type>char *</type>
          <declname>out</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>in</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="345" column="5" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="345" bodyend="364"/>
        <referencedby refid="fat__access_8h_1a256495a47634d609602fc487830aba5c" compoundref="fat__access_8c" startline="719" endline="846">fatfs_list_directory_next</referencedby>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1af78d4ac644689020e4a75fc7fb2bc8fb" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int fatfs_get_substring</definition>
        <argsstring>(char *path, int levelreq, char *output, int max_len)</argsstring>
        <name>fatfs_get_substring</name>
        <param>
          <type>char *</type>
          <declname>path</declname>
        </param>
        <param>
          <type>int</type>
          <declname>levelreq</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>output</declname>
        </param>
        <param>
          <type>int</type>
          <declname>max_len</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="92" column="5" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="92" bodyend="144"/>
        <references refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" compoundref="strlen_8c" startline="55" endline="101">strlen</references>
        <referencedby refid="fat__string_8h_1a5d871ba6e84ac429b88cb32f61d49b74" compoundref="fat__string_8c" startline="151" endline="178">fatfs_split_path</referencedby>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1a556702f8d10b5cadd5598170d41425b8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int fatfs_split_path</definition>
        <argsstring>(char *full_path, char *path, int max_path, char *filename, int max_filename)</argsstring>
        <name>fatfs_split_path</name>
        <param>
          <type>char *</type>
          <declname>full_path</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>path</declname>
        </param>
        <param>
          <type>int</type>
          <declname>max_path</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>filename</declname>
        </param>
        <param>
          <type>int</type>
          <declname>max_filename</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="151" column="5" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="151" bodyend="178"/>
        <references refid="fat__string_8c_1af78d4ac644689020e4a75fc7fb2bc8fb" compoundref="fat__string_8c" startline="92" endline="144">fatfs_get_substring</references>
        <references refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" compoundref="fat__string_8c" startline="44" endline="85">fatfs_total_path_levels</references>
        <references refid="string_8h_1ae33b18edb618c656b9b795b9fce2316c">memcpy</references>
        <references refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" compoundref="strlen_8c" startline="55" endline="101">strlen</references>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1adb3f50400ea7f9bf0794eea97f2e87ed" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int fatfs_string_ends_with_slash</definition>
        <argsstring>(char *path)</argsstring>
        <name>fatfs_string_ends_with_slash</name>
        <param>
          <type>char *</type>
          <declname>path</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="323" column="5" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="323" bodyend="341"/>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int fatfs_total_path_levels</definition>
        <argsstring>(char *path)</argsstring>
        <name>fatfs_total_path_levels</name>
        <param>
          <type>char *</type>
          <declname>path</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="44" column="5" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="44" bodyend="85"/>
        <referencedby refid="fat__string_8h_1a5d871ba6e84ac429b88cb32f61d49b74" compoundref="fat__string_8c" startline="151" endline="178">fatfs_split_path</referencedby>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1aac3f418ac5d9b0947a9e5bbb56f25dff" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int FileString_GetExtension</definition>
        <argsstring>(char *str)</argsstring>
        <name>FileString_GetExtension</name>
        <param>
          <type>char *</type>
          <declname>str</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="217" column="12" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="217" bodyend="232"/>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1aa5886c465e2be28f5336020086ba490a" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int FileString_StrCmpNoCase</definition>
        <argsstring>(char *s1, char *s2, int n)</argsstring>
        <name>FileString_StrCmpNoCase</name>
        <param>
          <type>char *</type>
          <declname>s1</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>s2</declname>
        </param>
        <param>
          <type>int</type>
          <declname>n</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="182" column="12" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="182" bodyend="212"/>
      </memberdef>
      <memberdef kind="function" id="fat__string_8c_1a9f6b8932d23b298dd2e41d5ce7631a6f" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int FileString_TrimLength</definition>
        <argsstring>(char *str, int strLen)</argsstring>
        <name>FileString_TrimLength</name>
        <param>
          <type>char *</type>
          <declname>str</declname>
        </param>
        <param>
          <type>int</type>
          <declname>strLen</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" line="237" column="12" bodyfile="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c" bodystart="237" bodyend="255"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>FAT16/32<sp/>File<sp/>IO<sp/>Library</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>V2.6</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ultra-Embedded.com</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Copyright<sp/>2003<sp/>-<sp/>2012</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Email:<sp/>admin@ultra-embedded.com</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="10"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>License:<sp/>GPL</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/>If<sp/>you<sp/>would<sp/>like<sp/>a<sp/>version<sp/>with<sp/>a<sp/>more<sp/>permissive<sp/>license<sp/>for<sp/>use<sp/>in</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/>closed<sp/>source<sp/>commercial<sp/>applications<sp/>please<sp/>contact<sp/>me<sp/>for<sp/>details.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="comment">//<sp/>This<sp/>file<sp/>is<sp/>part<sp/>of<sp/>FAT<sp/>File<sp/>IO<sp/>Library.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="comment">//<sp/>FAT<sp/>File<sp/>IO<sp/>Library<sp/>is<sp/>free<sp/>software;<sp/>you<sp/>can<sp/>redistribute<sp/>it<sp/>and/or<sp/>modify</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight><highlight class="comment">//<sp/>it<sp/>under<sp/>the<sp/>terms<sp/>of<sp/>the<sp/>GNU<sp/>General<sp/>Public<sp/>License<sp/>as<sp/>published<sp/>by</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight><highlight class="comment">//<sp/>the<sp/>Free<sp/>Software<sp/>Foundation;<sp/>either<sp/>version<sp/>2<sp/>of<sp/>the<sp/>License,<sp/>or</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="comment">//<sp/>(at<sp/>your<sp/>option)<sp/>any<sp/>later<sp/>version.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight><highlight class="comment">//<sp/>FAT<sp/>File<sp/>IO<sp/>Library<sp/>is<sp/>distributed<sp/>in<sp/>the<sp/>hope<sp/>that<sp/>it<sp/>will<sp/>be<sp/>useful,</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight><highlight class="comment">//<sp/>but<sp/>WITHOUT<sp/>ANY<sp/>WARRANTY;<sp/>without<sp/>even<sp/>the<sp/>implied<sp/>warranty<sp/>of</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight><highlight class="comment">//<sp/>MERCHANTABILITY<sp/>or<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE.<sp/><sp/>See<sp/>the</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight><highlight class="comment">//<sp/>GNU<sp/>General<sp/>Public<sp/>License<sp/>for<sp/>more<sp/>details.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"></highlight><highlight class="comment">//<sp/>You<sp/>should<sp/>have<sp/>received<sp/>a<sp/>copy<sp/>of<sp/>the<sp/>GNU<sp/>General<sp/>Public<sp/>License</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal"></highlight><highlight class="comment">//<sp/>along<sp/>with<sp/>FAT<sp/>File<sp/>IO<sp/>Library;<sp/>if<sp/>not,<sp/>write<sp/>to<sp/>the<sp/>Free<sp/>Software</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Foundation,<sp/>Inc.,<sp/>59<sp/>Temple<sp/>Place,<sp/>Suite<sp/>330,<sp/>Boston,<sp/>MA<sp/><sp/>02111-1307<sp/><sp/>USA</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="string_8h" kindref="compound">string.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="assert_8h" kindref="compound">assert.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="fat__string_8h" kindref="compound">fat_string.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight><highlight class="comment">//<sp/>fatfs_total_path_levels:<sp/>Take<sp/>a<sp/>filename<sp/>and<sp/>path<sp/>and<sp/>count<sp/>the<sp/>sub<sp/>levels</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight><highlight class="comment">//<sp/>of<sp/>folders.<sp/>E.g.<sp/>C:\folder\file.zip<sp/>=<sp/>1<sp/>level</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Acceptable<sp/>input<sp/>formats<sp/>are:</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>c:\folder\file.zip</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="41"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>/dev/etc/samba.conf</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Returns:<sp/>-1<sp/>=<sp/>Error,<sp/>0<sp/>or<sp/>more<sp/>=<sp/>Ok</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="44" refid="fat__string_8h_1aa3ef1d2590f2284ef1f983d6f7b2ad29" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" kindref="member">fatfs_total_path_levels</ref>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*path)</highlight></codeline>
<codeline lineno="45"><highlight class="normal">{</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>levels<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>expectedchar;</highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!path)</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="51"><highlight class="normal"></highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Acceptable<sp/>formats:</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/><sp/>c:\folder\file.zip</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/><sp/>/dev/etc/samba.conf</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*path<sp/>==<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expectedchar<sp/>=<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path++;</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(path[1]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;:&apos;</highlight><highlight class="normal"><sp/>||<sp/>path[2]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;\\&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expectedchar<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\\&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path<sp/>+=<sp/>3;</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="67"><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Count<sp/>levels<sp/>in<sp/>path<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(*path)</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Fast<sp/>forward<sp/>through<sp/>actual<sp/>subdir<sp/>text<sp/>to<sp/>next<sp/>slash</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(;<sp/>*path;<sp/>)</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>slash<sp/>detected<sp/>escape<sp/>from<sp/>for<sp/>loop</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*path<sp/>==<sp/>expectedchar)<sp/>{<sp/>path++;<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;<sp/>}</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path++;</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="78"><highlight class="normal"></highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Increase<sp/>number<sp/>of<sp/>subdirs<sp/>founds</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>levels++;</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="82"><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Subtract<sp/>the<sp/>file<sp/>itself</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>levels-1;</highlight></codeline>
<codeline lineno="85"><highlight class="normal">}</highlight></codeline>
<codeline lineno="86"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="87"><highlight class="normal"></highlight><highlight class="comment">//<sp/>fatfs_get_substring:<sp/>Get<sp/>a<sp/>substring<sp/>from<sp/>&apos;path&apos;<sp/>which<sp/>contains<sp/>the<sp/>folder</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="88"><highlight class="normal"></highlight><highlight class="comment">//<sp/>(or<sp/>file)<sp/>at<sp/>the<sp/>specified<sp/>level.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="normal"></highlight><highlight class="comment">//<sp/>E.g.<sp/>C:\folder\file.zip<sp/>:<sp/>Level<sp/>0<sp/>=<sp/>C:\folder,<sp/>Level<sp/>1<sp/>=<sp/>file.zip</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Returns:<sp/>-1<sp/>=<sp/>Error,<sp/>0<sp/>=<sp/>Ok</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="92" refid="fat__string_8h_1afe765f763082e56ad03a7512c926dead" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="fat__string_8c_1af78d4ac644689020e4a75fc7fb2bc8fb" kindref="member">fatfs_get_substring</ref>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*path,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>levelreq,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*output,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>max_len)</highlight></codeline>
<codeline lineno="93"><highlight class="normal">{</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>pathlen=0;</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>levels=0;</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>copypnt=0;</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>expectedchar;</highlight></codeline>
<codeline lineno="99"><highlight class="normal"></highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!path<sp/>||<sp/>max_len<sp/>&lt;=<sp/>0)</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="102"><highlight class="normal"></highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Acceptable<sp/>formats:</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/><sp/>c:\folder\file.zip</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/><sp/>/dev/etc/samba.conf</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*path<sp/>==<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expectedchar<sp/>=<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path++;</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(path[1]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;:&apos;</highlight><highlight class="normal"><sp/>||<sp/>path[2]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;\\&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>expectedchar<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\\&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path<sp/>+=<sp/>3;</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="118"><highlight class="normal"></highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Get<sp/>string<sp/>length<sp/>of<sp/>path</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/>pathlen<sp/>=<sp/>(int)<ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref><sp/>(path);</highlight></codeline>
<codeline lineno="121"><highlight class="normal"></highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Loop<sp/>through<sp/>the<sp/>number<sp/>of<sp/>times<sp/>as<sp/>characters<sp/>in<sp/>&apos;path&apos;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i&lt;pathlen;<sp/>i++)</highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>a<sp/>&apos;\&apos;<sp/>is<sp/>found<sp/>then<sp/>increase<sp/>level</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*path<sp/>==<sp/>expectedchar)<sp/>levels++;</highlight></codeline>
<codeline lineno="127"><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>correct<sp/>level<sp/>and<sp/>the<sp/>character<sp/>is<sp/>not<sp/>a<sp/>&apos;\&apos;<sp/>or<sp/>&apos;/&apos;<sp/>then<sp/>copy<sp/>text<sp/>to<sp/>&apos;output&apos;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>(levels<sp/>==<sp/>levelreq)<sp/>&amp;&amp;<sp/>(*path<sp/>!=<sp/>expectedchar)<sp/>&amp;&amp;<sp/>(copypnt<sp/>&lt;<sp/>(max_len-1)))</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[copypnt++]<sp/>=<sp/>*path;</highlight></codeline>
<codeline lineno="131"><highlight class="normal"></highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Increment<sp/>through<sp/>path<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path++;</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="135"><highlight class="normal"></highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Null<sp/>Terminate</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/>output[copypnt]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="138"><highlight class="normal"></highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>a<sp/>string<sp/>was<sp/>copied<sp/>return<sp/>0<sp/>else<sp/>return<sp/>1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(output[0]<sp/>!=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;<sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>OK</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;<sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Error</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="144"><highlight class="normal">}</highlight></codeline>
<codeline lineno="145"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="146"><highlight class="normal"></highlight><highlight class="comment">//<sp/>fatfs_split_path:<sp/>Full<sp/>path<sp/>contains<sp/>the<sp/>passed<sp/>in<sp/>string.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="147"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Returned<sp/>is<sp/>the<sp/>path<sp/>string<sp/>and<sp/>file<sp/>Name<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="148"><highlight class="normal"></highlight><highlight class="comment">//<sp/>E.g.<sp/>C:\folder\file.zip<sp/>-&gt;<sp/>path<sp/>=<sp/>C:\folder<sp/><sp/>filename<sp/>=<sp/>file.zip</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="149"><highlight class="normal"></highlight><highlight class="comment">//<sp/>E.g.<sp/>C:\file.zip<sp/>-&gt;<sp/>path<sp/>=<sp/>[blank]<sp/><sp/>filename<sp/>=<sp/>file.zip</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="150"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="151" refid="fat__string_8h_1a5d871ba6e84ac429b88cb32f61d49b74" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="fat__string_8c_1a556702f8d10b5cadd5598170d41425b8" kindref="member">fatfs_split_path</ref>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*full_path,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*path,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>max_path,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*filename,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>max_filename)</highlight></codeline>
<codeline lineno="152"><highlight class="normal">{</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>strindex;</highlight></codeline>
<codeline lineno="154"><highlight class="normal"></highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Count<sp/>the<sp/>levels<sp/>to<sp/>the<sp/>filepath</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>levels<sp/>=<sp/><ref refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" kindref="member">fatfs_total_path_levels</ref>(full_path);</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(levels<sp/>==<sp/>-1)</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="159"><highlight class="normal"></highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Get<sp/>filename<sp/>part<sp/>of<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="fat__string_8c_1af78d4ac644689020e4a75fc7fb2bc8fb" kindref="member">fatfs_get_substring</ref>(full_path,<sp/>levels,<sp/>filename,<sp/>max_filename)<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="163"><highlight class="normal"></highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>root<sp/>file</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(levels<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strindex<sp/>=<sp/>(int)<ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(full_path)<sp/>-<sp/>(int)<ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(filename);</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strindex<sp/>&gt;<sp/>max_path)</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strindex<sp/>=<sp/>max_path;</highlight></codeline>
<codeline lineno="172"><highlight class="normal"></highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="string_8h_1ae33b18edb618c656b9b795b9fce2316c" kindref="member">memcpy</ref>(path,<sp/>full_path,<sp/>strindex);</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path[strindex-1]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="176"><highlight class="normal"></highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="178"><highlight class="normal">}</highlight></codeline>
<codeline lineno="179"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="180"><highlight class="normal"></highlight><highlight class="comment">//<sp/>FileString_StrCmpNoCase:<sp/>Compare<sp/>two<sp/>strings<sp/>case<sp/>with<sp/>case<sp/>sensitivity</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="181"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="182"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>FileString_StrCmpNoCase(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*s1,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*s2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n)</highlight></codeline>
<codeline lineno="183"><highlight class="normal">{</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>diff;</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>a,b;</highlight></codeline>
<codeline lineno="186"><highlight class="normal"></highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(n--)</highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>a<sp/>=<sp/>*s1;</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b<sp/>=<sp/>*s2;</highlight></codeline>
<codeline lineno="191"><highlight class="normal"></highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Make<sp/>lower<sp/>case<sp/>if<sp/>uppercase</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((a&gt;=</highlight><highlight class="charliteral">&apos;A&apos;</highlight><highlight class="normal">)<sp/>&amp;&amp;<sp/>(a&lt;=</highlight><highlight class="charliteral">&apos;Z&apos;</highlight><highlight class="normal">))</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>a+=<sp/>32;</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((b&gt;=</highlight><highlight class="charliteral">&apos;A&apos;</highlight><highlight class="normal">)<sp/>&amp;&amp;<sp/>(b&lt;=</highlight><highlight class="charliteral">&apos;Z&apos;</highlight><highlight class="normal">))</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b+=<sp/>32;</highlight></codeline>
<codeline lineno="197"><highlight class="normal"></highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>diff<sp/>=<sp/>a<sp/>-<sp/>b;</highlight></codeline>
<codeline lineno="199"><highlight class="normal"></highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>different</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(diff)</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>diff;</highlight></codeline>
<codeline lineno="203"><highlight class="normal"></highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>run<sp/>out<sp/>of<sp/>strings</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>(*s1<sp/>==<sp/>0)<sp/>||<sp/>(*s2<sp/>==<sp/>0)<sp/>)</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="207"><highlight class="normal"></highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>s1++;</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>s2++;</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="212"><highlight class="normal">}</highlight></codeline>
<codeline lineno="213"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="214"><highlight class="normal"></highlight><highlight class="comment">//<sp/>FileString_GetExtension:<sp/>Get<sp/>index<sp/>to<sp/>extension<sp/>within<sp/>filename</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="215"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Returns<sp/>-1<sp/>if<sp/>not<sp/>found<sp/>or<sp/>index<sp/>otherwise</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="216"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="217"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>FileString_GetExtension(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*str)</highlight></codeline>
<codeline lineno="218"><highlight class="normal">{</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>dotPos<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*strSrc<sp/>=<sp/>str;</highlight></codeline>
<codeline lineno="221"><highlight class="normal"></highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Find<sp/>last<sp/>&apos;.&apos;<sp/>in<sp/>string<sp/>(if<sp/>at<sp/>all)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(*strSrc)</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*strSrc==</highlight><highlight class="charliteral">&apos;.&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dotPos<sp/>=<sp/>(int)(strSrc-str);</highlight></codeline>
<codeline lineno="227"><highlight class="normal"></highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strSrc++;</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="230"><highlight class="normal"></highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>dotPos;</highlight></codeline>
<codeline lineno="232"><highlight class="normal">}</highlight></codeline>
<codeline lineno="233"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="234"><highlight class="normal"></highlight><highlight class="comment">//<sp/>FileString_TrimLength:<sp/>Get<sp/>length<sp/>of<sp/>string<sp/>excluding<sp/>trailing<sp/>spaces</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="235"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Returns<sp/>-1<sp/>if<sp/>not<sp/>found<sp/>or<sp/>index<sp/>otherwise</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="236"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="237"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>FileString_TrimLength(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*str,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>strLen)</highlight></codeline>
<codeline lineno="238"><highlight class="normal">{</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>length<sp/>=<sp/>strLen;</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*strSrc<sp/>=<sp/>str+strLen-1;</highlight></codeline>
<codeline lineno="241"><highlight class="normal"></highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Find<sp/>last<sp/>non<sp/>white<sp/>space</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(strLen<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*strSrc<sp/>==<sp/></highlight><highlight class="charliteral">&apos;<sp/>&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>length<sp/>=<sp/>(int)(strSrc<sp/>-<sp/>str);</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="249"><highlight class="normal"></highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strSrc--;</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strLen--;</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="253"><highlight class="normal"></highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>length;</highlight></codeline>
<codeline lineno="255"><highlight class="normal">}</highlight></codeline>
<codeline lineno="256"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="257"><highlight class="normal"></highlight><highlight class="comment">//<sp/>fatfs_compare_names:<sp/>Compare<sp/>two<sp/>filenames<sp/>(without<sp/>copying<sp/>or<sp/>changing<sp/>origonals)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="258"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Returns<sp/>1<sp/>if<sp/>match,<sp/>0<sp/>if<sp/>not</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="259"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="260" refid="fat__string_8h_1a88289160199a24ccb76d819a07c47921" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="fat__string_8c_1a88289160199a24ccb76d819a07c47921" kindref="member">fatfs_compare_names</ref>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>strA,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>strB)</highlight></codeline>
<codeline lineno="261"><highlight class="normal">{</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*ext1<sp/>=<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>;</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*ext2<sp/>=<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>;</highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ext1Pos,<sp/>ext2Pos;</highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>file1Len,<sp/>file2Len;</highlight></codeline>
<codeline lineno="266"><highlight class="normal"></highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Get<sp/>both<sp/>files<sp/>extension</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/>ext1Pos<sp/>=<sp/>FileString_GetExtension(strA);</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/>ext2Pos<sp/>=<sp/>FileString_GetExtension(strB);</highlight></codeline>
<codeline lineno="270"><highlight class="normal"></highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>NOTE:<sp/>Extension<sp/>position<sp/>can<sp/>be<sp/>different<sp/>for<sp/>matching</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>filename<sp/>if<sp/>trailing<sp/>space<sp/>are<sp/>present<sp/>before<sp/>it!</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Check<sp/>that<sp/>if<sp/>one<sp/>has<sp/>an<sp/>extension,<sp/>so<sp/>does<sp/>the<sp/>other</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ext1Pos==-1)<sp/>&amp;&amp;<sp/>(ext2Pos!=-1))</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ext2Pos==-1)<sp/>&amp;&amp;<sp/>(ext1Pos!=-1))</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="278"><highlight class="normal"></highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>they<sp/>both<sp/>have<sp/>extensions,<sp/>compare<sp/>them</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ext1Pos!=-1)</highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Set<sp/>pointer<sp/>to<sp/>start<sp/>of<sp/>extension</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ext1<sp/>=<sp/>strA+ext1Pos+1;</highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ext2<sp/>=<sp/>strB+ext2Pos+1;</highlight></codeline>
<codeline lineno="285"><highlight class="normal"></highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Verify<sp/>that<sp/>the<sp/>file<sp/>extension<sp/>lengths<sp/>match!</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(ext1)<sp/>!=<sp/><ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(ext2))</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="289"><highlight class="normal"></highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>they<sp/>dont<sp/>match</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(FileString_StrCmpNoCase(ext1,<sp/>ext2,<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)<ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(ext1))!=0)</highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="293"><highlight class="normal"></highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Filelength<sp/>is<sp/>upto<sp/>extensions</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>file1Len<sp/>=<sp/>ext1Pos;</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>file2Len<sp/>=<sp/>ext2Pos;</highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>No<sp/>extensions</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="299"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="300"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="301"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Filelength<sp/>is<sp/>actual<sp/>filelength</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="302"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>file1Len<sp/>=<sp/>(int)<ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(strA);</highlight></codeline>
<codeline lineno="303"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>file2Len<sp/>=<sp/>(int)<ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(strB);</highlight></codeline>
<codeline lineno="304"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="305"><highlight class="normal"></highlight></codeline>
<codeline lineno="306"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Find<sp/>length<sp/>without<sp/>trailing<sp/>spaces<sp/>(before<sp/>ext)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/>file1Len<sp/>=<sp/>FileString_TrimLength(strA,<sp/>file1Len);</highlight></codeline>
<codeline lineno="308"><highlight class="normal"><sp/><sp/><sp/><sp/>file2Len<sp/>=<sp/>FileString_TrimLength(strB,<sp/>file2Len);</highlight></codeline>
<codeline lineno="309"><highlight class="normal"></highlight></codeline>
<codeline lineno="310"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Check<sp/>the<sp/>file<sp/>lengths<sp/>match</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(file1Len!=file2Len)</highlight></codeline>
<codeline lineno="312"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="313"><highlight class="normal"></highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Compare<sp/>main<sp/>part<sp/>of<sp/>filenames</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(FileString_StrCmpNoCase(strA,<sp/>strB,<sp/>file1Len)!=0)</highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>1;</highlight></codeline>
<codeline lineno="319"><highlight class="normal">}</highlight></codeline>
<codeline lineno="320"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="321"><highlight class="normal"></highlight><highlight class="comment">//<sp/>fatfs_string_ends_with_slash:<sp/>Does<sp/>the<sp/>string<sp/>end<sp/>with<sp/>a<sp/>slash<sp/>(\<sp/>or<sp/>/)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="322"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="323" refid="fat__string_8h_1adb3f50400ea7f9bf0794eea97f2e87ed" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="fat__string_8c_1adb3f50400ea7f9bf0794eea97f2e87ed" kindref="member">fatfs_string_ends_with_slash</ref>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*path)</highlight></codeline>
<codeline lineno="324"><highlight class="normal">{</highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(path)</highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(*path)</highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Last<sp/>character?</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="330"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!(*(path+1)))</highlight></codeline>
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*path<sp/>==<sp/></highlight><highlight class="charliteral">&apos;\\&apos;</highlight><highlight class="normal"><sp/>||<sp/>*path<sp/>==<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>1;</highlight></codeline>
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="335"><highlight class="normal"></highlight></codeline>
<codeline lineno="336"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path++;</highlight></codeline>
<codeline lineno="337"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="339"><highlight class="normal"></highlight></codeline>
<codeline lineno="340"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="341"><highlight class="normal">}</highlight></codeline>
<codeline lineno="342"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="343"><highlight class="normal"></highlight><highlight class="comment">//<sp/>fatfs_get_sfn_display_name:<sp/>Get<sp/>display<sp/>name<sp/>for<sp/>SFN<sp/>entry</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="344"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="345" refid="fat__string_8h_1a591f207df5e2aa9fe091df89b0c0f3f8" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="fat__string_8c_1a591f207df5e2aa9fe091df89b0c0f3f8" kindref="member">fatfs_get_sfn_display_name</ref>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>out,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>in)</highlight></codeline>
<codeline lineno="346"><highlight class="normal">{</highlight></codeline>
<codeline lineno="347"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>len<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(*in<sp/>&amp;&amp;<sp/>len<sp/>&lt;=<sp/>11)</highlight></codeline>
<codeline lineno="349"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="350"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>a<sp/>=<sp/>*in++;</highlight></codeline>
<codeline lineno="351"><highlight class="normal"></highlight></codeline>
<codeline lineno="352"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(a<sp/>==<sp/></highlight><highlight class="charliteral">&apos;<sp/>&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="353"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">continue</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="354"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Make<sp/>lower<sp/>case<sp/>if<sp/>uppercase</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((a&gt;=</highlight><highlight class="charliteral">&apos;A&apos;</highlight><highlight class="normal">)<sp/>&amp;&amp;<sp/>(a&lt;=</highlight><highlight class="charliteral">&apos;Z&apos;</highlight><highlight class="normal">))</highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>a+=<sp/>32;</highlight></codeline>
<codeline lineno="357"><highlight class="normal"></highlight></codeline>
<codeline lineno="358"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*out++<sp/>=<sp/>a;</highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>len++;</highlight></codeline>
<codeline lineno="360"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="361"><highlight class="normal"></highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/>*out<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>1;</highlight></codeline>
<codeline lineno="364"><highlight class="normal">}</highlight></codeline>
<codeline lineno="365"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="366"><highlight class="normal"></highlight><highlight class="comment">//<sp/>fatfs_get_extension:<sp/>Get<sp/>extension<sp/>of<sp/>filename<sp/>passed<sp/>in<sp/>&apos;filename&apos;.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="367"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Returned<sp/>extension<sp/>is<sp/>always<sp/>lower<sp/>case.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="368"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Returns:<sp/>1<sp/>if<sp/>ok,<sp/>0<sp/>if<sp/>not.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="369"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="370" refid="fat__string_8h_1a375b265a962a087842f0fb7375f20bf4" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="fat__string_8c_1a375b265a962a087842f0fb7375f20bf4" kindref="member">fatfs_get_extension</ref>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>filename,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>out,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>maxlen)</highlight></codeline>
<codeline lineno="371"><highlight class="normal">{</highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>len<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="373"><highlight class="normal"></highlight></codeline>
<codeline lineno="374"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Get<sp/>files<sp/>extension<sp/>offset</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="375"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ext_pos<sp/>=<sp/>FileString_GetExtension(filename);</highlight></codeline>
<codeline lineno="376"><highlight class="normal"></highlight></codeline>
<codeline lineno="377"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ext_pos<sp/>&gt;<sp/>0<sp/>&amp;&amp;<sp/>out<sp/>&amp;&amp;<sp/>maxlen)</highlight></codeline>
<codeline lineno="378"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>filename<sp/>+=<sp/>ext_pos<sp/>+<sp/>1;</highlight></codeline>
<codeline lineno="380"><highlight class="normal"></highlight></codeline>
<codeline lineno="381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(*filename<sp/>&amp;&amp;<sp/>len<sp/>&lt;<sp/>(maxlen-1))</highlight></codeline>
<codeline lineno="382"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>a<sp/>=<sp/>*filename++;</highlight></codeline>
<codeline lineno="384"><highlight class="normal"></highlight></codeline>
<codeline lineno="385"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Make<sp/>lowercase<sp/>if<sp/>uppercase</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((a&gt;=</highlight><highlight class="charliteral">&apos;A&apos;</highlight><highlight class="normal">)<sp/>&amp;&amp;<sp/>(a&lt;=</highlight><highlight class="charliteral">&apos;Z&apos;</highlight><highlight class="normal">))</highlight></codeline>
<codeline lineno="387"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>a+=<sp/>32;</highlight></codeline>
<codeline lineno="388"><highlight class="normal"></highlight></codeline>
<codeline lineno="389"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*out++<sp/>=<sp/>a;</highlight></codeline>
<codeline lineno="390"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>len++;</highlight></codeline>
<codeline lineno="391"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="392"><highlight class="normal"></highlight></codeline>
<codeline lineno="393"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*out<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="394"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>1;</highlight></codeline>
<codeline lineno="395"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="396"><highlight class="normal"></highlight></codeline>
<codeline lineno="397"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="398"><highlight class="normal">}</highlight></codeline>
<codeline lineno="399"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="400"><highlight class="normal"></highlight><highlight class="comment">//<sp/>fatfs_create_path_string:<sp/>Append<sp/>path<sp/>&amp;<sp/>filename<sp/>to<sp/>create<sp/>file<sp/>path<sp/>string.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="401"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Returns:<sp/>1<sp/>if<sp/>ok,<sp/>0<sp/>if<sp/>not.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="402"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="403" refid="fat__string_8h_1a3f5672103cd0dfe71c87c95a1ad3cb60" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="fat__string_8c_1a3f5672103cd0dfe71c87c95a1ad3cb60" kindref="member">fatfs_create_path_string</ref>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>path,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*filename,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>out,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>maxlen)</highlight></codeline>
<codeline lineno="404"><highlight class="normal">{</highlight></codeline>
<codeline lineno="405"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>len<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="406"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>last<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="407"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>seperator<sp/>=<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="408"><highlight class="normal"></highlight></codeline>
<codeline lineno="409"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(path<sp/>&amp;&amp;<sp/>filename<sp/>&amp;&amp;<sp/>out<sp/>&amp;&amp;<sp/>maxlen<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="410"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="411"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(*path<sp/>&amp;&amp;<sp/>len<sp/>&lt;<sp/>(maxlen-2))</highlight></codeline>
<codeline lineno="412"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="413"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>last<sp/>=<sp/>*path++;</highlight></codeline>
<codeline lineno="414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(last<sp/>==<sp/></highlight><highlight class="charliteral">&apos;\\&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="415"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>seperator<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\\&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="416"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*out++<sp/>=<sp/>last;</highlight></codeline>
<codeline lineno="417"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>len++;</highlight></codeline>
<codeline lineno="418"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="419"><highlight class="normal"></highlight></codeline>
<codeline lineno="420"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Add<sp/>a<sp/>seperator<sp/>if<sp/>trailing<sp/>one<sp/>not<sp/>found</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="421"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(last<sp/>!=<sp/></highlight><highlight class="charliteral">&apos;\\&apos;</highlight><highlight class="normal"><sp/>&amp;&amp;<sp/>last<sp/>!=<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="422"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*out++<sp/>=<sp/>seperator;</highlight></codeline>
<codeline lineno="423"><highlight class="normal"></highlight></codeline>
<codeline lineno="424"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(*filename<sp/>&amp;&amp;<sp/>len<sp/>&lt;<sp/>(maxlen-1))</highlight></codeline>
<codeline lineno="425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="426"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*out++<sp/>=<sp/>*filename++;</highlight></codeline>
<codeline lineno="427"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>len++;</highlight></codeline>
<codeline lineno="428"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="429"><highlight class="normal"></highlight></codeline>
<codeline lineno="430"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*out<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="431"><highlight class="normal"></highlight></codeline>
<codeline lineno="432"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>1;</highlight></codeline>
<codeline lineno="433"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="434"><highlight class="normal"></highlight></codeline>
<codeline lineno="435"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="436"><highlight class="normal">}</highlight></codeline>
<codeline lineno="437"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="438"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Test<sp/>Bench</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="439"><highlight class="normal"></highlight><highlight class="comment">//-----------------------------------------------------------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="440"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>FAT_STRING_TESTBENCH</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="441"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="example_8c_1acdef7a1fd863a6d3770c1268cb06add3" kindref="member">main</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="442"><highlight class="normal">{</highlight></codeline>
<codeline lineno="443"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>output[255];</highlight></codeline>
<codeline lineno="444"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>output2[255];</highlight></codeline>
<codeline lineno="445"><highlight class="normal"></highlight></codeline>
<codeline lineno="446"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" kindref="member">fatfs_total_path_levels</ref>(</highlight><highlight class="stringliteral">&quot;C:\\folder\\file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="447"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" kindref="member">fatfs_total_path_levels</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="448"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" kindref="member">fatfs_total_path_levels</ref>(</highlight><highlight class="stringliteral">&quot;C:\\folder\\folder2\\file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>2);</highlight></codeline>
<codeline lineno="449"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" kindref="member">fatfs_total_path_levels</ref>(</highlight><highlight class="stringliteral">&quot;C:\\&quot;</highlight><highlight class="normal">)<sp/>==<sp/>-1);</highlight></codeline>
<codeline lineno="450"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" kindref="member">fatfs_total_path_levels</ref>(</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">)<sp/>==<sp/>-1);</highlight></codeline>
<codeline lineno="451"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" kindref="member">fatfs_total_path_levels</ref>(</highlight><highlight class="stringliteral">&quot;/dev/etc/file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>2);</highlight></codeline>
<codeline lineno="452"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1aa3ef1d2590f2284ef1f983d6f7b2ad29" kindref="member">fatfs_total_path_levels</ref>(</highlight><highlight class="stringliteral">&quot;/dev/file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="453"><highlight class="normal"></highlight></codeline>
<codeline lineno="454"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1af78d4ac644689020e4a75fc7fb2bc8fb" kindref="member">fatfs_get_substring</ref>(</highlight><highlight class="stringliteral">&quot;C:\\folder\\file.zip&quot;</highlight><highlight class="normal">,<sp/>0,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output))<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="455"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;folder&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="456"><highlight class="normal"></highlight></codeline>
<codeline lineno="457"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1af78d4ac644689020e4a75fc7fb2bc8fb" kindref="member">fatfs_get_substring</ref>(</highlight><highlight class="stringliteral">&quot;C:\\folder\\file.zip&quot;</highlight><highlight class="normal">,<sp/>1,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output))<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="458"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="459"><highlight class="normal"></highlight></codeline>
<codeline lineno="460"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1af78d4ac644689020e4a75fc7fb2bc8fb" kindref="member">fatfs_get_substring</ref>(</highlight><highlight class="stringliteral">&quot;/dev/etc/file.zip&quot;</highlight><highlight class="normal">,<sp/>0,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output))<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="461"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;dev&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="462"><highlight class="normal"></highlight></codeline>
<codeline lineno="463"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1af78d4ac644689020e4a75fc7fb2bc8fb" kindref="member">fatfs_get_substring</ref>(</highlight><highlight class="stringliteral">&quot;/dev/etc/file.zip&quot;</highlight><highlight class="normal">,<sp/>1,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output))<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="464"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;etc&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="465"><highlight class="normal"></highlight></codeline>
<codeline lineno="466"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1af78d4ac644689020e4a75fc7fb2bc8fb" kindref="member">fatfs_get_substring</ref>(</highlight><highlight class="stringliteral">&quot;/dev/etc/file.zip&quot;</highlight><highlight class="normal">,<sp/>2,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output))<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="467"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="468"><highlight class="normal"></highlight></codeline>
<codeline lineno="469"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a556702f8d10b5cadd5598170d41425b8" kindref="member">fatfs_split_path</ref>(</highlight><highlight class="stringliteral">&quot;C:\\folder\\file.zip&quot;</highlight><highlight class="normal">,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output),<sp/>output2,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output2))<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="470"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;C:\\folder&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="471"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output2,<sp/></highlight><highlight class="stringliteral">&quot;file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="472"><highlight class="normal"></highlight></codeline>
<codeline lineno="473"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a556702f8d10b5cadd5598170d41425b8" kindref="member">fatfs_split_path</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file.zip&quot;</highlight><highlight class="normal">,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output),<sp/>output2,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output2))<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="474"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(output[0]<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="475"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output2,<sp/></highlight><highlight class="stringliteral">&quot;file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="476"><highlight class="normal"></highlight></codeline>
<codeline lineno="477"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a556702f8d10b5cadd5598170d41425b8" kindref="member">fatfs_split_path</ref>(</highlight><highlight class="stringliteral">&quot;/dev/etc/file.zip&quot;</highlight><highlight class="normal">,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output),<sp/>output2,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output2))<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="478"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;/dev/etc&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="479"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output2,<sp/></highlight><highlight class="stringliteral">&quot;file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="480"><highlight class="normal"></highlight></codeline>
<codeline lineno="481"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(FileString_GetExtension(</highlight><highlight class="stringliteral">&quot;C:\\file.zip&quot;</highlight><highlight class="normal">)<sp/>==<sp/><ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file&quot;</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="482"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(FileString_GetExtension(</highlight><highlight class="stringliteral">&quot;C:\\file.zip.ext&quot;</highlight><highlight class="normal">)<sp/>==<sp/><ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file.zip&quot;</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="483"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(FileString_GetExtension(</highlight><highlight class="stringliteral">&quot;C:\\file.zip.&quot;</highlight><highlight class="normal">)<sp/>==<sp/><ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file.zip&quot;</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="484"><highlight class="normal"></highlight></codeline>
<codeline lineno="485"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(FileString_TrimLength(</highlight><highlight class="stringliteral">&quot;C:\\file.zip&quot;</highlight><highlight class="normal">,<sp/><ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file.zip&quot;</highlight><highlight class="normal">))<sp/>==<sp/><ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file.zip&quot;</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="486"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(FileString_TrimLength(</highlight><highlight class="stringliteral">&quot;C:\\file.zip<sp/><sp/><sp/>&quot;</highlight><highlight class="normal">,<sp/><ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file.zip<sp/><sp/><sp/>&quot;</highlight><highlight class="normal">))<sp/>==<sp/><ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file.zip&quot;</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="487"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(FileString_TrimLength(</highlight><highlight class="stringliteral">&quot;<sp/><sp/><sp/>&quot;</highlight><highlight class="normal">,<sp/><ref refid="lib_8h_1ae6c8de953239811a34eeeab09458e55e" kindref="member">strlen</ref>(</highlight><highlight class="stringliteral">&quot;<sp/><sp/><sp/>&quot;</highlight><highlight class="normal">))<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="488"><highlight class="normal"></highlight></codeline>
<codeline lineno="489"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a88289160199a24ccb76d819a07c47921" kindref="member">fatfs_compare_names</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file.ext&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;C:\\file.ext&quot;</highlight><highlight class="normal">)<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="490"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a88289160199a24ccb76d819a07c47921" kindref="member">fatfs_compare_names</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file2.ext&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;C:\\file.ext&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="491"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a88289160199a24ccb76d819a07c47921" kindref="member">fatfs_compare_names</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file<sp/><sp/>.ext&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;C:\\file.ext&quot;</highlight><highlight class="normal">)<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="492"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a88289160199a24ccb76d819a07c47921" kindref="member">fatfs_compare_names</ref>(</highlight><highlight class="stringliteral">&quot;C:\\file<sp/><sp/>.ext&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;C:\\file2.ext&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="493"><highlight class="normal"></highlight></codeline>
<codeline lineno="494"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1adb3f50400ea7f9bf0794eea97f2e87ed" kindref="member">fatfs_string_ends_with_slash</ref>(</highlight><highlight class="stringliteral">&quot;C:\\folder&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="495"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1adb3f50400ea7f9bf0794eea97f2e87ed" kindref="member">fatfs_string_ends_with_slash</ref>(</highlight><highlight class="stringliteral">&quot;C:\\folder\\&quot;</highlight><highlight class="normal">)<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="496"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1adb3f50400ea7f9bf0794eea97f2e87ed" kindref="member">fatfs_string_ends_with_slash</ref>(</highlight><highlight class="stringliteral">&quot;/path&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="497"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1adb3f50400ea7f9bf0794eea97f2e87ed" kindref="member">fatfs_string_ends_with_slash</ref>(</highlight><highlight class="stringliteral">&quot;/path/a&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="498"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1adb3f50400ea7f9bf0794eea97f2e87ed" kindref="member">fatfs_string_ends_with_slash</ref>(</highlight><highlight class="stringliteral">&quot;/path/&quot;</highlight><highlight class="normal">)<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="499"><highlight class="normal"></highlight></codeline>
<codeline lineno="500"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a375b265a962a087842f0fb7375f20bf4" kindref="member">fatfs_get_extension</ref>(</highlight><highlight class="stringliteral">&quot;/mypath/file.wav&quot;</highlight><highlight class="normal">,<sp/>output,<sp/>4)<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="501"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;wav&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="502"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a375b265a962a087842f0fb7375f20bf4" kindref="member">fatfs_get_extension</ref>(</highlight><highlight class="stringliteral">&quot;/mypath/file.WAV&quot;</highlight><highlight class="normal">,<sp/>output,<sp/>4)<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="503"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;wav&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="504"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a375b265a962a087842f0fb7375f20bf4" kindref="member">fatfs_get_extension</ref>(</highlight><highlight class="stringliteral">&quot;/mypath/file.zip&quot;</highlight><highlight class="normal">,<sp/>output,<sp/>4)<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="505"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;ext&quot;</highlight><highlight class="normal">)<sp/>!=<sp/>0);</highlight></codeline>
<codeline lineno="506"><highlight class="normal"></highlight></codeline>
<codeline lineno="507"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a3f5672103cd0dfe71c87c95a1ad3cb60" kindref="member">fatfs_create_path_string</ref>(</highlight><highlight class="stringliteral">&quot;/mydir1&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;myfile.txt&quot;</highlight><highlight class="normal">,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output))<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="508"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;/mydir1/myfile.txt&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="509"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a3f5672103cd0dfe71c87c95a1ad3cb60" kindref="member">fatfs_create_path_string</ref>(</highlight><highlight class="stringliteral">&quot;/mydir2/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;myfile2.txt&quot;</highlight><highlight class="normal">,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output))<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="510"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;/mydir2/myfile2.txt&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="511"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="fat__string_8c_1a3f5672103cd0dfe71c87c95a1ad3cb60" kindref="member">fatfs_create_path_string</ref>(</highlight><highlight class="stringliteral">&quot;C:\\mydir3&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;myfile3.txt&quot;</highlight><highlight class="normal">,<sp/>output,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(output))<sp/>==<sp/>1);</highlight></codeline>
<codeline lineno="512"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1ad6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="string_8h_1a6f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(output,<sp/></highlight><highlight class="stringliteral">&quot;C:\\mydir3\\myfile3.txt&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0);</highlight></codeline>
<codeline lineno="513"><highlight class="normal">}</highlight></codeline>
<codeline lineno="514"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline>
    </programlisting>
    <location file="C:/Dev/git/UbixOS/sys/fs/fat/fat_string.c"/>
  </compounddef>
</doxygen>
