{"id":22287017,"url":"https://github.com/koraa/annot","last_synced_at":"2025-03-25T20:45:42.810Z","repository":{"id":145351171,"uuid":"12849156","full_name":"koraa/annot","owner":"koraa","description":"Trace stdin/signals as fast as possible. Now working.","archived":false,"fork":false,"pushed_at":"2013-09-16T22:30:23.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T18:23:33.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koraa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-15T17:17:45.000Z","updated_at":"2013-10-26T05:50:25.000Z","dependencies_parsed_at":"2023-03-22T19:46:10.406Z","dependency_job_id":null,"html_url":"https://github.com/koraa/annot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koraa%2Fannot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koraa%2Fannot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koraa%2Fannot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koraa%2Fannot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koraa","download_url":"https://codeload.github.com/koraa/annot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245542828,"owners_count":20632571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T16:58:56.479Z","updated_at":"2025-03-25T20:45:42.781Z","avatar_url":"https://github.com/koraa.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AnnoT\n\n## NAME\n\nannot - Annotate stdin with timestamps\n\n## INVOKE\n\nannot \n\n## DESCRIPTIION\n\nEach time a line is red from stdin \n\n## VERION\n\nAnnoT version 0.0.1b from 09/15/2013.\n\n## AUTHOR\n\ndefer.sh has been written by Karolin Varner \u003ckaro@cupdev.net\u003e.\n\n## REPORTING BUGS\n\nYou can file bug reports and feature requests on github:\n\nhttps://github.com/koraa/annot/pulls\n\n## COPYING\n\nCopyright © 2013 Free Software Foundation, Inc. License GPLv3+: \nGNU GPL version 3 or later \u003chttp://gnu.org/licenses/gpl.html\u003e.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n# Hacking\n\n## TODO\n\n* Use low level functions for reading\n* DOC!\n* Create manpage\n* Error-proof all the types\n* TESTS!\n* Add writer and reciever to queue\n* Define recycle-queue in main\n* Options seconds/millis/nanos\n* Options include/exclude epoch/since-start/since-last\n* Add formatting shell script\n* Clang support\n* Install support\n* Autoinclude headers\n* Options custom seperator/zero\n* SIGSEGV error message\n* Define sbuf better (this '\\0' delim is stupid)\n* SIGNAL timing support\n* Option print-delim/Print each dataset in seperate line\n* Option seperator times / data\n* Option ignore data/char as just a signal.\n\n## Source\n\nThe source code is stored at https://github.com/koraa/annot,\nyou can issue pull requests for your changes there.\nYou will requrie Git.\n\n## Codeing style\n\nGenerally try to keep consistent with the existing code (duh),\nthis generally includes indendation and braces,\nstill here are some *guideliines*:\n\n* Indendation is 2 spaces\n* Long statements (e.g. fprintf) should be broken into\n  multiple lines. In this case you should double-indent\n  the succeeding lines. Make shure ou group the args into\n  logic sets then. Don't nest this!\n* Avoid more than four levels of indendation\n* One statement per line\n  * An exception is highly repetitive code,\n    in this case you should align your code\n    in columns for easy scanning.\n    (e.g. in switch/case)\n* Omittig braces where possible is OK,\n  but keep consistent about braces in this statements\n  (e.g. if)\n* Lines should generally be no longer than 60 lines\n* Return, is like GOTO and breaks the control flow,\n  try to use a single one at the end of the function.\n  * Same is true for bug()/errxit(), exit(), continue and break\n* Files should be no longer than 200 lines of code\n* Headers and implementation should be paired or be standalone\n* Directories should have no more than 15-20 files\n* Do nest deeper than 2 directories\n* Directories should provide a meta-header.\n* Avoid the preprocessor\n* Implicit is fine, if it's  well documented\n* If it's broken, let iit crash\n* Programmer time is more expensive than compile time and run time\n* Don't hide code. We're ale grown ups here, are we mot?\n\nIts OK if your code sometimes breaks these guideline onece in a while\n(If you have a good reason, you should even add it to this list),\nbut try to compartmentalize your code:\nIf the function gets to long, nested or complicated, create onother one.\nIf the file gets to long add oneother one.\nIf the dir has too many files, add oneother one.\nIf the project get's to complex, create a lib.\n*Btw: If you stick to the rules above,\nthe project can not get longer than \n36k lines of code. This intentional* \n\nSome ideas are drawen from the Python Zen: http://www.python.org/dev/peps/pep-0020/\n\n## Types\n\nThis is a multithreaded program and lots of the syncronisation\nuses constructs like linked lists, locks and mutexes.\nI am thinking of theis constructs in an Object-Oriented manner\nand therefore emmulate it:\n\n* Each such type has it's own header/implementation combination,\n  the names of those files should be `$lowercase.c/h`\n* They provide a struct that holds the variables.\n  Its name is `struct $CamelCase__`, for each of those a\n  `typedef struct $CamelCase__ $CamelCase` is provided to\n  get rid of the struct.\n  * The struct shoud not be directly accessed\n  * This struct is defined in the header and included in the\n    source file and to everyone who uses that file.\n* All methods follow a naming scheme like `$return $lowercase_$fuction($self, ...)`\n* All methods take  the struct as their first arg\n* There are `void $lowercase_init($self, ...)` and `void $lowercase_destroy($self, ...)` methods that\n  initialize/finalize the struct\n* There are also `$self new$CamelCase(...)` and `void delete$CamelCase($self);`\n  that call the destroy/initr functions and allocate/free space for the struct.\n\n## Errors\n\nErrors are handles by making a call to the functions in err.h,\nwhich will print an error message, their stack trace and exit(i\u003e0).\nThe stack trace is printed without allocation memory on the heap\nand can therefore be employd in case of memory corruption (i.e. SIGSEGV).\n\nThis crashing strategy is used, because in this program, most errors will\nmean 'something is seriously wrong'.\nIn cases where errors can effectively be cought, this should of course be done.\n\nActive error checking forstructures like the LL should be employed.\n\nOne main reason for wrapping the mutexes (and other types) was creating an abstraction\nfor this auto-crash behaviour.\n\n## Headers\n\nEach source file shall define a macro `#define $filename_c` on it's first line,\neach header shall do the same, but include a test if it's allready defined, to \nallow redundant includes.\nEach source file shall include it's own header.\nEach header shall handle all the includes for its source file and might declare a\nsource-file only, externals only and all section.\nPlease note that this cconstruct does _not_ allow crossover includes.\n\n**Source file `fuu.c`:**\n\n```C\n#define fuu_c\n#include \"fuu.h\"\n\n// Here goes all function implentations\n```\n\n**Header file `fuu.h`:**\n```C\n#ifndef fuu_h\n#define fuu_h\n\n// BOTH-section\n// Includes, macros, types\n\n#ifndef fuu_c\n// EXTERNS-Section\n// Contains exports\n#endif\n\n#ifdef fuu_c\n// For fuu.c only\n#endif\n\n#endif\n```\n\n## Doc\n\nMost documentation should be done javadoc-style in the header,\n(i.e. Multiline comments with two stars: `/** ... */`).\nThis documentation should be mostly about the interface\n(functions/macros/types: Purpose, usage, args, return value, effect).\nComments about the indendation can of course be done inline.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoraa%2Fannot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoraa%2Fannot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoraa%2Fannot/lists"}