LWN.net Logo

methods and functions

methods and functions

Posted Aug 21, 2004 2:14 UTC (Sat) by giraffedata (subscriber, #1954)
In reply to: methods and functions by iabervon
Parent article: The end of the fcntl() method

I think "dir_notify" is as good a word as any English dictionary word, notwithstanding its weird spelling. It's as descriptive as "int" and "errno," two other words found in English conversations about kernel programming. It's as legitimate as "directory change notification." So I can't see any problem with describing a certain function as a "dir_notify" function.

In the paradigm in which you make an OOP language out of C, you represent an object with a struct and a method with a function, and put a function pointer in the struct to declare the binding. It's the fact that the function is used like an OOP method that makes it a method, not the fact that it's called through a C function pointer. I wouldn't talk about the "vfs_create method" because there isn't a type of function called in the OOP paradigm that fits that description.

I/O request descriptors usually have a function pointer to an "endio" function in them. The endio function is not a method (neither is the pointer to it). This is a much more primitive technology than OOP.

I would accept that the "method" is actually the combination of both the function and the pointer to it in the "object" struct. But I can't accept that the pointer itself is the method.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds