Version 18 of Tcl C API

Updated 2008-05-07 12:53:56 by LV

The file tcl.h should be considered a public declaration of the Tcl C functions, defines/macros, and structures which a developer can safely depend on. (Some extensions also use things from tclInt.h, but the price for that is that they require more maintenance in order to keep working. Stick with tcl.h as long as possible.) Most of the actual function declarations are found in the tclDecls.h file; this has to do with the Stubs mechanism.

LV When I look in tcl.h, I see only 3 functions listed, along with 2 tcl related #include lines - tclDecls.h and tclPlatDecls.h. Is it correct to assume that the 603 functions declared as EXTERN in the two additional files (in Tcl 8.5) are all considered a part of the public API for Tcl?


Tcl C API functions include:

  • Tcl_Main
  • TclObjTest_Init
  • TclThread_Init
  • Tcl_SetVar
  • TCL_MEM_DEBUG
  • Tcl_Access
  • Tcl_AddErrorInfo
  • Tcl_AddObjErrorInfo
  • Tcl_AlertNotifier
  • Tcl_Alloc
  • Tcl_AllocStatBuf
  • Tcl_AllowExceptions
  • Tcl_AppInit
  • Tcl_AppInitProc
  • Tcl_AppendAllObjTypes
  • Tcl_AppendElement
  • Tcl_AppendObjToObj
  • Tcl_AppendResult
  • Tcl_AppendResultVA
  • Tcl_AppendStringsToObj
  • Tcl_AppendStringsToObjVA
  • Tcl_AppendToObj
  • Tcl_AppendUnicodeToObj
  • Tcl_AsyncCreate
  • Tcl_AsyncDelete
  • Tcl_AsyncInvoke
  • Tcl_AsyncMark
  • Tcl_AsyncProc
  • Tcl_AsyncReady
  • Tcl_AttemptAlloc
  • Tcl_AttemptRealloc
  • Tcl_AttemptSetObjLength
  • Tcl_BackgroundError
  • Tcl_Backslash
  • Tcl_BadChannelOption
  • Tcl_CallWhenDeleted
  • Tcl_CancelIdleCall
  • Tcl_ChannelBlockModeProc
  • Tcl_ChannelBuffered
  • Tcl_ChannelClose2Proc
  • Tcl_ChannelCloseProc
  • Tcl_ChannelFlushProc
  • Tcl_ChannelGetHandleProc
  • Tcl_ChannelGetOptionProc
  • Tcl_ChannelHandlerProc
  • Tcl_ChannelInputProc
  • Tcl_ChannelName
  • Tcl_ChannelOutputProc
  • Tcl_ChannelProc
  • Tcl_ChannelSeekProc
  • Tcl_ChannelSetOptionProc
  • Tcl_ChannelThreadActionProc
  • Tcl_ChannelVersion
  • Tcl_ChannelWatchProc
  • Tcl_ChannelWideSeekProc
  • Tcl_Chdir
  • Tcl_ClearChannelHandlers
  • Tcl_Close
  • Tcl_CloseProc
  • Tcl_CmdDeleteProc
  • Tcl_CmdProc
  • Tcl_CmdTraceProc
  • Tcl_CmdObjTraceProc
  • Tcl_CommandComplete
  • Tcl_CommandTraceInfo
  • Tcl_Concat
  • Tcl_ConcatObj
  • Tcl_ConditionFinalize
  • Tcl_ConditionNotify
  • Tcl_ConditionWait
  • Tcl_ConvertCountedElement
  • Tcl_ConvertElement
  • Tcl_ConvertToType
  • Tcl_CreateAlias
  • Tcl_CreateAliasObj
  • Tcl_CreateChannel
  • Tcl_CreateChannelHandler
  • Tcl_CreateCloseHandler
  • Tcl_CreateCommand
  • Tcl_CreateEncoding
  • Tcl_CreateExitHandler
  • Tcl_CreateFileHandler
  • Tcl_CreateHashEntry
  • Tcl_CreateInterp
  • Tcl_CreateMathFunc
  • Tcl_CreateObjTrace
  • Tcl_CreateSlave
  • Tcl_CreateThread
  • Tcl_CreateThreadExitHandler
  • Tcl_CreateTimerHandler
  • Tcl_CreateTrace
  • Tcl_CutChannel
  • Tcl_DStringAppend
  • Tcl_DStringAppendElement
  • Tcl_DStringEndSublist
  • Tcl_DStringFree
  • Tcl_DStringGetResult
  • Tcl_DStringInit
  • Tcl_DStringLength
  • Tcl_DStringResult
  • Tcl_DStringSetLength
  • Tcl_DStringStartSublist
  • Tcl_DStringTrunc
  • Tcl_DStringValue
  • Tcl_DecrRefCount
  • Tcl_DeleteAssocData
  • Tcl_DeleteChannelHandler
  • Tcl_DeleteCloseHandler
  • Tcl_DeleteCommand
  • Tcl_DeleteCommandFromToken
  • Tcl_DeleteEventSource
  • Tcl_DeleteEvents
  • Tcl_DeleteExitHandler
  • Tcl_DeleteFileHandler
  • Tcl_DeleteHashEntry
  • Tcl_DeleteHashTable
  • Tcl_DeleteInterp
  • Tcl_DeleteThreadExitHandler
  • Tcl_DeleteTimerHandler
  • Tcl_DeleteTrace
  • Tcl_DetachChannel
  • Tcl_DetachPids
  • Tcl_DiscardResult
  • Tcl_DoWhenIdle
  • Tcl_DontCallWhenDeleted
  • Tcl_DumpActiveMemory
  • Tcl_DuplicateObj
  • Tcl_Eof
  • Tcl_ErrnoId
  • Tcl_ErrnoMsg
  • Tcl_Eval
  • Tcl_EvalEx
  • Tcl_EvalFile
  • Tcl_EvalObjEx
  • Tcl_EvalObjv
  • Tcl_EvalTokens
  • Tcl_EvalTokensStandard
  • Tcl_EventuallyFree
  • Tcl_Exit
  • Tcl_ExitThread
  • Tcl_ExposeCommand
  • Tcl_ExprBoolean
  • Tcl_ExprBooleanObj
  • Tcl_ExprDouble
  • Tcl_ExprDoubleObj
  • Tcl_ExprLong
  • Tcl_ExprLongObj
  • Tcl_ExprObj
  • Tcl_ExprString
  • Tcl_ExternalToUtf
  • Tcl_ExternalToUtfDString
  • Tcl_FSAccess
  • Tcl_FSChdir
  • Tcl_FSConvertToPathType
  • Tcl_FSCopyDirectory
  • Tcl_FSCopyFile
  • Tcl_FSCreateDirectory
  • Tcl_FSData
  • Tcl_FSDeleteFile
  • Tcl_FSEqualPaths
  • Tcl_FSEvalFile
  • Tcl_FSFileAttrStrings
  • Tcl_FSFileAttrsGet
  • Tcl_FSFileAttrsSet
  • Tcl_FSFileSystemInfo
  • Tcl_FSGetCwd
  • Tcl_FSGetFileSystemForPath
  • Tcl_FSGetInternalRep
  • Tcl_FSGetNativePath
  • Tcl_FSGetNormalizedPath
  • Tcl_FSGetPathType
  • Tcl_FSGetTranslatedPath
  • Tcl_FSGetTranslatedStringPath
  • Tcl_FSJoinPath
  • Tcl_FSJoinToPath
  • Tcl_FSLink
  • Tcl_FSListVolumes
  • Tcl_FSLoadFile
  • Tcl_FSLstat
  • Tcl_FSMatchInDirectory
  • Tcl_FSMountsChanged
  • Tcl_FSNewNativePath
  • Tcl_FSOpenFileChannel
  • Tcl_FSPathSeparator
  • Tcl_FSRegister
  • Tcl_FSRemoveDirectory
  • Tcl_FSRenameFile
  • Tcl_FSSplitPath
  • Tcl_FSStat
  • Tcl_FSUnregister
  • Tcl_FSUtime
  • Tcl_Finalize
  • Tcl_FinalizeNotifier
  • Tcl_FinalizeThread
  • Tcl_FindExecutable
  • Tcl_FindHashEntry
  • Tcl_FirstHashEntry
  • Tcl_Flush
  • Tcl_Free
  • Tcl_FreeEncoding
  • Tcl_FreeParse
  • Tcl_FreeResult
  • Tcl_GetAlias
  • Tcl_GetAliasObj
  • Tcl_GetAssocData
  • Tcl_GetBoolean
  • Tcl_GetBooleanFromObj
  • Tcl_GetByteArrayFromObj
  • Tcl_GetChannel
  • Tcl_GetChannelBufferSize
  • Tcl_GetChannelHandle
  • Tcl_GetChannelInstanceData
  • Tcl_GetChannelMode
  • Tcl_GetChannelName
  • Tcl_GetChannelNames
  • Tcl_GetChannelNamesEx
  • Tcl_GetChannelOption
  • Tcl_GetChannelThread
  • Tcl_GetChannelType
  • Tcl_GetCharLength
  • Tcl_GetCommandFromObj
  • Tcl_GetCommandFullName
  • Tcl_GetCommandInfo
  • Tcl_GetCommandInfoFromToken
  • Tcl_GetCommandName
  • Tcl_GetCurrentThread
  • Tcl_GetCwd
  • Tcl_GetDefaultEncodingDir
  • Tcl_GetDouble
  • Tcl_GetDoubleFromObj
  • Tcl_GetEncoding
  • Tcl_GetEncodingName
  • Tcl_GetEncodingNames
  • Tcl_GetErrno
  • Tcl_GetHashKey
  • Tcl_GetHashValue
  • Tcl_GetHostName
  • Tcl_GetIndexFromObj
  • Tcl_GetIndexFromObjStruct
  • Tcl_GetInt
  • Tcl_GetIntFromObj
  • Tcl_GetInterpPath
  • Tcl_GetLongFromObj
  • Tcl_GetMaster
  • Tcl_GetMathFuncInfo
  • Tcl_GetMemoryInfo
  • Tcl_GetNameOfExecutable
  • Tcl_GetOSTypeFromObj
  • Tcl_GetObjResult
  • Tcl_GetObjType
  • Tcl_GetOpenFile
  • Tcl_GetPathType
  • Tcl_GetRange
  • Tcl_GetRegExpFromObj
  • Tcl_GetServiceMode
  • Tcl_GetSlave
  • Tcl_GetStackedChannel
  • Tcl_GetStdChannel
  • Tcl_GetString
  • Tcl_GetStringFromObj
  • Tcl_GetStringResult
  • Tcl_GetThreadData
  • Tcl_GetTime
  • Tcl_GetTopChannel
  • Tcl_GetUniChar
  • Tcl_GetUnicode
  • Tcl_GetUnicodeFromObj
  • Tcl_GetVar
  • Tcl_GetVar2
  • Tcl_GetVar2Ex
  • Tcl_GetVersion
  • Tcl_GetWideIntFromObj
  • Tcl_Gets
  • Tcl_GetsObj
  • Tcl_GlobalEval
  • Tcl_GlobalEvalObj
  • Tcl_HashStats
  • Tcl_HideCommand
  • Tcl_IncrRefCount
  • Tcl_InitCustomHashTable
  • Tcl_InitHashTable
  • Tcl_InitMemory
  • Tcl_InitNotifier
  • Tcl_InitObjHashTable
  • Tcl_InputBlocked
  • Tcl_InputBuffered
  • Tcl_Interp
  • Tcl_InterpDeleted
  • Tcl_InvalidateStringRep
  • Tcl_IsChannelExisting
  • Tcl_IsChannelRegistered
  • Tcl_IsChannelShared
  • Tcl_IsSafe
  • Tcl_IsShared
  • Tcl_IsStandardChannel
  • Tcl_JoinPath
  • Tcl_JoinThread
  • Tcl_LinkVar
  • Tcl_ListMathFuncs
  • Tcl_ListObjAppendElement
  • Tcl_ListObjAppendList
  • Tcl_ListObjGetElements
  • Tcl_ListObjIndex
  • Tcl_ListObjLength
  • Tcl_ListObjReplace
  • Tcl_LogCommandInfo
  • Tcl_MacConvertTextResource
  • Tcl_MacEvalResource
  • Tcl_MacFindResource
  • Tcl_MacSetEventProc
  • Tcl_Main
  • Tcl_MakeFileChannel
  • Tcl_MakeSafe
  • Tcl_MakeTcpClientChannel
  • Tcl_Merge
  • Tcl_MutexFinalize
  • Tcl_MutexLock
  • Tcl_MutexUnlock
  • Tcl_NewBooleanObj
  • Tcl_NewByteArrayObj
  • Tcl_NewDoubleObj
  • Tcl_NewIntObj
  • Tcl_NewListObj
  • Tcl_NewLongObj
  • Tcl_NewOSTypeObj
  • Tcl_NewObj
  • Tcl_NewUnicodeObj
  • Tcl_NewWideIntObj
  • Tcl_NextHashEntry
  • Tcl_NotifyChannel
  • Tcl_NumUtfChars
  • Tcl_ObjGetVar2
  • Tcl_ObjSetVar2
  • Tcl_OpenCommandChannel
  • Tcl_OpenFileChannel
  • Tcl_OpenTcpClient
  • Tcl_OpenTcpServer
  • Tcl_OutputBuffered
  • Tcl_Panic
  • Tcl_PanicVA
  • Tcl_ParseBraces
  • Tcl_ParseExpr
  • Tcl_ParseQuotedString
  • Tcl_ParseVar
  • Tcl_ParseVarName
  • Tcl_PkgInitStubsCheck
  • Tcl_PkgPresent
  • Tcl_PkgPresentEx
  • Tcl_PkgProvide
  • Tcl_PkgProvideEx
  • Tcl_PkgRequire
  • Tcl_PkgRequireEx
  • Tcl_PosixError
  • Tcl_Preserve
  • Tcl_PrintDouble
  • Tcl_PutEnv
  • Tcl_QueueEvent
  • Tcl_Read
  • Tcl_ReadChars
  • Tcl_ReadRaw
  • Tcl_Realloc
  • Tcl_ReapDetachedProcs
  • Tcl_RecordAndEval
  • Tcl_RecordAndEvalObj
  • Tcl_RegExpCompile
  • Tcl_RegExpExec
  • Tcl_RegExpExecObj
  • Tcl_RegExpGetInfo
  • Tcl_RegExpMatch
  • Tcl_RegExpMatchObj
  • Tcl_RegExpRange
  • Tcl_RegisterChannel
  • Tcl_RegisterObjType
  • Tcl_Release
  • Tcl_RestoreResult
  • Tcl_SaveResult
  • Tcl_ScanCountedElement
  • Tcl_ScanElement
  • Tcl_Seek
  • Tcl_ServiceAll
  • Tcl_ServiceEvent
  • Tcl_SetAssocData
  • Tcl_SetBooleanObj
  • Tcl_SetByteArrayLength
  • Tcl_SetByteArrayObj
  • Tcl_SetChannelBufferSize
  • Tcl_SetChannelOption
  • Tcl_SetCommandInfo
  • Tcl_SetCommandInfoFromToken
  • Tcl_SetDefaultEncodingDir
  • Tcl_SetDoubleObj
  • Tcl_SetErrno
  • Tcl_SetErrorCode
  • Tcl_SetErrorCodeVA
  • Tcl_SetHashValue
  • Tcl_SetIntObj
  • Tcl_SetListObj
  • Tcl_SetLongObj
  • Tcl_SetMainLoop
  • Tcl_SetMaxBlockTime
  • Tcl_SetOSTypeObj
  • Tcl_SetObjErrorCode
  • Tcl_SetObjLength
  • Tcl_SetPanicProc
  • Tcl_SetRecursionLimit
  • Tcl_SetResult
  • Tcl_SetServiceMode
  • Tcl_SetStdChannel
  • Tcl_SetStringObj
  • Tcl_SetSystemEncoding
  • Tcl_SetTimer
  • Tcl_SetUnicodeObj
  • Tcl_SetVar
  • Tcl_SetVar2
  • Tcl_SetVar2Ex
  • Tcl_SetWideIntObj
  • Tcl_SignalId
  • Tcl_SignalMsg
  • Tcl_Sleep
  • Tcl_SourceRCFile
  • Tcl_SpliceChannel
  • Tcl_SplitList
  • Tcl_SplitPath
  • Tcl_StackChannel
  • Tcl_StandardChannels
  • Tcl_Stat
  • Tcl_StaticPackage
  • Tcl_StringCaseMatch
  • Tcl_StringMatch
  • Tcl_SubstObj
  • Tcl_Tell
  • Tcl_ThreadAlert
  • Tcl_ThreadQueueEvent
  • Tcl_TraceCommand
  • Tcl_TraceVar
  • Tcl_TraceVar2
  • Tcl_TranslateFileName
  • Tcl_Ungets
  • Tcl_UniChar
  • Tcl_UniCharAtIndex
  • Tcl_UniCharCaseMatch
  • Tcl_UniCharIsAlnum
  • Tcl_UniCharIsAlpha
  • Tcl_UniCharIsControl
  • Tcl_UniCharIsDigit
  • Tcl_UniCharIsGraph
  • Tcl_UniCharIsLower
  • Tcl_UniCharIsPrint
  • Tcl_UniCharIsPunct
  • Tcl_UniCharIsSpace
  • Tcl_UniCharIsUpper
  • Tcl_UniCharIsWordChar
  • Tcl_UniCharLen
  • Tcl_UniCharNcasecmp
  • Tcl_UniCharNcmp
  • Tcl_UniCharToLower
  • Tcl_UniCharToTitle
  • Tcl_UniCharToUpper
  • Tcl_UniCharToUtf
  • Tcl_UniCharToUtfDString
  • Tcl_UnlinkVar
  • Tcl_UnregisterChannel
  • Tcl_UnsetVar
  • Tcl_UnsetVar2
  • Tcl_UnstackChannel
  • Tcl_UntraceCommand
  • Tcl_UntraceVar
  • Tcl_UntraceVar2
  • Tcl_UpVar
  • Tcl_UpVar2
  • Tcl_UpdateLinkedVar
  • Tcl_UtfAtIndex
  • Tcl_UtfBackslash
  • Tcl_UtfCharComplete
  • Tcl_UtfFindFirst
  • Tcl_UtfFindLast
  • Tcl_UtfNext
  • Tcl_UtfPrev
  • Tcl_UtfToExternal
  • Tcl_UtfToExternalDString
  • Tcl_UtfToLower
  • Tcl_UtfToTitle
  • Tcl_UtfToUniChar
  • Tcl_UtfToUniCharDString
  • Tcl_UtfToUpper
  • Tcl_ValidateAllMemory
  • Tcl_VarEval
  • Tcl_VarEvalVA
  • Tcl_VarTraceInfo
  • Tcl_VarTraceInfo2
  • Tcl_WaitForEvent
  • Tcl_WaitPid
  • Tcl_WinTCharToUtf
  • Tcl_WinUtfToTChar
  • Tcl_Write
  • Tcl_WriteChars
  • Tcl_WriteObj
  • Tcl_WriteRaw
  • TclTomMathInitializeStubs
  • attemptckalloc
  • attemptckrealloc
  • ckalloc
  • ckfree
  • ckrealloc
  • panic
  • panicVA

[A list by topic (where related functions are collected together) should be more useful, as the HTML docs already provide this kind of alphabetic list.] [Feel free to organize data on the wiki in the way that helps you most - or seems to be most helpful.]

with the following APIs having their own pages here on the wiki:

See also Tcl API and the references there. See also Tcl/Tk 8.5: New public C routines