···11+/*
22+ This file is part of Darling.
33+44+ Copyright (C) 2019 Lubos Dolezel
55+66+ Darling is free software: you can redistribute it and/or modify
77+ it under the terms of the GNU General Public License as published by
88+ the Free Software Foundation, either version 3 of the License, or
99+ (at your option) any later version.
1010+1111+ Darling is distributed in the hope that it will be useful,
1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+ GNU General Public License for more details.
1515+1616+ You should have received a copy of the GNU General Public License
1717+ along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+#include <stdio.h>
2121+#include <CoreFoundation/CoreFoundation.h>
2222+#include <ApplicationServices/ApplicationServices.h>
2323+2424+void usage(void);
2525+2626+int main(int argc, char *argv[])
2727+{
2828+ if (argc < 0)
2929+ {
3030+ usage();
3131+ return 1;
3232+ }
3333+ CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, argv[1], kCFStringEncodingMacRoman);
3434+ CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, str, kCFURLPOSIXPathStyle, FALSE);
3535+3636+3737+3838+ return 0;
3939+}
4040+4141+void usage(void)
4242+{
4343+ printf("Usage: open [filenames]\n"
4444+ "Help: Use open to open files, folders, and URLs from the command line.\n");
4545+}