【VxWorks5(1),2024年最新腾讯T2手把手教你

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新Golang全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Go语言开发知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以添加V获取:vip1024b (备注go)
img

正文

01l,21dec86,dnw changed to not get include files from default directories.
01k,01jul86,jlf documentation.
01j,21may86,llk added lstFree and lstNStep.
01i,09apr86,rdc added lstFind.
01h,20jul85,jlf documentation.
01g,19sep84,jlf fixed spacing in comments by adding .ne’s.
01f,08sep84,jlf added comments and copyright notice.
01e,29jun84,dnw added lstConcat and lstExtract.
01d,03jun84,dnw added lstFirst, lstLast.
changed list.{head,tail} to list.node.{next,previous}.
cleaned up comments, etc.
01c,07may84,ecs added lstNext, lstPrevious, and lstCount.
01b,09jun83,ecs modified the documentation
01a,06aug82,dnw created from old singly-linked-list lib which is now “slllb”.
*/

/*
DESCRIPTION
This subroutine library supports the creation and maintenance of a
doubly linked list. The user supplies a list descriptor (type LIST)
that will contain pointers to the first and last nodes in the list,
and a count of the number of nodes in the list. The nodes in the
list can be any user-defined structure, but they must reserve space
for two pointers as their first elements. Both the forward and
backward chains are terminated with a NULL pointer.

The linked-list library simply manipulates the linked-list data structures;
no kernel functions are invoked. In particular, linked lists by themselves
provide no task synchronization or mutual exclusion. If multiple tasks will
access a single linked list, that list must be guarded with some
mutual-exclusion mechanism (e.g., a mutual-exclusion semaphore).

NON-EMPTY LIST:
.CS


| head--------------->| next----------->| next---------
| | | | | | |
| | ------- prev |<---------- prev | |
| | | | | | | |
| tail------ | | … | ----->| … | |
| | | v | v
|count=2| | ----- | -----
--------- | — | —
| - | -

.CE

EMPTY LIST:
.CS

| head------------------
| | |
| tail---------- |
| | | v
| count=0 | ----- -----


.CE

INCLUDE FILES: lstLib.h
*/

/* LINTLIBRARY */

#include “vxWorks.h”
#include “lstLib.h”
#include “stdlib.h”

#define HEAD node.next /* first node in list /
#define TAIL node.previous /
last node in list */

/*********************************************************************
*

  • lstLibInit - initializes lstLib module
  • This routine pulls lstLib into the vxWorks image.
  • RETURNS: N/A
    */
    void lstLibInit (void)
    {
    return;
    }

/*********************************************************************
*

  • lstInit - initialize a list descriptor
  • This routine initializes a specified list to an empty list.
  • RETURNS: N/A
    */

void lstInit
(
FAST LIST pList / ptr to list descriptor to be initialized /
)
{
pList->HEAD = NULL;
pList->TAIL = NULL;
pList->count = 0;
}
/
************************************************************************
*

  • lstAdd - add a node to the end of a list
  • This routine adds a specified node to the end of a specified list.
  • RETURNS: N/A
    */

void lstAdd
(
LIST pList, / pointer to list descriptor /
NODE pNode / pointer to node to be added /
)
{
lstInsert (pList, pList->TAIL, pNode);
}
/
************************************************************************
*

  • lstConcat - concatenate two lists
  • This routine concatenates the second list to the end of the first list.
  • The second list is left empty. Either list (or both) can be
  • empty at the beginning of the operation.
  • RETURNS: N/A
    */

void lstConcat
(
FAST LIST pDstList, / destination list */
FAST LIST pAddList / list to be added to dstList /
)
{
if (pAddList->count == 0) /
nothing to do if AddList is empty */
return;

if (pDstList->count == 0)
*pDstList = pAddList;
else
{
/
both lists non-empty; update DstList pointers */

pDstList->TAIL->next = pAddList->HEAD;
pAddList->HEAD->previous = pDstList->TAIL;
pDstList->TAIL = pAddList->TAIL;

pDstList->count += pAddList->count;
}

/* make AddList empty */

lstInit (pAddList);
}
/**************************************************************************
*

  • lstCount - report the number of nodes in a list
  • This routine returns the number of nodes in a specified list.
  • RETURNS:
  • The number of nodes in the list.
    */

int lstCount
(
LIST pList / pointer to list descriptor /
)
{
return (pList->count);
}
/
*************************************************************************
*

  • lstDelete - delete a specified node from a list
  • This routine deletes a specified node from a specified list.
  • RETURNS: N/A
    */

void lstDelete
(
FAST LIST pList, / pointer to list descriptor */
FAST NODE pNode / pointer to node to be deleted */
)
{
if (pNode->previous == NULL)
pList->HEAD = pNode->next;
else
pNode->previous->next = pNode->next;

if (pNode->next == NULL)
pList->TAIL = pNode->previous;
else
pNode->next->previous = pNode->previous;

/* update node count */

pList->count–;
}
/************************************************************************
*

  • lstExtract - extract a sublist from a list
  • This routine extracts the sublist that starts with and ends
  • with from a source list. It places the extracted list in
  • .
  • RETURNS: N/A
    */

