<commit_before>/**

    File:       main.c

    Project:    DCPU-16 Tools
    Component:  Linker

    Authors:    <NAME>

    Description:    Main entry point.

**/

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <argtable2.h>
#include <version.h>
#include <debug.h>
#include <osutil.h>
#include <iio.h>
#include <derr.h>
#include <policy.h>
#include "objfile.h"
#include "lprov.h"
#include "ldata.h"
#include "ldbins.h"
#include "ldtarget.h"
#include "ldpolicy.h"

struct tagbstring default_target = bsStatic("image");

int main(int argc, char* argv[])
{
    // Define our variables.
    int nerrors, i;
    int32_t saved = 0; // The number of words saved during compression and optimization.
    struct errinfo* errval;
    const char* prepend = "error: ";
    const char* warnprefix = "no-";
    int msglen;
    char* msg;
    int target;
    policies_t* loaded_policies = NULL;
    const char* policy_kernel = NULL;
    FILE* policy_file_io = NULL;
    bstring policy_path = NULL;
    bstring policy_kernel_path = NULL;
    bstring policy_jumplist_path = NULL;
    bstring policy_target = NULL;
    bstring policy_direct_target = NULL;
    bstring policy_direct_default = NULL;
    bool policy_direct = false;
    bool policy_use_kernel = false;

    // Define arguments.
    struct arg_lit* show_help = arg_lit0("h", "help", "Show this help.");
    struct arg_str* target_arg = arg_str0("l", "link-as", "target", "Link as the specified object, can be 'static', 'kernel' or policy target.");
    struct arg_file* symbol_file = arg_file0("s", "symbols", "<file>", "Produce a combined symbol file (~triples memory usage!).");
    struct arg_str* symbol_ext = arg_str0(NULL, "symbol-extension", "ext", "When -s is used, specifies the extension for symbol files.  Defaults to \"dsym16\".");
    struct arg_file* input_files = arg_filen(NULL, NULL, "<file>", 1, 100, "The input object files.");
    struct arg_file* output_file = arg_file1("o", "output", "<file>", "The output file (or - to send to standard output).");
    struct arg_str* kernel_name = arg_str0("k", "kernel", "<name>", "Target the specified kernel.");<commit_msg>dtld can't output to stdout, fix help message which says it can<commit_after>/**

    File:       main.c

    Project:    DCPU-16 Tools
    Component:  Linker

    Authors:    <NAME>

    Description:    Main entry point.

**/

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <argtable2.h>
#include <version.h>
#include <debug.h>
#include <osutil.h>
#include <iio.h>
#include <derr.h>
#include <policy.h>
#include "objfile.h"
#include "lprov.h"
#include "ldata.h"
#include "ldbins.h"
#include "ldtarget.h"
#include "ldpolicy.h"

struct tagbstring default_target = bsStatic("image");

int main(int argc, char* argv[])
{
    // Define our variables.
    int nerrors, i;
    int32_t saved = 0; // The number of words saved during compression and optimization.
    struct errinfo* errval;
    const char* prepend = "error: ";
    const char* warnprefix = "no-";
    int msglen;
    char* msg;
    int target;
    policies_t* loaded_policies = NULL;
    const char* policy_kernel = NULL;
    FILE* policy_file_io = NULL;
    bstring policy_path = NULL;
    bstring policy_kernel_path = NULL;
    bstring policy_jumplist_path = NULL;
    bstring policy_target = NULL;
    bstring policy_direct_target = NULL;
    bstring policy_direct_default = NULL;
    bool policy_direct = false;
    bool policy_use_kernel = false;

    // Define arguments.
    struct arg_lit* show_help = arg_lit0("h", "help", "Show this help.");
    struct arg_str* target_arg = arg_str0("l", "link-as", "target", "Link as the specified object, can be 'static', 'kernel' or policy target.");
    struct arg_file* symbol_file = arg_file0("s", "symbols", "<file>", "Produce a combined symbol file (~triples memory usage!).");
    struct arg_str* symbol_ext = arg_str0(NULL, "symbol-extension", "ext", "When -s is used, specifies the extension for symbol files.  Defaults to \"dsym16\".");
    struct arg_file* input_files = arg_filen(NULL, NULL, "<file>", 1, 100, "The input object files.");
    struct arg_file* output_file = arg_file1("o", "output", "<file>", "The output file.");
    struct arg_str* kernel_name = arg_str0("k", "kernel", "<name>", "Target the specified kernel.");
{'fraction_non_alphanumeric': 0.13704545454545455, 'fraction_numerical': 0.008181818181818182, 'mean_word_length': 3.7733188720173536, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '4384906', 'n_tokens_mistral': 1490, 'n_tokens_neox': 1454, 'n_words': 456}