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 9320519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:39:14+00:00 2026-06-19T03:39:14+00:00

Is there any open source project or library, which has the ability to compare

  • 0

Is there any open source project or library, which has the ability to compare two strings in the way GNU diff does, but without launching an external process, and working with memory buffers instead of files?

That is, something looking like this hypothetical function:

comparison_result* diff(wchar_t *text1, wchar_t *text2);

I looked at GNU diffutils’ source code, hoping it would be using such a function internally, but unfortunately, it is reading the files block by block, instead of reading them into a memory buffer and comparing that. The code itself is rather convoluted, and I’m not able to understand it very well, let alone rewrite it.

Is there such a function in an open-source project?

  • 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-06-19T03:39:15+00:00Added an answer on June 19, 2026 at 3:39 am

    The source code for the diffutils programs / functions is indeed a bit difficult to adapt for this purpose given that it uses a number of partial buffering of the files during the comparison algorithm.

    However, the functionality implemented by diff isn’t really revolutionary or difficult to reproduce. And it has be reproduced in other libraries. For example, the google-diff-match-patch library from google-code, it’s API is a bit crude, but it seems to do the job.

    Another possibility is to write your data into in-memory FILE* buffers, and then use the diffutils functions, reading and writing to those in-memory buffers. You can create such buffers with fmemopen.

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

Sidebar

Related Questions

Is there any open source engine project which can classify online text or article.
is there any library, code sample, open source project, etc helping me share objects(a
I is there any free/open source project available, which creates a simple quiz on
Are there any open source projects or part of codes using which its possible
Is there any open source CMS in a java/xml platform which supports REST based
Are there any open-source compression/decomp libraries available for Ruby? Has anyone implemented LZW? Or,
I wanna implement comments view like this: Is there any open source project doing
Possible Duplicate: Good STL-like library for C Are there any open source C libraries
Is there any open source similar to Facebook's share/status update widget or I have
Are there any open source applications that provide a set of features similar to

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.