0 Star 0 Fork 18

wangjie/IvorySQL

forked from IvorySQL/IvorySQL 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gen_export.pl 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
拂晓神剑 提交于 2024-11-04 14:12 +08:00 . Merge pg master to 2024.2.29 (#704)
# Copyright (c) 2024, PostgreSQL Global Development Group
use strict;
use warnings FATAL => 'all';
use Getopt::Long;
my $format;
my $libname;
my $input;
my $output;
GetOptions(
'format:s' => \$format,
'libname:s' => \$libname,
'input:s' => \$input,
'output:s' => \$output) or die "wrong arguments";
if (not( $format eq 'darwin'
or $format eq 'gnu'
or $format eq 'win'))
{
die "$0: $format is not yet handled (only darwin, gnu, win are)\n";
}
open(my $input_handle, '<', $input)
or die "$0: could not open input file '$input': $!\n";
open(my $output_handle, '>', $output)
or die "$0: could not open output file '$output': $!\n";
if ($format eq 'gnu')
{
print $output_handle "{
global:
";
}
elsif ($format eq 'win')
{
# XXX: Looks like specifying LIBRARY $libname is optional, which makes it
# easier to build a generic command for generating export files...
if ($libname)
{
print $output_handle "LIBRARY $libname\n";
}
print $output_handle "EXPORTS\n";
}
while (<$input_handle>)
{
if (/^#/)
{
# don't do anything with a comment
}
elsif (/^(\S+)\s+(\S+)/)
{
if ($format eq 'darwin')
{
print $output_handle "_$1\n";
}
elsif ($format eq 'gnu')
{
print $output_handle " $1;\n";
}
elsif ($format eq 'win')
{
print $output_handle "$1 @ $2\n";
}
}
else
{
die "$0: unexpected line $_\n";
}
}
if ($format eq 'gnu')
{
print $output_handle " local: *;
};
";
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/Jugier/IvorySQL.git
git@gitee.com:Jugier/IvorySQL.git
Jugier
IvorySQL
IvorySQL
master

搜索帮助