<commit_before>// Copyright (c) 2007-2018 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Runtime.InteropServices;

namespace osu.Framework.Platform.Linux.Native
{
    public static class Library
    {
        [DllImport("libdl.so", EntryPoint = "dlopen")]
        private static extern IntPtr dlopen(string library, int flags);

        /// <summary>
        /// Load a library with specified flags as strings, the string only needs to contain the flags you want.
        /// <para/>See 'man dlopen' for more information about the flags.
        /// <para/>See 'man ld.so for more information about how the libraries are loaded.
        /// </summary>
        public static void LoadLibrary(string library, string flags)
        {
            int flag = 0x00000;

            const int RTLD_LAZY = 0x00001;
            const int RTLD_NOW = 0x00002;
            const int RTLD_BINDING_MASK = 0x00003;
            const int RTLD_NOLOAD = 0x00004;
            const int RTLD_DEEPBIND = 0x00008;
            const int RTLD_GLOBAL = 0x00100;
            const int RTLD_LOCAL = 0x00000;
            const int RTLD_NODELETE = 0x01000;

            if (flags.Contains("RTLD_LAZY"))
                flag+=RTLD_LAZY;
            else if (flags.Contains("RTLD_NOW"))
                flag+=RTLD_NOW;

            if (flags.Contains("RTLD_BINDING_MASK"))
                flag+=RTLD_BINDING_MASK;
            if (flags.Contains("RTLD_NOLOAD"))
                flag+=RTLD_NOLOAD;
            if (flags.Contains("RTLD_DEEPBIND"))
                flag+=RTLD_DEEPBIND;
            if (flags.Contains("RTLD_GLOBAL"))
                flag+=RTLD_GLOBAL;
            if (flags.Contains("RTLD_LOCAL"))
                flag+=RTLD_LOCAL;
            if (flags.Contains("RTLD_NODELETE"))
                flag+=RTLD_NODELETE;

            dlopen(library, flag);
        }
    }
}<commit_msg>Use lowercase variables for linux library loading flags, ignore casing.<commit_after>// Copyright (c) 2007-2018 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Runtime.InteropServices;

namespace osu.Framework.Platform.Linux.Native
{
    public static class Library
    {
        [DllImport("libdl.so", EntryPoint = "dlopen")]
        private static extern IntPtr dlopen(string library, int flags);

        /// <summary>
        /// Load a library with specified flags as strings, the string only needs to contain the flags you want.
        /// <para/>See 'man dlopen' for more information about the flags.
        /// <para/>See 'man ld.so for more information about how the libraries are loaded.
        /// </summary>
        public static void LoadLibrary(string library, string flags)
        {
            int flag = 0x00000;

            const int rtld_lazy = 0x00001;
            const int rtld_now = 0x00002;
            const int rtld_binding_mask = 0x00003;
            const int rtld_noload = 0x00004;
            const int rtld_deepbind = 0x00008;
            const int rtld_global = 0x00100;
            const int rtld_local = 0x00000;
            const int rtld_nodelete = 0x01000;

            if (flags.ToUpper().Contains("RTLD_LAZY"))
                flag+=rtld_lazy;
            else if (flags.ToUpper().Contains("RTLD_NOW"))
                flag+=rtld_now;

            if (flags.ToUpper().Contains("RTLD_BINDING_MASK"))
                flag+=rtld_binding_mask;
            if (flags.ToUpper().Contains("RTLD_NOLOAD"))
                flag+=rtld_noload;
            if (flags.ToUpper().Contains("RTLD_DEEPBIND"))
                flag+=rtld_deepbind;
            if (flags.ToUpper().Contains("RTLD_GLOBAL"))
                flag+=rtld_global;
            if (flags.ToUpper().Contains("RTLD_LOCAL"))
                flag+=rtld_local;
            if (flags.ToUpper().Contains("RTLD_NODELETE"))
                flag+=rtld_nodelete;

            dlopen(library, flag);
        }
    }
}
{'fraction_non_alphanumeric': 0.1015203531142717, 'fraction_numerical': 0.030407062285434036, 'mean_word_length': 2.03723008190618, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4661134', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1174, 'n_words': 299}