8000 taylor-uucp/time.c at master · hsn10/taylor-uucp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":"contrib","path":"contrib","contentType":"directory"},{"name":"lib","path":"lib","contentType":"directory"},{"name":"sample","path":"sample","contentType":"directory"},{"name":"unix","path":"unix","contentType":"directory"},{"name":"uuconf","path":"uuconf","contentType":"directory"},{"name":".cvsignore","path":".cvsignore","contentType":"file"},{"name":".travis.yml","path":".travis.yml","contentType":"file"},{"name":"AUTHORS","path":"AUTHORS","contentType":"file"},{"name":"COPYING","path":"COPYING","contentType":"file"},{"name":"ChangeLog","path":"ChangeLog","contentType":"file"},{"name":"INSTALL","path":"INSTALL","contentType":"file"},{"name":"Makefile.am","path":"Makefile.am","contentType":"file"},{"name":"Makefile.in","path":"Makefile.in","contentType":"file"},{"name":"NEWS","path":"NEWS","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"TODO","path":"TODO","contentType":"file"},{"name":"aclocal.m4","path":"aclocal.m4","contentType":"file"},{"name":"chat.c","path":"chat.c","contentType":"file"},{"name":"compile","path":"compile","contentType":"file"},{"name":"config.h.in","path":"config.h.in","contentType":"file"},{"name":"configure","path":"configure","contentType":"file"},{"name":"configure.in","path":"configure.in","contentType":"file"},{"name":"conn.c","path":"conn.c","contentType":"file"},{"name":"conn.h","path":"conn.h","contentType":"file"},{"name":"copy.c","path":"copy.c","contentType":"file"},{"name":"cu.1","path":"cu.1","contentType":"file"},{"name":"cu.c","path":"cu.c","contentType":"file"},{"name":"cu.h","path":"cu.h","contentType":"file"},{"name":"depcomp","path":"depcomp","contentType":"file"},{"name":"ftm.h","path":"ftm.h","contentType":"file"},{"name":"getopt.h","path":"getopt.h","contentType":"file"},{"name":"install-sh","path":"install-sh","contentType":"file"},{"name":"log.c","path":"log.c","contentType":"file"},{"name":"missing","path":"missing","contentType":"file"},{"name":"mkinstalldirs","path":"mkinstalldirs","contentType":"file"},{"name":"policy.h","path":"policy.h","contentType":"file"},{"name":"prot.c","path":"prot.c","contentType":"file"},{"name":"prot.h","path":"prot.h","contentType":"file"},{"name":"prote.c","path":"prote.c","contentType":"file"},{"name":"protf.c","path":"protf.c","contentType":"file"},{"name":"protg.c","path":"protg.c","contentType":"file"},{"name":"proti.c","path":"proti.c","contentType":"file"},{"name":"protj.c","path":"protj.c","contentType":"file"},{"name":"prott.c","path":"prott.c","contentType":"file"},{"name":"proty.c","path":"proty.c","contentType":"file"},{"name":"protz.c","path":"protz.c","contentType":"file"},{"name":"rec.c","path":"rec.c","contentType":"file"},{"name":"send.c","path":"send.c","contentType":"file"},{"name":"stamp-h.in","path":"stamp-h.in","contentType":"file"},{"name":"sysdep.h","path":"sysdep.h","contentType":"file"},{"name":"system.h","path":"system.h","contentType":"file"},{"name":"texinfo.tex","path":"texinfo.tex","contentType":"file"},{"name":"time.c","path":"time.c","contentType":"file"},{"name":"trans.c","path":"trans.c","contentType":"file"},{"name":"trans.h","path":"trans.h","contentType":"file"},{"name":"tstuu.c","path":"tstuu.c","contentType":"file"},{"name":"util.c","path":"util.c","contentType":"file"},{"name":"uuchk.c","path":"uuchk.c","contentType":"file"},{"name":"uucico.8","path":"uucico.8","contentType":"file"},{"name":"uucico.c","path":"uucico.c","contentType":"file"},{"name":"uuconf.h","path":"uuconf.h","contentType":"file"},{"name":"uuconv.c","path":"uuconv.c","contentType":"file"},{"name":"uucp.1","path":"uucp.1","contentType":"file"},{"name":"uucp.c","path":"uucp.c","contentType":"file"},{"name":"uucp.h","path":"uucp.h","contentType":"file"},{"name":"uucp.texi","path":"uucp.texi","contentType":"file"},{"name":"uudefs.h","path":"uudefs.h","contentType":"file"},{"name":"uudir.c","path":"uudir.c","contentType":"file"},{"name":"uulog.c","path":"uulog.c","contentType":"file"},{"name":"uuname.c","path":"uuname.c","contentType":"file"},{"name":"uupick.c","path":"uupick.c","contentType":"file"},{"name":"uusched.in","path":"uusched.in","contentType":"file"},{"name":"uustat.1","path":"uustat.1","contentType":"file"},{"name":"uustat.c","path":"uustat.c","contentType":"file"},{"name":"uuto.in","path":"uuto.in","contentType":"file"},{"name":"uux.1","path":"uux.1","contentType":"file"},{"name":"uux.c","path":"uux.c","contentType":"file"},{"name":"uuxqt.8","path":"uuxqt.8","contentType":"file"},{"name":"uuxqt.c","path":"uuxqt.c","contentType":"file"},{"name":"xcmd.c","path":"xcmd.c","contentType":"file"}],"totalCount":80}},"fileTreeProcessingTime":17.799397000000003,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":203546361,"defaultBranch":"master","name":"taylor-uucp","ownerLogin":"hsn10","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2019-08-21T09:00:15.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/1170075?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1614819954.112563","canEdit":false,"refType":"branch","currentOid":"315b2a0650eef5a385a8e8d3989718b2c0c21d72"},"path":"time.c","currentUser":null,"blob":{"rawLines":["/* time.c"," Routines to deal with UUCP time spans.",""," Copyright (C) 1991, 1992, 1993 Ian Lance Taylor",""," This file is part of the Taylor UUCP package.",""," This program is free software; you can redistribute it and/or"," modify it under the terms of the GNU General Public License as"," published by the Free Software Foundation; either version 2 of the"," License, or (at your option) any later version.",""," This program is distributed in the hope that it will be useful, but"," WITHOUT ANY WARRANTY; without even the implied warranty of"," MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU"," General Public License for more details.",""," You should have received a copy of the GNU General Public License"," along with this program; if not, write to the Free Software"," Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.",""," The author of the program may be contacted at ian@airs.com."," */","","#include \"uucp.h\"","","#if USE_RCS_ID","const char time_rcsid[] = \"$Id$\";","#endif","","#include \u003cctype.h\u003e","","#if TM_IN_SYS_TIME","#include \u003csys/time.h\u003e","#else","#include \u003ctime.h\u003e","#endif","","#include \"uudefs.h\"","#include \"uuconf.h\"","","\f","/* See if the current time matches a time span. If it does, return"," TRUE, set *pival to the value for the matching span, and set"," *pcretry to the retry for the matching span. Otherwise return"," FALSE. */","","boolean","ftimespan_match (const struct uuconf_timespan *qspan, long int *pival, int *pcretry)","{"," time_t inow;"," struct tm *qtm;"," int itm;"," const struct uuconf_timespan *q;",""," if (qspan == NULL)"," return FALSE;",""," time (\u0026inow);"," qtm = localtime (\u0026inow);",""," /* Get the number of minutes since Sunday for the time. */"," itm = qtm-\u003etm_wday * 24 * 60 + qtm-\u003etm_hour * 60 + qtm-\u003etm_min;",""," for (q = qspan; q != NULL; q = q-\u003euuconf_qnext)"," {"," if (q-\u003euuconf_istart \u003c= itm \u0026\u0026 itm \u003c= q-\u003euuconf_iend)","\t{","\t if (pival != NULL)","\t *pival = q-\u003euuconf_ival;","\t if (pcretry != NULL)","\t *pcretry = q-\u003euuconf_cretry;","\t return TRUE;","\t}"," }",""," return FALSE;","}","\f","/* Determine the maximum size that may ever be transferred, according"," to a timesize span. This returns -1 if there is no limit. */","","long","cmax_size_ever (const struct uuconf_timespan *qtimesize)","{"," long imax;"," const struct uuconf_timespan *q;",""," if (qtimesize == NULL)"," return -1;",""," /* Look through the list of spans. If there is any gap larger than"," 1 hour, we assume there are no restrictions. Otherwise we keep"," track of the largest value we see. I picked 1 hour arbitrarily,"," on the theory that a 1 hour span to transfer large files might"," actually occur, and is probably not an accident. */"," if (qtimesize-\u003euuconf_istart \u003e= 60)"," return -1;",""," imax = -1;",""," for (q = qtimesize; q != NULL; q = q-\u003euuconf_qnext)"," {"," if (q-\u003euuconf_qnext == NULL)","\t{","\t if (q-\u003euuconf_iend \u003c= 6 * 24 * 60 + 23 * 60)","\t return -1;","\t}"," else","\t{","\t if (q-\u003euuconf_iend + 60 \u003c= q-\u003euuconf_qnext-\u003euuconf_istart)","\t return -1;","\t}",""," if (imax \u003c q-\u003euuconf_ival)","\timax = q-\u003euuconf_ival;"," }",""," return imax;","}"],"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/hsn10/taylor-uucp/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"time.c","displayUrl":"https://github.com/hsn10/taylor-uucp/blob/master/time.c?raw=true","headerInfo":{"blobSize":"2.99 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"dae7e48","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fhsn10%2Ftaylor-uucp%2Fblob%2Fmaster%2Ftime.c","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"120","truncatedSloc":"93"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"C","languageID":41,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/hsn10/taylor-uucp/blob/master/time.c","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/hsn10/taylor-uucp/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/hsn10/taylor-uucp/raw/refs/heads/master/time.c","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/hsn10/taylor-uucp/branches":{"post":"dQrGCV8FZ0ouNTAI2Ztd-IOMLvxt6yJrpQyZS0Wy7G7bqJfuFJARbuhhuJvmsdUc4A901eTZGjVZH0OffaSDQw"},"/repos/preferences":{"post":"jPf2etAdKnMDYiSSObuBydunmnNiPVTrRBwR_j7oeQI1lXNyElf2uf7YGPFPR6elMvAPUIxD0EyQICH77rYzZw"}}},"title":"taylor-uucp/time.c at master · hsn10/taylor-uucp","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1b17b3e7786a.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0