+ * Note: Labels are moved forward if possible, that is, they are moved to the
+ * next insn (not the preceeding one).
+ */
+
+void CS_DelEntries (CodeSeg* S, unsigned Start, unsigned Count);
+/* Delete a range of code entries. This includes removing references to labels,
+ * labels attached to the entries and so on.
+ */
+
+void CS_MoveEntries (CodeSeg* S, unsigned Start, unsigned Count, unsigned NewPos);
+/* Move a range of entries from one position to another. Start is the index
+ * of the first entry to move, Count is the number of entries and NewPos is
+ * the index of the target entry. The entry with the index Start will later
+ * have the index NewPos. All entries with indices NewPos and above are
+ * moved to higher indices. If the code block is moved to the end of the
+ * current code, and if pending labels exist, these labels will get attached
+ * to the first instruction of the moved block (the first one after the
+ * current code end)
+ */
+
+#if defined(HAVE_INLINE)
+INLINE void CS_MoveEntry (CodeSeg* S, unsigned OldPos, unsigned NewPos)
+/* Move an entry from one position to another. OldPos is the current position
+ * of the entry, NewPos is the new position of the entry.
+ */
+{
+ CollMove (&S->Entries, OldPos, NewPos);
+}
+#else
+# define CS_MoveEntry(S, OldPos, NewPos) CollMove (&(S)->Entries, OldPos, NewPos)
+#endif
+
+#if defined(HAVE_INLINE)
+INLINE struct CodeEntry* CS_GetEntry (CodeSeg* S, unsigned Index)
+/* Get an entry from the given code segment */
+{
+ return CollAt (&S->Entries, Index);
+}
+#else
+# define CS_GetEntry(S, Index) ((struct CodeEntry*) CollAt(&(S)->Entries, (Index)))
+#endif
+
+struct CodeEntry* CS_GetPrevEntry (CodeSeg* S, unsigned Index);
+/* Get the code entry preceeding the one with the index Index. If there is no
+ * preceeding code entry, return NULL.
+ */
+
+struct CodeEntry* CS_GetNextEntry (CodeSeg* S, unsigned Index);
+/* Get the code entry following the one with the index Index. If there is no
+ * following code entry, return NULL.