TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Cdefs, extract function prototypes in C files to JSON

22 pointsby megalodonover 9 years ago

7 comments

kr0over 9 years ago
I would expect a more detailed breakdown of the individual parameters. The type, name, is it a pointer to type, etc. should all be in separate fields
评论 #10143637 未加载
anintegerover 9 years ago
Would there be something that goes the other way? Given a JSON input generates C structs and efficient serialization/deserialization for given input? It could be useful for C++ too but generate classes instead. I'm aware of gsoap which did this for wsdl and generated code for use by SOAP xml clients and servers but not sure if anyone has done this for json
评论 #10144347 未加载
评论 #10144817 未加载
评论 #10144526 未加载
评论 #10144203 未加载
evmarover 9 years ago
I've used gcc-xml (apparently has been superseded by another tool now) when I've needed this sort of thing in the past. It has the advantage of being a real C parser rather than a jumble of regexes.
评论 #10143784 未加载
sbtover 9 years ago
Came to see if this used LLVM for parsing, found node...
评论 #10144005 未加载
ExpiredLinkover 9 years ago
What's the use case for this?
评论 #10143992 未加载
评论 #10144904 未加载
Matheus28over 9 years ago
A mess of regexes and splits... yeah, no. You should probably get introduced to the wonderful world of parsers (and compilers):<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Compilers:_Principles,_Techniques,_and_Tools" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Compilers:_Principles,_Techniq...</a>
评论 #10147961 未加载
gnowayover 9 years ago
This is a bad name, another cproto library has been in use for over 20 years:<p><a href="http:&#x2F;&#x2F;invisible-island.net&#x2F;cproto&#x2F;cproto.html" rel="nofollow">http:&#x2F;&#x2F;invisible-island.net&#x2F;cproto&#x2F;cproto.html</a>
评论 #10144108 未加载