You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/05/24 02:48:01 UTC
[jira] [Commented] (TS-2528) better bool handling in public APIs
(ts / mgmt)
[ https://issues.apache.org/jira/browse/TS-2528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14007934#comment-14007934 ]
ASF subversion and git services commented on TS-2528:
-----------------------------------------------------
Commit bc054cf8d8a7254061411f53b999c8b0cfa1052d in trafficserver's branch refs/heads/master from [~zwoop]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=bc054cf ]
TS-2528 Use <stdbool.h> in the public mgmtapi.h interface, C99 standard.
> better bool handling in public APIs (ts / mgmt)
> -----------------------------------------------
>
> Key: TS-2528
> URL: https://issues.apache.org/jira/browse/TS-2528
> Project: Traffic Server
> Issue Type: Bug
> Components: Management API
> Reporter: Zhao Yongming
> Assignee: Leif Hedstrom
> Labels: api-change
> Fix For: 5.0.0
>
>
> {code}
> tsapi bool TSListIsEmpty(TSList l);
> tsapi bool TSListIsValid(TSList l);
> tsapi bool TSIpAddrListIsEmpty(TSIpAddrList ip_addrl);
> tsapi bool TSIpAddrListIsValid(TSIpAddrList ip_addrl);
> tsapi bool TSPortListIsEmpty(TSPortList portl);
> tsapi bool TSPortListIsValid(TSPortList portl);
> tsapi bool TSStringListIsEmpty(TSStringList strl);
> tsapi bool TSStringListIsValid(TSStringList strl);
> tsapi bool TSIntListIsEmpty(TSIntList intl);
> tsapi bool TSIntListIsValid(TSIntList intl, int min, int max);
> tsapi bool TSDomainListIsEmpty(TSDomainList domainl);
> tsapi bool TSDomainListIsValid(TSDomainList domainl);
> tsapi TSError TSRestart(bool cluster);
> tsapi TSError TSBounce(bool cluster);
> tsapi TSError TSStatsReset(bool cluster, const char *name = NULL);
> tsapi TSError TSEventIsActive(char *event_name, bool * is_current);
> {code}
> and we have:
> {code}
> #if !defined(linux)
> #if defined (__SUNPRO_CC) || (defined (__GNUC__) || ! defined(__cplusplus))
> #if !defined (bool)
> #if !defined(darwin) && !defined(freebsd) && !defined(solaris)
> // XXX: What other platforms are there?
> #define bool int
> #endif
> #endif
> #if !defined (true)
> #define true 1
> #endif
> #if !defined (false)
> #define false 0
> #endif
> #endif
> #endif // not linux
> {code}
> I'd like we can make it a typedef or replace bool with int completely, to make things better to be parsed by SWIG tools etc.
--
This message was sent by Atlassian JIRA
(v6.2#6252)