{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1753413447,
"reponame":"openssl",
"desc":"OpenSSL",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"eb02fa8b6aa50bcab0d5e35ac45f8987",
"oid":{ "oid": "8fe3127cda7ee89e169184eeeaaca5eebcf8664e", "alias": []},"blobname": "util/openssl-format-source", "blob": "#!/bin/sh\n#\n# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.\n#\n# Licensed under the OpenSSL license (the \u0022License\u0022). You may not use\n# this file except in compliance with the License. You can obtain a copy\n# in the file LICENSE in the source distribution or at\n# https://www.openssl.org/source/license.html\n\n#\n# openssl-format-source \n# - format source tree according to OpenSSL coding style using indent\n#\n# usage:\n# openssl-format-source [-v] [-n] [file|directory] ...\n#\n# note: the indent options assume GNU indent v2.2.10 which was released\n# Feb-2009 so if you have an older indent the options may not \n#\tmatch what is expected\n#\n# any marked block comment blocks have to be moved to align manually after\n# the reformatting has been completed as marking a block causes indent to \n# not move it at all ...\n#\n\nPATH\u003d/usr/local/bin:/bin:/usr/bin:$PATH\nexport PATH\nHERE\u003d\u0022`dirname $0`\u0022\n\nset -e\n\nINDENT\u003dindent\nuname -s | grep BSD \u003e /dev/null \u0026\u0026 type gindent \u003e /dev/null 2\u003e\u00261 \u0026\u0026 INDENT\u003dgindent\n\nif [ $# -eq 0 ]; then\n echo \u0022usage: $0 [-v] [-n] [-c] [sourcefile|sourcedir] ...\u0022 \u003e\u00262\n exit 1\nfi\n\nVERBOSE\u003dfalse\nDONT\u003dfalse\nSTOPARGS\u003dfalse\nCOMMENTS\u003dfalse\nCHANGED\u003dfalse\nDEBUG\u003d\u0022\u0022\n\n# for this exercise, we want to force the openssl style, so we roll\n# our own indent profile, which is at a well known location\nINDENT_PROFILE\u003d\u0022$HERE/indent.pro\u0022\nexport INDENT_PROFILE\nif [ ! -f \u0022$INDENT_PROFILE\u0022 ]; then\n echo \u0022$0: unable to locate the openssl indent.pro file\u0022 \u003e\u00262\n exit 1\nfi\n\n# Extra arguments; for adding the comment-formatting\nINDENT_ARGS\u003d\u0022\u0022\nfor i \ndo\n if [ \u0022$STOPARGS\u0022 !\u003d \u0022true\u0022 ]; then\n case $i in\n --) STOPARGS\u003d\u0022true\u0022; continue;;\n -n) DONT\u003d\u0022true\u0022; continue;;\n -v) VERBOSE\u003d\u0022true\u0022; \n\t echo \u0022INDENT_PROFILE\u003d$INDENT_PROFILE\u0022;\n\t continue;;\n -c) COMMENTS\u003d\u0022true\u0022; \n \t INDENT_ARGS\u003d\u0022-fc1 -fca -cdb -sc\u0022; \n\t continue;;\n -nc) COMMENTS\u003d\u0022true\u0022;\n\t continue;;\n -d) DEBUG\u003d'eval tee \u0022$j.pre\u0022 |'\n\t continue;;\n esac\n fi\n\n if [ -d \u0022$i\u0022 ]; then\n LIST\u003d`find \u0022$i\u0022 -name '*.[ch]' -print`\n else \n if [ ! -f \u0022$i\u0022 ]; then\n echo \u0022$0: source file not found: $i\u0022 \u003e\u00262\n exit 1\n fi\n LIST\u003d\u0022$i\u0022\n fi\n \n for j in $LIST\n do\n # ignore symlinks - we only ever process the base file - so if we\n # expand a directory tree we need to ignore any located symlinks\n if [ -d \u0022$i\u0022 ]; then\n if [ -h \u0022$j\u0022 ]; then\n\tcontinue;\n fi\n fi\n\n if [ \u0022$DONT\u0022 \u003d \u0022false\u0022 ]; then\n tmp\u003d$(mktemp /tmp/indent.XXXXXX)\n trap 'rm -f \u0022$tmp\u0022' HUP INT TERM EXIT\n\n case `basename $j` in \n\t# the list of files that indent is unable to handle correctly\n\t# that we simply leave alone for manual formatting now\n\tobj_dat.h|aes_core.c|aes_x86core.c|ecp_nistz256.c)\n\t echo \u0022skipping $j\u0022\n\t ;;\n\t*)\n\t if [ \u0022$COMMENTS\u0022 \u003d \u0022true\u0022 ]; then\n\t # we have to mark single line comments as /*- ...*/ to stop indent\n\t # messing with them, run expand then indent as usual but with the\n\t # the process-comments options and then undo that marking, and then \n\t # finally re-run indent without process-comments so the marked-to-\n\t # be-ignored comments we did automatically end up getting moved \n\t # into the right possition within the code as indent leaves marked \n\t # comments entirely untouched - we appear to have no way to avoid \n\t # the double processing and get the desired output\n\t cat \u0022$j\u0022 | \u005c\n\t expand | \u005c\n\t perl -0 -np \u005c\n\t -e 's/(\u005cn#[ \u005ct]*ifdef[ \u005ct]+__cplusplus\u005cn[^\u005cn]*\u005cn#[ \u005ct]*endif\u005cn)/\u005cn\u005c/**INDENT-OFF**\u005c/$1\u005c/**INDENT-ON**\u005c/\u005cn/g;' \u005c\n\t -e 's/(\u005cn\u005c/\u005c*\u005c!)/\u005cn\u005c/**/g;' \u005c\n\t -e 's/(STACK_OF|LHASH_OF)\u005c(([^ \u005ct,\u005c)]+)\u005c)( |\u005cn)/$1_$2_$3/g;' \u005c\n\t | \u005c\n\t perl -np \u005c\n\t -e 's/^([ \u005ct]*)\u005c/\u005c*([ \u005ct]+.*)\u005c*\u005c/[ \u005ct]*$/my ($x1,$x2) \u003d ($1, $2); if (length(\u0022$x1$x2\u0022)\u003c75 \u0026\u0026 $x2 !~ m#^\u005cs*\u005c*INDENT-(ON|OFF)\u005c*\u005cs*$#) {$c\u003d\u0022-\u0022}else{$c\u003d\u0022\u0022}; \u0022$x1\u005c/*$c$x2*\u005c/\u0022/e;' \u005c\n\t -e 's/^\u005c/\u005c* ((Copyright|\u003d|----).*)$/\u005c/*-$1/;' \u005c\n\t -e 's/^((DECLARE|IMPLEMENT)_.*)$/\u005c/**INDENT-OFF**\u005c/\u005cn$1\u005cn\u005c/**INDENT-ON**\u005c//;' \u005c\n\t -e 's/^([ \u005ct]*(make_dh|make_dh_bn|make_rfc5114_td)\u005c(.*\u005c)[ \u005ct,]*)$/\u005c/**INDENT-OFF**\u005c/\u005cn$1\u005cn\u005c/**INDENT-ON**\u005c//;' \u005c\n\t -e 's/^(ASN1_ADB_TEMPLATE\u005c(.*)$/\u005c/**INDENT-OFF**\u005c/\u005cn$1\u005cn\u005c/**INDENT-ON**\u005c//;' \u005c\n\t -e 's/^((ASN1|ADB)_.*_(end|END)\u005c(.*[\u005c){\u003d,;]+[ \u005ct]*)$/$1\u005cn\u005c/**INDENT-ON**\u005c//;' \u005c\n\t -e '/ASN1_(ITEM_ref|ITEM_ptr|ITEM_rptr|PCTX)/ || s/^((ASN1|ADB)_[^\u005c*]*[){\u003d,]+[ \u005ct]*)$/\u005c/**INDENT-OFF**\u005c/\u005cn$1/;' \u005c\n\t -e 's/^(} (ASN1|ADB)_[^\u005c*]*[\u005c){\u003d,;]+)$/$1\u005cn\u005c/**INDENT-ON**\u005c//;' \u005c\n\t | \u005c\n\t $DEBUG $INDENT $INDENT_ARGS | \u005c\n\t perl -np \u005c\n\t\t-e 's/^([ \u005ct]*)\u005c/\u005c*-(.*)\u005c*\u005c/[ \u005ct]*$/$1\u005c/*$2*\u005c//;' \u005c\n\t\t-e 's/^\u005c/\u005c*-((Copyright|\u003d|----).*)$/\u005c/* $1/;' \u005c\n\t | $INDENT | \u005c\n\t perl -0 -np \u005c\n\t\t-e 's/\u005c/\u005c*\u005c*INDENT-(ON|OFF)\u005c*\u005c*\u005c/\u005cn//g;' \u005c\n\t | perl -np \u005c\n\t -e 's/(STACK_OF|LHASH_OF)_([^ \u005ct,]+)_( |\u005c/)/$1($2)$3/g;' \u005c\n\t -e 's/(STACK_OF|LHASH_OF)_([^ \u005ct,]+)_$/$1($2)/g;' \u005c\n\t | perl \u0022$HERE\u0022/su-filter.pl \u005c\n\t \u003e \u0022$tmp\u0022\n\t else\n\t expand \u0022$j\u0022 | $INDENT $INDENT_ARGS \u003e \u0022$tmp\u0022\n\t fi;\n\t if cmp -s \u0022$tmp\u0022 \u0022$j\u0022; then\n\t if [ \u0022$VERBOSE\u0022 \u003d \u0022true\u0022 ]; then\n\t echo \u0022$j unchanged\u0022\n\t fi\n\t rm \u0022$tmp\u0022\n\t else\n\t if [ \u0022$VERBOSE\u0022 \u003d \u0022true\u0022 ]; then\n\t echo \u0022$j changed\u0022\n\t fi\n\t CHANGED\u003dtrue\n\t mv \u0022$tmp\u0022 \u0022$j\u0022\n\t fi\n\t ;;\n esac\n fi\n done\ndone\n\n\nif [ \u0022$VERBOSE\u0022 \u003d \u0022true\u0022 ]; then\n echo\n if [ \u0022$CHANGED\u0022 \u003d \u0022true\u0022 ]; then\n echo \u0022SOURCE WAS MODIFIED\u0022\n else\n echo \u0022SOURCE WAS NOT MODIFIED\u0022\n fi\nfi\n","s":{"c":1753413447,"u": 355}}
],"g": 3111,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 1, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}