Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6579201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:52:08+00:00 2026-05-25T15:52:08+00:00

I am working with a source base with a unclear for me rule on

  • 0

I am working with a source base with a unclear for me rule on pointer types definition: using _PTR_ macro instead of *. So, all the function prototypes and typedefs look like:

extern FILE_PTR    _io_fopen(const char _PTR_, const char _PTR_);

I wonder what could be the rationale behind this since for me this seems excessive.

EDIT

By the way, for double indirection I found:

_io_strtod(char _PTR_, char _PTR_ _PTR_);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:52:08+00:00Added an answer on May 25, 2026 at 3:52 pm

    It is possible that the definition is for compatibility with DOS.

    #ifdef DOS
    #define _PTR_ far *
    #else
    #define _PTR_ *
    #endif
    

    The far / near keywords allow pointers to address memory inside / outside the current segment, allowing programs to address more than 64 KiB of memory while still keeping the benefits of 16 bit pointers for faster code / less memory usage.

    It is more typical to exclude * from the definition. For example, in LibPNG, you can see definitions like:

    typedef png_color FAR * png_colorp;
    typedef png_color FAR * FAR * png_colorpp;
    

    On most platforms, FAR will be #defined to nothing.

    Although DOS is long past, some modern embedded architectures have similar issues. For Harvard architecture processors, pointers to program and data memory must be accessed using different instructions, so they have different types. Other processors have different “data models”, and it is not uncommon to see special pointer types for pointers below 2^24, 2^16, or 2^8.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a large source base (approx 15K files) decomposed into about
I'm working with a source base written almost entirely in straight-c (nginx). It does,
I'm working with a C++ code base. Right now I'm using a C++ code
all. I'm currently working with an old established code base for a new project
I'm working with a closed-source base class . Can I somehow change a private
I'm working this source code: #include <string> #include <vector> #include <iostream> #include <istream> #include
I'm working on a source-code visualization project that uses the Processing core library. The
I am working on some source code these days. In some codes, I find
On the web side we are working on getting source control. Now, I want
I'm looking for a good summary of best practices for working with TFS source

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.