在哪里定义了FSRead

在哪里定义了FSRead

本文介绍了在Mac上,在哪里定义了FSRead,FSWrite,SetFPos等,我是否应该使用它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一位经验丰富的Linux程序员,熟悉POSIX,stdio.h等,但对Mac编程来说却是全新的.这周,我试图获取几年前其他人编写的源代码,以用于64位Snow Leopard.这是一个最初用于CS3的Photoshop插件,现在可以与CS5一起使用. (不要问我有关CS4的问题.)此插件是使用gcc在命令行中使用手写的makefile构建的.

I'm an experienced Linux programmer, familiar with POSIX, stdio.h and so on, but totally new to Mac programming. This week I'm attempting to get a piece of source code written by someone else a few years ago to work on 64-bit Snow Leopard. It's a Photoshop plugin originally for CS3, now to be made to work with CS5. (Don't ask me about CS4.) This plugin is built at the command line with a handwritten makefile using gcc.

当今的主要障碍是编译器抱怨几个未声明的功能:FSRead,FSWrite,SetFPos,GetFPos等,所有这些都与文件有关.我很确定我具有正确的路径,选项等.

The main roadblock today is the compiler complaining about several undeclared functions: FSRead, FSWrite, SetFPos, GetFPos, and more, all having to do with files. I'm pretty sure I have the right paths, options etc.

经过两天的邮件标题,谷歌搜索和廉价黑客攻击后,我被困住了.这些功能在哪里定义?它们是标准的Mac OS X库函数还是Photoshop SDK函数?谷歌的一些结果表明这些功能已过时,已弃用",但我想现在已经不复存在了.如果是这种情况,我应该改用什么?

After two days grepping headers, googling, and trying to cheap hacks, I am stuck. Where are these functions defined? Are they standard Mac OS X library functions, or Photoshop SDK functions? Some google results suggest these functions are obsolete, "deprecated" but I guess by now truly gone. If that's the case, what should I be using instead?

推荐答案

它们是旧的Carbon API.您可以使用Carbon框架,但是Carbon不会移植到64位系统.由于Photoshop是64位的,因此根本无法使用.

They are old Carbon APIs. You can use the Carbon framework, however Carbon is not ported to 64-bit systems. As Photoshop is 64bit, this simply won't work.

我对Photoshop插件的处理方式并不熟悉,但是如果您要寻找直接的替代品,请查看 Core Foundation ,一种C API.实际上,您也可以使用POSIX API.如果Photoshop使用Cocoa和Objective-C,则可以使用 Foundation 和AppKit系列API.

I'm not familiar with how Photoshop plugins are handled, but if you are looking for a direct replacement you would look at Core Foundation, a C API. In reality, you can also use the POSIX APIs. If Photoshop uses Cocoa and Objective-C, you can use the Foundation and AppKit family of APIs.

这篇关于在Mac上,在哪里定义了FSRead,FSWrite,SetFPos等,我是否应该使用它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 16:04