<commit_before>#include <UIKit/UIKit.h>
#include <AVFoundation/AVFoundation.h>
#include "tmath.h"
#include <mach/mach_host.h>
#include <SDL_uikitappdelegate.h>

void* iosCreateNativeLayer(void* wnd)
{
    UIWindow* uiwnd = (__bridge UIWindow*)wnd;
    
    // To create a sublayer (without SDL modification)
    CAEAGLLayer* glLayer = [CAEAGLLayer layer];
    CALayer* layer = uiwnd.rootViewController.view.layer;
    [layer addSublayer:glLayer];
    glLayer.contentsScale = [[UIScreen mainScreen] scale];
    
    glLayer.frame = layer.bounds;
    return (__bridge void*)glLayer;
}

tee::vec2_t iosGetScreenSize()
{
    CGRect screenBounds = [[UIScreen mainScreen] bounds];
    CGFloat screenScale = [[UIScreen mainScreen] scale];
    
    return tee::vec2(screenBounds.size.width*screenScale, screenBounds.size.height*screenScale);
}

void iosTurnOnAudioSession()
{
    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
    [[AVAudioSession sharedInstance] setActive:true error:nil];
}

uint8_t iosGetCoreCount()
{
    return [[NSProcessInfo processInfo] processorCount];
}

@implementation SDLUIKitDelegate(MyMethods)
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
                    restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
{
    if (userActivity.activityType == NSUserActivityTypeBrowsingWeb) {
        NSURL* url = userActivity.webpageURL;
        NSString* s = [url absoluteString];
        const char* curl = [s UTF8String];
        puts(curl);
    }
    return TRUE;
}
@end
<commit_msg>ios cleanup<commit_after>#include <UIKit/UIKit.h>
#include <AVFoundation/AVFoundation.h>
#include "tmath.h"
#include <mach/mach_host.h>

void* iosCreateNativeLayer(void* wnd)
{
    UIWindow* uiwnd = (__bridge UIWindow*)wnd;
    
    // To create a sublayer (without SDL modification)
    CAEAGLLayer* glLayer = [CAEAGLLayer layer];
    CALayer* layer = uiwnd.rootViewController.view.layer;
    [layer addSublayer:glLayer];
    glLayer.contentsScale = [[UIScreen mainScreen] scale];
    
    glLayer.frame = layer.bounds;
    return (__bridge void*)glLayer;
}

tee::vec2_t iosGetScreenSize()
{
    CGRect screenBounds = [[UIScreen mainScreen] bounds];
    CGFloat screenScale = [[UIScreen mainScreen] scale];
    
    return tee::vec2(screenBounds.size.width*screenScale, screenBounds.size.height*screenScale);
}

void iosTurnOnAudioSession()
{
    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
    [[AVAudioSession sharedInstance] setActive:true error:nil];
}

uint8_t iosGetCoreCount()
{
    return [[NSProcessInfo processInfo] processorCount];
}

{'fraction_non_alphanumeric': 0.108826657213754, 'fraction_numerical': 0.0024813895781637717, 'mean_word_length': 4.953586497890296, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, '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': '215816', 'n_tokens_mistral': 905, 'n_tokens_neox': 886, 'n_words': 175}