summaryrefslogtreecommitdiff
path: root/vendor/aws/aws-crt-php/gen_api.php
blob: d5344345f8bf1195269282ffeb3379c3223edd37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

$source = "php://stdin";
if (isset($argv[1])) {
    $source = $argv[1];
}

$input_lines = file($source);
foreach ($input_lines as $line) {
    // Strip AWS_EXTERN_C_BEGIN/END
    if (preg_match('/AWS_EXTERN_C/', $line)) {
        continue;
    }

    // Strip macros/includes
    if (preg_match('/^#/', $line)) {
        continue;
    }

    // Strip visibility attributes
    $line = str_replace('AWS_CRT_API ', '', $line);

    echo($line);
}