void lstExtract
(
FAST LIST pSrcList, / pointer to source list */
FAST NODE pStartNode, / first node in sublist to be extracted */
FAST NODE pEndNode, / last node in sublist to be extracted */
FAST LIST pDstList / ptr to list where to put extracted list */
)
{
FAST int i;
FAST NODE *pNode;

/* fix pointers in original list */

if (pStartNode->previous == NULL)
pSrcList->HEAD = pEndNode->next;
else
pStartNode->previous->next = pEndNode->next;

if (pEndNode->next == NULL)
pSrcList->TAIL = pStartNode->previous;
else
pEndNode->next->previous = pStartNode->previous;

/* fix pointers in extracted list */

pDstList->HEAD = pStartNode;
pDstList->TAIL = pEndNode;

pStartNode->previous = NULL;
pEndNode->next = NULL;

/* count number of nodes in extracted list and update counts in lists */

i = 0;

for (pNode = pStartNode; pNode != NULL; pNode = pNode->next)
i++;

pSrcList->count -= i;
pDstList->count = i;
}
/************************************************************************
*

  • lstFirst - find first node in list
  • This routine finds the first node in a linked list.
  • RETURNS
  • A pointer to the first node in a list, or
  • NULL if the list is empty.
    */

NODE lstFirst
(
LIST pList / pointer to list descriptor /
)
{
return (pList->HEAD);
}
/
**********************************************************************
*

  • lstGet - delete and return the first node from a list
  • This routine gets the first node from a specified list, deletes the node
  • from the list, and returns a pointer to the node gotten.
  • RETURNS
  • A pointer to the node gotten, or
  • NULL if the list is empty.
    */

NODE *lstGet
(
FAST LIST pList / ptr to list from which to get node */
)
{
FAST NODE *pNode = pList->HEAD;

if (pNode != NULL) /* is list empty? /
{
pList->HEAD = pNode->next; /
make next node be 1st */

if (pNode->next == NULL) /* is there any next node? /
pList->TAIL = NULL; /
no - list is empty /
else
pNode->next->previous = NULL; /
yes - make it 1st node */

pList->count–; /* update node count */
}

return (pNode);
}
/************************************************************************
*

  • lstInsert - insert a node in a list after a specified node
  • This routine inserts a specified node in a specified list.
  • The new node is placed following the list node .
  • If is NULL, the node is inserted at the head of the list.
  • RETURNS: N/A
    */

void lstInsert
(
FAST LIST pList, / pointer to list descriptor */
FAST NODE pPrev, / pointer to node after which to insert */
FAST NODE pNode / pointer to node to be inserted */
)
{
FAST NODE *pNext;

if (pPrev == NULL)
{ /* new node is to be first in list /
pNext = pList->HEAD;
pList->HEAD = pNode;
}
else
{ /
make prev node point fwd to new */
pNext = pPrev->next;
pPrev->next = pNode;
}

if (pNext == NULL)
pList->TAIL = pNode; /* new node is to be last in list /
else
pNext->previous = pNode; /
make next node point back to new */

/* set pointers in new node, and update node count */

pNode->next = pNext;
pNode->previous = pPrev;

pList->count++;
}
/************************************************************************
*

  • lstLast - find the last node in a list
  • This routine finds the last node in a list.
  • RETURNS
  • A pointer to the last node in the list, or
  • NULL if the list is empty.
    */

NODE lstLast
(
LIST pList / pointer to list descriptor /
)
{
return (pList->TAIL);
}
/
**********************************************************************
*

  • lstNext - find the next node in a list
  • This routine locates the node immediately following a specified node.
  • RETURNS:
  • A pointer to the next node in the list, or
  • NULL if there is no next node.
    */

NODE lstNext
(
NODE pNode / ptr to node whose successor is to be found /
)
{
return (pNode->next);
}
/
**********************************************************************
*

  • lstNth - find the Nth node in a list
  • This routine returns a pointer to the node specified by a number
  • where the first node in the list is numbered 1.
  • Note that the search is optimized by searching forward from the beginning
  • if the node is closer to the head, and searching back from the end
  • if it is closer to the tail.
  • RETURNS:
  • A pointer to the Nth node, or
  • NULL if there is no Nth node.
    */

NODE *lstNth
(
FAST LIST pList, / pointer to list descriptor /
FAST int nodenum /
number of node to be found */
)
{
FAST NODE *pNode;

/* verify node number is in list */

if ((nodenum < 1) || (nodenum > pList->count))
return (NULL);

/* if nodenum is less than half way, look forward from beginning;
otherwise look back from end */

if (nodenum < (pList->count >> 1))
{
pNode = pList->HEAD;

while (–nodenum > 0)
pNode = pNode->next;
}

else
{
nodenum -= pList->count;
pNode = pList->TAIL;

while (nodenum++ < 0)
pNode = pNode->previous;
}

return (pNode);
}
/************************************************************************

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Go)
img

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
}

else
{
nodenum -= pList->count;
pNode = pList->TAIL;

while (nodenum++ < 0)
pNode = pNode->previous;
}

return (pNode);
}
/************************************************************************

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Go)
[外链图片转存中…(img-nMlzlENt-1713177670155)]

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值